Skip to content

Commit cc888c6

Browse files
authored
Merge pull request #29881 from mallow111/issue-29850
Fix issue #29850 - Drop v1.apps in Deployment
2 parents 56d10a5 + 7ebe37a commit cc888c6

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

content/en/docs/concepts/workloads/controllers/deployment.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ Follow the steps given below to update your Deployment:
164164
1. Let's update the nginx Pods to use the `nginx:1.16.1` image instead of the `nginx:1.14.2` image.
165165

166166
```shell
167-
kubectl deployment.apps/nginx-deployment set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
167+
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
168168
```
169169

170170
or use the following command:
@@ -182,7 +182,7 @@ Follow the steps given below to update your Deployment:
182182
Alternatively, you can `edit` the Deployment and change `.spec.template.spec.containers[0].image` from `nginx:1.14.2` to `nginx:1.16.1`:
183183

184184
```shell
185-
kubectl edit deployment.v1.apps/nginx-deployment
185+
kubectl edit deployment/nginx-deployment
186186
```
187187

188188
The output is similar to:
@@ -365,7 +365,7 @@ rolled back.
365365
* Suppose that you made a typo while updating the Deployment, by putting the image name as `nginx:1.161` instead of `nginx:1.16.1`:
366366

367367
```shell
368-
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.161
368+
kubectl set image deployment/nginx-deployment nginx=nginx:1.161
369369
```
370370

371371
The output is similar to this:
@@ -474,33 +474,33 @@ Follow the steps given below to check the rollout history:
474474

475475
1. First, check the revisions of this Deployment:
476476
```shell
477-
kubectl rollout history deployment.v1.apps/nginx-deployment
477+
kubectl rollout history deployment/nginx-deployment
478478
```
479479
The output is similar to this:
480480
```
481481
deployments "nginx-deployment"
482482
REVISION CHANGE-CAUSE
483483
1 kubectl apply --filename=https://k8s.io/examples/controllers/nginx-deployment.yaml
484-
2 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
485-
3 kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.161
484+
2 kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1
485+
3 kubectl set image deployment/nginx-deployment nginx=nginx:1.161
486486
```
487487

488488
`CHANGE-CAUSE` is copied from the Deployment annotation `kubernetes.io/change-cause` to its revisions upon creation. You can specify the`CHANGE-CAUSE` message by:
489489

490-
* Annotating the Deployment with `kubectl annotate deployment.v1.apps/nginx-deployment kubernetes.io/change-cause="image updated to 1.16.1"`
490+
* Annotating the Deployment with `kubectl annotate deployment/nginx-deployment kubernetes.io/change-cause="image updated to 1.16.1"`
491491
* Manually editing the manifest of the resource.
492492

493493
2. To see the details of each revision, run:
494494
```shell
495-
kubectl rollout history deployment.v1.apps/nginx-deployment --revision=2
495+
kubectl rollout history deployment/nginx-deployment --revision=2
496496
```
497497

498498
The output is similar to this:
499499
```
500500
deployments "nginx-deployment" revision 2
501501
Labels: app=nginx
502502
pod-template-hash=1159050644
503-
Annotations: kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
503+
Annotations: kubernetes.io/change-cause=kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1
504504
Containers:
505505
nginx:
506506
Image: nginx:1.16.1
@@ -517,7 +517,7 @@ Follow the steps given below to rollback the Deployment from the current version
517517

518518
1. Now you've decided to undo the current rollout and rollback to the previous revision:
519519
```shell
520-
kubectl rollout undo deployment.v1.apps/nginx-deployment
520+
kubectl rollout undo deployment/nginx-deployment
521521
```
522522
523523
The output is similar to this:
@@ -527,7 +527,7 @@ Follow the steps given below to rollback the Deployment from the current version
527527
Alternatively, you can rollback to a specific revision by specifying it with `--to-revision`:
528528
529529
```shell
530-
kubectl rollout undo deployment.v1.apps/nginx-deployment --to-revision=2
530+
kubectl rollout undo deployment/nginx-deployment --to-revision=2
531531
```
532532
533533
The output is similar to this:
@@ -561,7 +561,7 @@ Follow the steps given below to rollback the Deployment from the current version
561561
CreationTimestamp: Sun, 02 Sep 2018 18:17:55 -0500
562562
Labels: app=nginx
563563
Annotations: deployment.kubernetes.io/revision=4
564-
kubernetes.io/change-cause=kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
564+
kubernetes.io/change-cause=kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1
565565
Selector: app=nginx
566566
Replicas: 3 desired | 3 updated | 3 total | 3 available | 0 unavailable
567567
StrategyType: RollingUpdate
@@ -604,7 +604,7 @@ Follow the steps given below to rollback the Deployment from the current version
604604
You can scale a Deployment by using the following command:
605605
606606
```shell
607-
kubectl scale deployment.v1.apps/nginx-deployment --replicas=10
607+
kubectl scale deployment/nginx-deployment --replicas=10
608608
```
609609
The output is similar to this:
610610
```
@@ -616,7 +616,7 @@ in your cluster, you can setup an autoscaler for your Deployment and choose the
616616
Pods you want to run based on the CPU utilization of your existing Pods.
617617
618618
```shell
619-
kubectl autoscale deployment.v1.apps/nginx-deployment --min=10 --max=15 --cpu-percent=80
619+
kubectl autoscale deployment/nginx-deployment --min=10 --max=15 --cpu-percent=80
620620
```
621621
The output is similar to this:
622622
```
@@ -645,7 +645,7 @@ For example, you are running a Deployment with 10 replicas, [maxSurge](#max-surg
645645
646646
* You update to a new image which happens to be unresolvable from inside the cluster.
647647
```shell
648-
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:sometag
648+
kubectl set image deployment/nginx-deployment nginx=nginx:sometag
649649
```
650650
651651
The output is similar to this:
@@ -724,7 +724,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
724724
725725
* Pause by running the following command:
726726
```shell
727-
kubectl rollout pause deployment.v1.apps/nginx-deployment
727+
kubectl rollout pause deployment/nginx-deployment
728728
```
729729
730730
The output is similar to this:
@@ -734,7 +734,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
734734
735735
* Then update the image of the Deployment:
736736
```shell
737-
kubectl set image deployment.v1.apps/nginx-deployment nginx=nginx:1.16.1
737+
kubectl set image deployment/nginx-deployment nginx=nginx:1.16.1
738738
```
739739
740740
The output is similar to this:
@@ -744,7 +744,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
744744
745745
* Notice that no new rollout started:
746746
```shell
747-
kubectl rollout history deployment.v1.apps/nginx-deployment
747+
kubectl rollout history deployment/nginx-deployment
748748
```
749749
750750
The output is similar to this:
@@ -766,7 +766,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
766766
767767
* You can make as many updates as you wish, for example, update the resources that will be used:
768768
```shell
769-
kubectl set resources deployment.v1.apps/nginx-deployment -c=nginx --limits=cpu=200m,memory=512Mi
769+
kubectl set resources deployment/nginx-deployment -c=nginx --limits=cpu=200m,memory=512Mi
770770
```
771771
772772
The output is similar to this:
@@ -779,7 +779,7 @@ apply multiple fixes in between pausing and resuming without triggering unnecess
779779
780780
* Eventually, resume the Deployment and observe a new ReplicaSet coming up with all the new updates:
781781
```shell
782-
kubectl rollout resume deployment.v1.apps/nginx-deployment
782+
kubectl rollout resume deployment/nginx-deployment
783783
```
784784
785785
The output is similar to this:
@@ -889,7 +889,7 @@ The following `kubectl` command sets the spec with `progressDeadlineSeconds` to
889889
lack of progress for a Deployment after 10 minutes:
890890

891891
```shell
892-
kubectl patch deployment.v1.apps/nginx-deployment -p '{"spec":{"progressDeadlineSeconds":600}}'
892+
kubectl patch deployment/nginx-deployment -p '{"spec":{"progressDeadlineSeconds":600}}'
893893
```
894894
The output is similar to this:
895895
```

0 commit comments

Comments
 (0)