K8s deployment is just another k8s api object, But this object contains replica sets. Replica sets will contain Pods.
K8s Deployment gives us options to
Perform Rolling update (Zero-down time deployment)
Perform Recreation (This will have downtime)
Deployments with Rolling updates is the default option
Rolling update deployments help us
in Rolling out a new deployment
Undo deployment and go back to previous stable version
To create this deployment we need to write a spec. As of now i’m using the deployment for k8s 1.16 on AKS Reference and for sample deployment yaml refer microsoft documentationRefer Here
Lets create a k8s deployment spec for sample app (jenkins:1.642.4)
What will you do if you have sensitive information like passwords etc. Then we can use Secrets Refer Here
Secrets also will be loaded as environmental variables or files.
Secrets can be encrypted with Keys and Certificates
k8s namesapces
K8s is a cluster where we run Pods. All the Pods, Services, Deployments in k8s will be in a logical cluster called namespace. Persistent Volumes & Nodes will not be part of namespaces.
Kuberenetes will have a default namespace called as default. Till now we have been creating our api objects in k8s default namesapce.
In the same physical k8s cluster , if you want multiple logical clusters then you can create namespaces. Refer Here for official docs
Labels and annotations
Labels in k8s are used to match different api objects like Pods, services etc.
Labels are key value pairs where we represent information
Annotations provide a place for storing additional metadata for k8s objects with sole purpose of assisting tools and libraries
Annotations are also key value pairs which can be specified in the metadata section (much like lables)