![]() Slash Notation (“object_type/object_name”): This notation is accepted for almost all kubectl commands.Note that for most commands, kubectl accepts two different notations to address objects: A true declarative mode would still use the apply command and delete resources that are not declared anymore in the manifest file. Please note that although we use a manifest file, this is still imperative mode because we are using the delete command. ![]() To delete objects, you will still need to use the imperative mode, for example, using kubectl delete -f MANIFEST.YAML. This option is currently in alpha, so it is not recommended, especially if working in a production environment. It can’t delete such objects yet, except via the -prune option. Please note that the declarative mode is incomplete at the time of writing because it can only create or update Kubernetes objects. Generally speaking, you should strive to use the declarative mode because Kubernetes will usually make the right decisions to achieve your desired end state. The typical command for this mode is kubectl create -f MANIFEST.YAML. It takes a manifest file as input but instructs Kubernetes directly to perform specific actions on certain objects. Imperative Object Configuration Modeįinally, the imperative object configuration mode mixes the previous two. A typical example of such a command is kubectl apply -f MANIFEST.YAML. This mode takes manifest files as input that describe the desired end state. ![]() The declarative mode tells Kubernetes the desired end state and lets Kubernetes do whatever work is required to achieve that state. Examples of such commands are kubectl create service or kubectl delete pvc. Imperative ModeĬommands issued in imperative mode directly instruct Kubernetes on what to do with specific objects. Shows the versions of kubectl and your Kubernetes clusterĬreates or updates the resources specified in the manifest fileĭeletes the resources specified in the manifest fileĪccesses a pod’s port on your local machineīefore getting into the specifics of commands, it is important to understand the various modes in which kubectl can work. Shows the manifest and status of deployment DEP Selects a context to use for subsequent kubectl commands
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |