Kubectl: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 21: Line 21:


<tt>kubectl get</tt> and <tt>kubectl describe</tt> mask sensitive information such as a [[Kubernetes Cluster Configuration Concepts#Secret|secret]]'s content to protect it from being exposed accidentally to an onlooker or from being stored in a terminal log.
<tt>kubectl get</tt> and <tt>kubectl describe</tt> mask sensitive information such as a [[Kubernetes Cluster Configuration Concepts#Secret|secret]]'s content to protect it from being exposed accidentally to an onlooker or from being stored in a terminal log.
=Commands=
* [[kubectl port-foward|port-forward]]
* [[kubectl expose|expose]]
* [[kubectl version|version]]
* [[kubectl config|config]]


=POSTing a Manifest=
=POSTing a Manifest=

Revision as of 17:27, 22 August 2019

Internal

Overview

kubectl is the main Kubernetes command line tool, used to send REST API requests with JSON-formatted payloads into the API server.

Configuration

.kube config

Options

Obtaining Information about API Objects

kubectl get
kubectl describe

kubectl get and kubectl describe mask sensitive information such as a secret's content to protect it from being exposed accidentally to an onlooker or from being stored in a terminal log.

POSTing a Manifest

kubectl apply -f filename.yaml

Get the Manifest for an Existing Object

The manifest can be used to recreate the object:

kubectl get pod pod-name --export -o yaml

Note that --export is deprecated and will be removed in the future so find an equivalent.