• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..26-Mar-2020-

examples/nginx/H26-Mar-2020-3533

pages/H26-Mar-2020-7,8796,135

.gitignoreH A D26-Mar-202013 21

CONTRIBUTING.mdH A D26-Mar-20202 KiB7450

DockerfileH A D26-Mar-2020857 2822

README.mdH A D26-Mar-20203.4 KiB8258

SUMMARY.mdH A D26-Mar-20203.2 KiB7754

book.jsonH A D26-Mar-202045.7 KiB3231

firebase.jsonH A D26-Mar-2020235 1716

npm-shrinkwrap.jsonH A D26-Mar-2020196.4 KiB6,0806,079

package.jsonH A D26-Mar-2020965 3231

README.md

1{% panel style="success", title="Feedback and Contributing" %}
2**Provide feedback on new kubectl docs at the [survey](https://www.surveymonkey.com/r/JH35X82)**
3
4See [CONTRIBUTING](https://github.com/kubernetes/kubectl/blob/master/docs/book/CONTRIBUTING.md) for
5instructions on filing/fixing issues and adding new content.
6{% endpanel %}
7
8{% panel style="info", title="TL;DR" %}
9- Kubectl is the Kubernetes cli
10- Kubectl provides a swiss army knife of functionality for working with Kubernetes clusters
11- Kubectl may be used to deploy and manage applications on Kubernetes
12- Kubectl may be used for scripting and building higher-level frameworks
13{% endpanel %}
14
15# Kubectl
16
17Kubectl is the Kubernetes cli version of a swiss army knife, and can do many things.
18
19While this Book is focused on using Kubectl to declaratively manage Applications in Kubernetes, it
20also covers other Kubectl functions.
21
22## Command Families
23
24Most Kubectl commands typically fall into one of a few categories:
25
26| Type                                   | Used For                   | Description                                        |
27|----------------------------------------|----------------------------|----------------------------------------------------|
28| Declarative Resource Management        | Deployment and Operations (e.g. GitOps)   | Declaratively manage Kubernetes Workloads using Resource Config     |
29| Imperative Resource Management         | Development Only           | Run commands to manage Kubernetes Workloads using Command Line arguments and flags |
30| Printing Workload State | Debugging  | Print information about Workloads |
31| Interacting with Containers | Debugging  | Exec, Attach, Cp, Logs |
32| Cluster Management | Cluster Ops | Drain and Cordon Nodes |
33
34## Declarative Application Management
35
36The preferred approach for managing Resources is through
37declarative files called Resource Config used with the Kubectl *Apply* command.
38This command reads a local (or remote) file structure and modifies cluster state to
39reflect the declared intent.
40
41{% panel style="info", title="Apply" %}
42Apply is the preferred mechanism for managing Resources in a Kubernetes cluster.
43{% endpanel %}
44
45## Printing state about Workloads
46
47Users will need to view Workload state.
48
49- Printing summarize state and information about Resources
50- Printing complete state and information about Resources
51- Printing specific fields from Resources
52- Query Resources matching labels
53
54## Debugging Workloads
55
56Kubectl supports debugging by providing commands for:
57
58- Printing Container logs
59- Printing cluster events
60- Exec or attaching to a Container
61- Copying files from Containers in the cluster to a user's filesystem
62
63## Cluster Management
64
65On occasion, users may need to perform operations to the Nodes of cluster.  Kubectl supports
66commands to drain Workloads from a Node so that it can be decommission or debugged.
67
68## Porcelain
69
70Users may find using Resource Config overly verbose for *Development* and prefer to work with
71the cluster *imperatively* with a shell-like workflow.  Kubectl offers porcelain commands for
72generating and modifying Resources.
73
74- Generating + creating Resources such as Deployments, StatefulSets, Services, ConfigMaps, etc
75- Setting fields on Resources
76- Editing (live) Resources in a text editor
77
78{% panel style="danger", title="Porcelain For Dev Only" %}
79Porcelain commands are time saving for experimenting with workloads in a dev cluster, but shouldn't
80be used for production.
81{% endpanel %}
82