1.1 Create deployment

1.1.1 By Definition File

kubectl create f deployment-definition.yml

1.1.2 By CLI

kubectl run hello-world --replicas=5 --labels="run=load-balancer-example" --image=gcr.io/google-samples/node-hello:1.0 --port=8080

The preceding command creates a Deployment object and an associated ReplicaSet object. The ReplicaSet has five Pods, each of which runs the Hello World application.

1.2 Update deployment

kubectl apply f deployment definition.yml

Or directly change by run:

kubectl set image deployment/ myapp deployment nginx =nginx:1.9.1

This way will not change the definition file.

1.3 Display deployment

kubectl get deployments hello-world

kubectl describe deployments hello-world

Tags:
Created by Bin Chen on 2020/09/04 04:05
    

Need help?

If you need help with XWiki you can contact:

京ICP备19054609号-1

京公网安备 11010502039855号