Skip to content

Commit 8d91229

Browse files
authored
Merge pull request #31391 from neolit123/1.24-update-master-label-taint
kubeadm: update labels, taints, annotations for 1.24
2 parents aef1728 + b4a5659 commit 8d91229

File tree

10 files changed

+172
-88
lines changed

10 files changed

+172
-88
lines changed

content/en/docs/reference/kubectl/cheatsheet.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ detailed config file information.
4949
kubectl config view # Show Merged kubeconfig settings.
5050

5151
# use multiple kubeconfig files at the same time and view merged config
52-
KUBECONFIG=~/.kube/config:~/.kube/kubconfig2
52+
KUBECONFIG=~/.kube/config:~/.kube/kubconfig2
5353

5454
kubectl config view
5555

@@ -58,7 +58,7 @@ kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'
5858

5959
kubectl config view -o jsonpath='{.users[].name}' # display the first user
6060
kubectl config view -o jsonpath='{.users[*].name}' # get a list of users
61-
kubectl config get-contexts # display list of contexts
61+
kubectl config get-contexts # display list of contexts
6262
kubectl config current-context # display the current-context
6363
kubectl config use-context my-cluster-name # set the default context to my-cluster-name
6464

@@ -92,10 +92,10 @@ kubectl apply -f https://git.io/vPieo # create resource(s) from url
9292
kubectl create deployment nginx --image=nginx # start a single instance of nginx
9393

9494
# create a Job which prints "Hello World"
95-
kubectl create job hello --image=busybox -- echo "Hello World"
95+
kubectl create job hello --image=busybox -- echo "Hello World"
9696

9797
# create a CronJob that prints "Hello World" every minute
98-
kubectl create cronjob hello --image=busybox --schedule="*/1 * * * *" -- echo "Hello World"
98+
kubectl create cronjob hello --image=busybox --schedule="*/1 * * * *" -- echo "Hello World"
9999

100100
kubectl explain pods # get the documentation for pod manifests
101101

@@ -173,8 +173,8 @@ kubectl get configmap myconfig \
173173
-o jsonpath='{.data.ca\.crt}'
174174

175175
# Get all worker nodes (use a selector to exclude results that have a label
176-
# named 'node-role.kubernetes.io/master')
177-
kubectl get node --selector='!node-role.kubernetes.io/master'
176+
# named 'node-role.kubernetes.io/control-plane')
177+
kubectl get node --selector='!node-role.kubernetes.io/control-plane'
178178

179179
# Get all running pods in the namespace
180180
kubectl get pods --field-selector=status.phase=Running
@@ -226,7 +226,7 @@ for pod in $(kubectl get po --output=jsonpath={.items..metadata.name}); do echo
226226

227227
```bash
228228
kubectl set image deployment/frontend www=image:v2 # Rolling update "www" containers of "frontend" deployment, updating the image
229-
kubectl rollout history deployment/frontend # Check the history of deployments including the revision
229+
kubectl rollout history deployment/frontend # Check the history of deployments including the revision
230230
kubectl rollout undo deployment/frontend # Rollback to the previous deployment
231231
kubectl rollout undo deployment/frontend --to-revision=2 # Rollback to a specific revision
232232
kubectl rollout status -w deployment/frontend # Watch rolling update status of "frontend" deployment until completion
@@ -318,7 +318,7 @@ kubectl run nginx --image=nginx # Run pod nginx and write it
318318
kubectl attach my-pod -i # Attach to Running Container
319319
kubectl port-forward my-pod 5000:6000 # Listen on port 5000 on the local machine and forward to port 6000 on my-pod
320320
kubectl exec my-pod -- ls / # Run command in existing pod (1 container case)
321-
kubectl exec --stdin --tty my-pod -- /bin/sh # Interactive shell access to a running pod (1 container case)
321+
kubectl exec --stdin --tty my-pod -- /bin/sh # Interactive shell access to a running pod (1 container case)
322322
kubectl exec my-pod -c my-container -- ls / # Run command in existing pod (multi-container case)
323323
kubectl top pod POD_NAME --containers # Show metrics for a given pod and its containers
324324
kubectl top pod POD_NAME --sort-by=cpu # Show metrics for a given pod and sort it by 'cpu' or 'memory'

0 commit comments

Comments
 (0)