Nginx-depl-68fc9c8dfb-nvsbw 1/1 Running 0 10s 172.17.0.2 minikubeĬool Tip: List & Change Namespaces in Kubernetes! Read more → Create ServiceĬreate a Service to expose the Deployment outside the cluster: $ kubectl create service nodeport nginx-depl -tcp=80:80 create one more replica Pod: $ kubectl scale -replicas=2 deployment/nginx-depl Nginx-depl 1/1 1 1 4m50s nginx nginx:1.21 app=nginx-depl Scale Deployment update the Nginx image version to 1.21, execute: $ kubectl set image deployment/nginx-depl nginx=nginx:1.21 Nginx-depl-5fd5bfb4cf-m9s4z 1/1 Running 0 31s 172.17.0.2 minikube Update Deployment Nginx-depl 1/1 1 1 16s nginx nginx:1.19 app=nginx-depl NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR To ensure the Deployment is created and the Pod is running, execute: $ kubectl get deployment -o wide I will also show how to create a Service to expose the created Deployment outside the Kubernetes cluster.Ĭool Tip: Get Pod’s logs using the kubectl command! Read more → Create Deploymentĭeploy the nginx:1.19 Docker image on a Kubernetes cluster, by creating a Deployment using the kubectl command: $ kubectl create deployment nginx-depl -image=nginx:1.19 In this note i will show how to create a Deployment from the command line using the kubectl command.īelow you will find the examples of how to deploy an Nginx Docker image on a Kubernetes cluster and how to update and scale it using the kubectl command only (without YAML configs).
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |