AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Kubernetes list all contexts12/10/2023 # 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 List ingress resources in ps output formatĮdit ingress resource from the default editorĭelete ingress resources matching passed argumentĮdit namespace resource from the default editorĭelete the namespace.# 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. Example: kgpl "app=myapp" -n mynsĪfter listing all services, watch for changesĪfter listing all services, output in plain-text format with any additional informationĮdit services(svc) from the default editorĭelete all services matching passed argument For pods, the node name is includedĭelete all pods matching passed arguments ![]() Output in plain-text format with any additional information. Set the current-context in a kubeconfig fileĭelete the specified context from the kubeconfigĭelete resources by filenames, stdin, resources and names, or by resources and label selectorĭelete a pod using the type and name specified in -f argumentĪfter listing/getting the requested object, watch for changes Manage configuration quickly to switch contexts between local, dev and staging The kubectl command targeting all namespacesĭrop into an interactive terminal on a container
0 Comments
Read More
Leave a Reply. |