kubectl create deploy myweb --image=nginx
deployment.apps/myweb created
kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
myweb 1/1 1 1 8s
kubectl get deploy myweb
NAME READY UP-TO-DATE AVAILABLE AGE
myweb 1/1 1 1 21s
kubectl describe deploy myweb
Name: myweb
Namespace: default
CreationTimestamp: Mon, 27 Jun 2022 17:18:35 -0700
Labels: app=myweb
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=myweb
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavai lable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=myweb
Containers:
nginx:
Image: nginx
Port: <none>
Host Port: <none>
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: myweb-58d88b7dfb (1/1 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 43s deployment-controller Scaled up replica set myweb-58d88b7dfb to 1
#edit no of replicas to 2
kubectl edit deploy myweb
deployment.apps/myweb edited
kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
myweb 2/2 2 2 118s
kubectl get pods
NAME READY STATUS RESTARTS AGE
myweb-58d88b7dfb-6lj6k 1/1 Running 0 24s
myweb-58d88b7dfb-bxcj6 1/1 Running 0 2m4s
#replicas 3
kubectl edit deploy myweb
deployment.apps/myweb edited
kubectl get pods
NAME READY STATUS RESTARTS AGE
myweb-58d88b7dfb-6lj6k 1/1 Running 0 65s
myweb-58d88b7dfb-bxcj6 1/1 Running 0 2m45s
myweb-58d88b7dfb-wb7jj 1/1 Running 0 11s
kubectl describe deploy myweb
Name: myweb
Namespace: default
CreationTimestamp: Mon, 27 Jun 2022 17:18:35 -0700
Labels: app=myweb
Annotations: deployment.kubernetes.io/revision: 1
Selector: app=myweb
Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavai lable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=myweb
Containers:
nginx:
Image: nginx
Port: <none>
Host Port: <none>
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Progressing True NewReplicaSetAvailable
Available True MinimumReplicasAvailable
OldReplicaSets: <none>
NewReplicaSet: myweb-58d88b7dfb (3/3 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 3m15s deployment-controller Scaled up replica set myweb-58d88b7dfb to 1
Normal ScalingReplicaSet 95s deployment-controller Scaled up replica set myweb-58d88b7dfb to 2
Normal ScalingReplicaSet 41s deployment-controller Scaled up replica set myweb-58d88b7dfb to 3
kubectl get pods
NAME READY STATUS RESTARTS AGE
myweb-58d88b7dfb-6lj6k 1/1 Running 0 111s
myweb-58d88b7dfb-bxcj6 1/1 Running 0 3m31s
myweb-58d88b7dfb-wb7jj 1/1 Running 0 57s
#delete one pod, it maintains the no of pods
kubectl delete pod myweb-58d88b7dfb-6lj6k
pod "myweb-58d88b7dfb-6lj6k" deleted
kubectl get pods
NAME READY STATUS RESTARTS AGE
myweb-58d88b7dfb-bxcj6 1/1 Running 0 4m1s
myweb-58d88b7dfb-k5dwk 1/1 Running 0 5s
myweb-58d88b7dfb-wb7jj 1/1 Running 0 87s
No comments:
Post a Comment