![]() Kubernetes stores secrets as base64-encoded values, hence the | base64 -d at the end to show a human-readable value. To get the name of the containers of a running pod: $ kubectl get pod MYPOD -o 'jsonpath=' | base64 -d To switch context: $ kubectl config use-context minikube To get the current contexts configured in your kubeconfig file: $ kubectl config get-contexts No explanations are given, but the commands are explained further down in the article. This is the TL DR section of this article-a quick-access section to remind you of the most important commands. This is part of an extensive series of guides about DevOps. ![]() Some commands accept different notations (e.g., “kubectl get pod mypod”), so you might see different notations used throughout this article.įor more information, including a complete list of kubectl operations, see the kubectl reference documentation. For example, to address the “mypod” pod, the notation will be “pods/mypod”. The object notation is usually in the form of object type, followed by a slash, followed by the object name. The command for this is kubectl apply -f manifest.yaml. The “Declarative Object Configuration” technique again takes manifest files as input but uses an “upsert” logic and creates objects if they don’t exist, or it updates existing objects that are different from the specifications in the input manifest files.The “Imperative Object Configuration” technique is identical to the first one, except that it works on manifest files rather than objects directly, for example kubectl create -f manifest.yaml.The “Imperative commands” technique directly tells Kubernetes what operation to perform on which objects, for example: kubectl create pod or kubectl delete service.You can use kubectl to create, inspect, update, and delete Kubernetes objects, deploy applications, inspect and manage cluster resources, and view logs. Kubectl works by communicating with the Kubernetes API server: It authenticates with the Master Node of your cluster and makes API calls to perform management actions. Kubectl is a command line tool for Kubernetes that allows you to communicate and control Kubernetes clusters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |