Selector specifies which application is going to be associated with this replica. Replica specifies how many replicas are required to be created for this application/container since this is a demo, I have mentioned only 1. It specifies that this is a deployment that needs to be carried out on the Kubernetes cluster. When we update the deployment we can also update the version of deployment.
This section specifies the version of the deployment. Let’s go through some of the important sections of this deployment file. In this file I have given all the configurations related to deployment, basically, in this deployment, Kubernetes is going to pick the Nginx image from Docker Hub,Īzure Kubernetes can also pick up the image from ACR(Azure container Registry).
The first file called app.yml, apiVersion: apps/v1 These configuration files are used by the kubectl tool and based on the configuration of these files, the Kubernetes cluster will take all the contents of the file and do the deployment accordingly. You can go and execute these files for deployment.
#Deploy docker on kubernetes how to#
In my previous article, How To Create An Azure Kubernetes Cluster, I deployed a Kubernetes cluster and explained the basic concepts of Understanding Application Deployment On Kubernetes Cluster of deployment, now I am going to explain how we can deploy an Nginx Container on to the cluster.