On August 2, Luke Marsden (Weaveworks) and Marco Ceppi (Canonical) presented a webinar on how to Speed up your software development lifecycle with Kubernetes. In the session they described how you can use conjure-up and Weave Cloud to set up, manage and monitor an app in Kubernetes. In this tutorial we’re going to show you how to set up Kubernetes on any cloud, the conjure-up way. Once the cluster is spun up, you’ll use Weave Cloud to deploy an application, explore the microservices and monitor the app as it runs in the cluster.
Canonical’s conjure-up makes it easy to deploy and operate Kubernetes in production, using a neat, easy-to-use CLI installer. Weave Cloud fills in the gaps missing with a Kubernetes install and provides the tools necessary for a full development lifecycle:
Weave Cloud Development Lifecycle
juju config kubernetes-master allow-privileged=true juju config kubernetes-worker allow-privileged=true juju ssh kubernetes-master/0 -- 'sudo snap set kube-apiserver authorization-mode=RBAC' sleep 120 juju ssh kubernetes-master/0 -- '/snap/bin/kubectl create clusterrolebinding root-cluster-admin-binding --clusterrole=cluster-admin --user=admin && /snap/bin/kubectl create clusterrolebinding kubelet-node-binding --clusterrole=system:node --user=kubelet'
find the path from e.g.
You may wish to make this permanent by adding the export command to your ~/.bash_profile or equivalent shell startup script. Once you have the environment variable in place, you can run kubectl commands against the cluster. Try it out with
kubectl get nodes
Weave Cloud Token and command location
For example, you would run:
kubectl apply -n kube-system -f \ "https://cloud.weave.works/k8s.yaml?t=[CLOUD-TOKEN]&k8s-version=$(kubectl version | base64 | tr -d '\n')"
The cluster should now appear in Weave Cloud. Check Explore → Hosts to see all five hosts:
kubectl create namespace sock-shop git clone https://github.com/microservices-demo/microservices-demo cd microservices-demo kubectl apply -n sock-shop -f deploy/kubernetes/manifests
Now you should be able to see the Sock Shop in Weave Cloud Explore (click Controllers and select the sock-shop namespace filter from the bottom left):
And you should be able to access the shop in your browser, using the IP address of one of your Kubernetes nodes at port :30001.
Once the app is loaded, try out the Monitoring tool in Weave Cloud to observe the latencies between services in the cluster. Click Monitor and then run the following query:
You should see all the different requests latencies for all the services in the sock shop. This is possible because the sock shop is instrumented with the Prometheus client libraries.
In this post, we showed you how to get from nothing to a Kubernetes cluster using Canonical’s conjure-up. We then showed you how to install the Weave Cloud agents and just scratched the surface of what you can do with Weave Cloud: monitoring the request latencies on a Prometheus-instrumented app, the sock shop.
Ubuntu offers all the training, software infrastructure, tools, services and support you need for your public and private clouds.
This article on Kubernetes & vSphere integration originally appeared at Kevin Monroe’s blog Background Recently, Juju began supporting cloud-native features via “integrator” charms (e.g.: aws-integrator, gcp-integrator,…
Cloud Native, Docker, K8s Summit Date: September 12 Location: 411 West Arapaho Road, Richardson, TX 75080 Update 4th September: By now you have probably heard that the Cloud-Native, Docker & K8s Summit has been cancelled. However,…
Guest blog by Julio Montes, Linux Software Engineer at Intel Kata Containers is now available as a Snap and to install from the Snap Store. Kata Containers is a lightweight, fast to boot, virtual machine (VM) designed to provide the speed…