For scheduling applications consisting of multiple containers you typically use an orchestrator. Kubernetes is an orchestrator and in this chapter you will set up a Kubernetes cluster in Azure Kubernetes Services (AKS) and an Azure Container Registry (ACR) to store your images.
- How to set up a Kubernetes Cluster with Azure Kubernetes Service
- How to access the cluster with the commandline command "kubectl"
- Get to know the basic command set of "kubectl"
- Understand the concept of pods and services and how they come together
- Get in touch with Yaml files to specify a desired state for a Kubernetes object
- Set up your Kuberenetes cluster using Azure Kuberenetes Service.
Need help? Check hints here 📘!
The deployment will take some time (~20 min).
Need help? Check hints here 📘!
- Run a public available application in a single container on your cluster. The image name is "nginx".
- Use the "kubectl run" command
- Add a service to make your application is accessible from the internet
- Use the "kubectl expose" command and "kubectl edit YOURSERVICE" command.
- Start your webbrowser to view your application running in your cluster.
- Open the K8s portal for a graphical interface. Run
kubectl proxy
then open up a browser an navigate to http://localhost:8001/ui or http://localhost:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/#!/pod?namespace=default - If you want to work with namespaces. Create your own namespace 'mynewnamespace' with
kubectl create ns mynewnamespace
and apply this postfix to your kubectl commands like
kubectl get pods -n mynewnamespace
- Familiarize yourself with the following commands on commandline, eg.
kubectl get pods // to display all pods
kubectl get svc // to display all services
kubectl get deployments // to display all deployments
kubectl delete pods/<podid> // to delete a specific pod
Need help? Check hints here 📘!
- Launch the nginx deployment via yaml file (see if you can download it somewhere?)
- Launch a custom image from your registry (learn about secrets)
- You can declare a namespace inside your yaml file