![]() Kubectl rollout history daemonset/abc -revision =3 # View the details of daemonset revision 3 # View the rollout history of a deployment # Check the rollout status of a daemonset Kubectl set sa -f nginx-deployment.yaml serviceaccount1 -local -dry-run -o yamlĬreates an autoscaler that automatically chooses and sets the number of pods that run in a kubernetes cluste # Print the result (in yaml format) of updated nginx deployment with serviceaccount from local file, without hitting apiserver Kubectl set serviceaccount deployment nginx-deployment serviceaccount1 # Set Deployment nginx-deployment's ServiceAccount to serviceaccount1 Kubectl set resources -f path/to/file.yaml -limits = cpu =200m,memory =512Mi -local -o yaml # Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server Kubectl set resources deployment nginx -limits = cpu =0,memory =0 -requests = cpu =0,memory =0 # Remove the resource requests for resources on containers in nginx Kubectl set resources deployment nginx -limits = cpu =200m,memory =512Mi -requests = cpu =100m,memory =256Mi # Set the resource request and limits for all containers in nginx Kubectl set resources deployment nginx -c =nginx -limits = cpu =200m,memory =512Mi # Set a deployments nginx container cpu limits to "200m" and memory to "512Mi" Kubectl set image -f path/to/file.yaml nginx =nginx:1.9.1 -local -o yaml ![]() # Print result (in yaml format) of updating nginx container image from local file, without hitting the server Kubectl set image daemonset abc * =nginx:1.9.1 Kubectl set image deployments,rc nginx =nginx:1.9.1 -all # Update image of all containers of daemonset abc to 'nginx:1.9.1' # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1' Kubectl set image deployment/nginx busybox =busybox nginx =nginx:1.9.1 # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'. ![]() # Set some of the local shell environment into a deployment config on the server env | grep RAILS_ | kubectl set env -e - deployment/registry # Remove the environment variable ENV from a deployment definition on disk and # update the deployment config on the server Kubectl set env deployments -all -containers = "c1" ENV. # Remove the environment variable ENV from container 'c1' in all deployment configs Kubectl set env -from =configmap/myconfigmap -prefix =MYSQL_ deployment/myapp # Import environment from a config map with a prefix Kubectl set env -from =secret/mysecret deployment/myapp # Update all containers in all replication controllers in the project to have ENV=prod Kubectl set env deployment/sample-build STORAGE_DIR =/data -o yaml Kubectl set env pods -all -list # Output modified deployment in YAML, and does not alter the object on the server Kubectl set env deployment/sample-build -list # List the environment variables defined on all pods # List the environment variables defined on a deployments 'sample-build' Kubectl set env deployment/registry STORAGE_DIR =/local # Update deployment 'registry' with a new environment variable Kubectl run pi -schedule = "0/5 * * * ?" -image =perl -restart =OnFailure - perl -Mbignum =bpi -wle 'print bpi(2000)' Set Kubectl run pi -image =perl -restart =OnFailure - perl -Mbignum =bpi -wle 'print bpi(2000)' # Start the cron job to compute π to 2000 places and print it out every 5 minutes. # Start the perl container to compute π to 2000 places and print it out. Kubectl run nginx -image =nginx -command. # Start the nginx container using a different command and custom arguments. # Start the nginx container using the default command, but use custom arguments (arg1. ![]() Kubectl run -i -t busybox -image =busybox -restart =Never # Load the kubectl completion code for zsh into the current shell source " $' # Start a pod of busybox and keep it in the foreground, don't restart it if it exits. # Installing bash completion on Linux # Load the kubectl completion code for bash into the current shell source ~/.kube/ Kubectl completion bash > $(brew -prefix )/etc/bash_completion.d/kubectl # If you've installed via other means, you may need add the completion to your completion directory # Installing bash completion on macOS using homebrew # If running Bash 3.2 included with macOSīrew install If kubectl is installed via homebrew, this should start working immediately.
0 Comments
Leave a Reply. |