content
large_stringlengths
3
20.5k
url
large_stringlengths
54
193
branch
large_stringclasses
4 values
source
large_stringclasses
42 values
embeddings
listlengths
384
384
score
float64
-0.21
0.65
API-initiated eviction is the process by which you use the [Eviction API](/docs/reference/generated/kubernetes-api/{{}}/#create-eviction-pod-v1-core) to create an `Eviction` object that triggers graceful pod termination. You can request eviction either by directly calling the Eviction API using a client of the kube-apiserver, like the `kubectl drain` command. When an `Eviction` object is created, the API server terminates the Pod. API-initiated evictions respect your configured [`PodDisruptionBudgets`](/docs/tasks/run-application/configure-pdb/) and [`terminationGracePeriodSeconds`](/docs/concepts/workloads/pods/pod-lifecycle#pod-termination). API-initiated eviction is not the same as [node-pressure eviction](/docs/concepts/scheduling-eviction/node-pressure-eviction/). \* See [API-initiated eviction](/docs/concepts/scheduling-eviction/api-eviction/) for more information.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/api-eviction.md
main
kubernetes
[ 0.019355533644557, 0.0721481591463089, 0.07402735948562622, -0.0003485324268694967, -0.00028622429817914963, -0.04955796152353287, -0.07289055734872818, -0.02696479856967926, 0.11010093241930008, 0.041265103965997696, 0.002383910119533539, -0.005825744476169348, -0.021836109459400177, -0.0...
0.118705
A method for exposing a network application that is running as one or more {{< glossary\_tooltip text="Pods" term\_id="pod" >}} in your cluster. The set of Pods targeted by a Service is (usually) determined by a {{< glossary\_tooltip text="selector" term\_id="selector" >}}. If more Pods are added or removed, the set of Pods matching the selector will change. The Service makes sure that network traffic can be directed to the current set of Pods for the workload. Kubernetes Services either use IP networking (IPv4, IPv6, or both), or reference an external name in the Domain Name System (DNS). The Service abstraction enables other mechanisms, such as Ingress and Gateway.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/service.md
main
kubernetes
[ -0.02150808461010456, -0.054413292557001114, 0.046680908650159836, -0.02269109897315502, -0.054478198289871216, 0.00007603430276503786, 0.022688910365104675, -0.03031395748257637, 0.11272703856229782, 0.01352451927959919, -0.020321208983659744, -0.032473448663949966, -0.010025149211287498, ...
0.27972
Defines how each object, like Pods or Services, should be configured and its desired state. Almost every Kubernetes object includes two nested object fields that govern the object's configuration: the object spec and the object status. For objects that have a spec, you have to set this when you create the object, providing a description of the characteristics you want the {{< glossary\_tooltip text="resource" term\_id="api-resource" >}} to have: its desired state. It varies for different objects like Pods, StatefulSets, and Services, detailing settings such as containers, volumes, replicas, ports, and other specifications unique to each object type. This field encapsulates what state Kubernetes should maintain for the defined object.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/spec.md
main
kubernetes
[ -0.029448457062244415, 0.027474625036120415, 0.03440020605921745, 0.020234256982803345, -0.06901615113019943, -0.013120928779244423, 0.03619766607880592, -0.03832634165883064, 0.05600965768098831, 0.03232806175947189, -0.0684937834739685, -0.09584499150514603, -0.025510262697935104, -0.021...
0.170114
Manages authorization decisions, allowing admins to dynamically configure access policies through the {{< glossary\_tooltip text="Kubernetes API" term\_id="kubernetes-api" >}}. RBAC utilizes four kinds of Kubernetes objects: Role : Defines permission rules in a specific namespace. ClusterRole : Defines permission rules cluster-wide. RoleBinding : Grants the permissions defined in a role to a set of users in a specific namespace. ClusterRoleBinding : Grants the permissions defined in a role to a set of users cluster-wide. For more information, see [RBAC](/docs/reference/access-authn-authz/rbac/).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/rbac.md
main
kubernetes
[ -0.035237327218055725, -0.013597388751804829, -0.06195218116044998, 0.02238268032670021, -0.06315729767084122, 0.015721799805760384, 0.08726784586906433, -0.05440370738506317, 0.018373265862464905, 0.018433814868330956, -0.03691494092345238, 0.006834858097136021, 0.011572543531656265, 0.01...
0.180115
In Kubernetes, \_affinity\_ is a set of rules that give hints to the scheduler about where to place pods. There are two kinds of affinity: \* [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity) \* [pod-to-pod affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity) The rules are defined using the Kubernetes {{< glossary\_tooltip term\_id="label" text="labels">}}, and {{< glossary\_tooltip term\_id="selector" text="selectors">}} specified in {{< glossary\_tooltip term\_id="pod" text="pods" >}}, and they can be either required or preferred, depending on how strictly you want the scheduler to enforce them.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/affinity.md
main
kubernetes
[ -0.06792307645082474, 0.0259389691054821, 0.06439545005559921, 0.03774932026863098, -0.007900312542915344, -0.010602964088320732, 0.09389388561248779, -0.07096967101097107, 0.07583615928888321, -0.00808700267225504, -0.007628399878740311, -0.0630778893828392, -0.02065856382250786, -0.01422...
0.148047
A copy or duplicate of a {{< glossary\_tooltip text="Pod" term\_id="pod" >}} or a set of pods. Replicas ensure high availability, scalability, and fault tolerance by maintaining multiple identical instances of a pod. Replicas are commonly used in Kubernetes to achieve the desired application state and reliability. They enable workload scaling and distribution across multiple nodes in a cluster. By defining the number of replicas in a Deployment or ReplicaSet, Kubernetes ensures that the specified number of instances are running, automatically adjusting the count as needed. Replica management allows for efficient load balancing, rolling updates, and self-healing capabilities in a Kubernetes cluster.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/replica.md
main
kubernetes
[ -0.04286910220980644, -0.008101646788418293, 0.022169174626469612, 0.010664124973118305, -0.022948140278458595, -0.014215972274541855, 0.019239600747823715, -0.016928639262914658, 0.09604011476039886, 0.04728096351027489, -0.007342477794736624, 0.013398174196481705, 0.0454525463283062, -0....
0.330252
A Kubernetes {{< glossary\_tooltip text="control plane" term\_id="control-plane" >}} component that embeds cloud-specific control logic. The cloud controller manager lets you link your cluster into your cloud provider's API, and separates out the components that interact with that cloud platform from components that only interact with your cluster. By decoupling the interoperability logic between Kubernetes and the underlying cloud infrastructure, the cloud-controller-manager component enables cloud providers to release features at a different pace compared to the main Kubernetes project.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/cloud-controller-manager.md
main
kubernetes
[ 0.011381206102669239, -0.04633501544594765, 0.030730580911040306, 0.05164983496069908, 0.05384514480829239, 0.07830024510622025, 0.010803980752825737, -0.06019357964396477, 0.12374311685562134, 0.10742129385471344, 0.024737730622291565, 0.014936846680939198, -0.022344272583723068, -0.07986...
0.178451
Means of representing specific Kubernetes APIs uniquely. Group Version Resources (GVRs) specify the API group, API version, and \_resource\_ (name for the object kind as it appears in the URI) associated with accessing a particular id of object in Kubernetes. GVRs let you define and distinguish different Kubernetes objects, and to specify a way of accessing objects that is stable even as APIs change. In this usage, \_resource\_ refers to an HTTP resource. Because some APIs are namespaced, a GVR may not refer to a specific {{< glossary\_tooltip text="API resource" term\_id="api-resource" >}}.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/group-version-resource.md
main
kubernetes
[ -0.07737048715353012, 0.0024383149575442076, 0.0422447994351387, -0.011813118122518063, 0.012463978491723537, -0.013650395907461643, 0.0702563226222992, -0.09170442819595337, 0.1407676339149475, -0.028439663350582123, -0.007897531613707542, -0.045068468898534775, -0.02573287859559059, -0.0...
0.12519
In computing, a proxy is a server that acts as an intermediary for a remote service. A client interacts with the proxy; the proxy copies the client's data to the actual server; the actual server replies to the proxy; the proxy sends the actual server's reply to the client. [kube-proxy](/docs/reference/command-line-tools-reference/kube-proxy/) is a network proxy that runs on each node in your cluster, implementing part of the Kubernetes {{< glossary\_tooltip term\_id="service">}} concept. You can run kube-proxy as a plain userland proxy service. If your operating system supports it, you can instead run kube-proxy in a hybrid mode that achieves the same overall effect using less system resources.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/proxy.md
main
kubernetes
[ -0.008725810796022415, -0.011904550716280937, 0.019604377448558807, -0.017137929797172546, -0.09716732800006866, -0.01845397800207138, 0.01501467451453209, -0.033461883664131165, 0.07153958082199097, 0.03763505443930626, -0.09821692109107971, -0.013753997161984444, 0.02377282828092575, -0....
0.218502
Application containers (or app containers) are the {{< glossary\_tooltip text="containers" term\_id="container" >}} in a {{< glossary\_tooltip text="pod" term\_id="pod" >}} that are started after any {{< glossary\_tooltip text="init containers" term\_id="init-container" >}} have completed. An init container lets you separate initialization details that are important for the overall {{< glossary\_tooltip text="workload" term\_id="workload" >}}, and that don't need to keep running once the application container has started. If a pod doesn't have any init containers configured, all the containers in that pod are app containers.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/app-container.md
main
kubernetes
[ -0.04357023164629936, 0.038366224616765976, 0.07477979362010956, 0.0012866138713434339, 0.01212256494909525, -0.05742686986923218, 0.07796340435743332, -0.011897201649844646, 0.029765302315354347, -0.004531278274953365, 0.00863735843449831, -0.004991786554455757, -0.030340371653437614, -0....
0.051682
A string value representing an amount of time. The format of a (Kubernetes) duration is based on the [`time.Duration`](https://pkg.go.dev/time#Duration) type from the Go programming language. In Kubernetes APIs that use durations, the value is expressed as series of a non-negative integers combined with a time unit suffix. You can have more than one time quantity and the duration is the sum of those time quantities. The valid time units are "ns", "µs" (or "us"), "ms", "s", "m", and "h". For example: `5s` represents a duration of five seconds, and `1m30s` represents a duration of one minute and thirty seconds.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/duration.md
main
kubernetes
[ 0.03157167136669159, 0.07745558768510818, -0.003746011760085821, -0.03510233387351036, -0.06854988634586334, 0.03520989790558815, 0.009000242687761784, 0.03819277882575989, 0.15700501203536987, -0.043429769575595856, 0.02358531765639782, -0.08699358999729156, -0.03509267419576645, 0.020299...
0.18651
The Container Storage Interface (CSI) defines a standard interface to expose storage systems to containers. CSI allows vendors to create custom storage plugins for Kubernetes without adding them to the Kubernetes repository (out-of-tree plugins). To use a CSI driver from a storage provider, you must first [deploy it to your cluster](https://kubernetes-csi.github.io/docs/deploying.html). You will then be able to create a {{< glossary\_tooltip text="Storage Class" term\_id="storage-class" >}} that uses that CSI driver. \* [CSI in the Kubernetes documentation](/docs/concepts/storage/volumes/#csi) \* [List of available CSI drivers](https://kubernetes-csi.github.io/docs/drivers.html)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/csi.md
main
kubernetes
[ -0.002293278928846121, 0.01741507090628147, -0.020230932161211967, 0.02643618918955326, -0.027332013472914696, -0.004008766729384661, 0.04119354486465454, -0.012478597462177277, 0.040319859981536865, 0.0422399528324604, 0.01898999698460102, -0.05160567909479141, 0.03995567187666893, 0.0210...
0.190704
{{< glossary\_tooltip text="Community members" term\_id="member" >}} who collectively manage an ongoing piece or aspect of the larger Kubernetes open source project. Members within a SIG have a shared interest in advancing a specific area, such as architecture, API machinery, or documentation. SIGs must follow the SIG [governance guidelines](https://github.com/kubernetes/community/blob/master/committee-steering/governance/sig-governance.md), but can have their own contribution policy and channels of communication. For more information, see the [kubernetes/community](https://github.com/kubernetes/community) repo and the current list of [SIGs and Working Groups](https://github.com/kubernetes/community/blob/master/sig-list.md).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/sig.md
main
kubernetes
[ 0.03434662148356438, -0.031874705106019974, 0.06093154475092888, 0.008503677323460579, 0.014941152185201645, -0.026493621990084648, 0.053875986486673355, -0.016659429296851158, 0.08525974303483963, -0.022005870938301086, -0.028959058225154877, -0.0525614395737648, -0.041229672729969025, -0...
0.217055
An API object that represents a piece of storage in the cluster. Representation of as a general, pluggable storage {{< glossary\_tooltip text="resource" term\_id="infrastructure-resource" >}} that can persist beyond the lifecycle of any individual {{< glossary\_tooltip text="Pod" term\_id="pod" >}}. PersistentVolumes (PVs) provide an API that abstracts details of how storage is provided from how it is consumed. PVs are used directly in scenarios where storage can be created ahead of time (static provisioning). For scenarios that require on-demand storage (dynamic provisioning), PersistentVolumeClaims (PVCs) are used instead.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/glossary/persistent-volume.md
main
kubernetes
[ -0.09093903750181198, -0.01671377755701542, -0.04807672277092934, 0.06986481696367264, -0.017987214028835297, -0.030335411429405212, 0.018190763890743256, -0.015986349433660507, 0.09959788620471954, 0.02690369077026844, 0.022574247792363167, 0.0075251152738928795, 0.010144034400582314, 0.0...
0.185338
API Priority and Fairness controls the behavior of the Kubernetes API server in an overload situation. You can find more information about it in the [API Priority and Fairness](/docs/concepts/cluster-administration/flow-control/) documentation. ## Diagnostics Every HTTP response from an API server with the priority and fairness feature enabled has two extra headers: `X-Kubernetes-PF-FlowSchema-UID` and `X-Kubernetes-PF-PriorityLevel-UID`, noting the flow schema that matched the request and the priority level to which it was assigned, respectively. The API objects' names are not included in these headers (to avoid revealing details in case the requesting user does not have permission to view them). When debugging, you can use a command such as: ```shell kubectl get flowschemas -o custom-columns="uid:{metadata.uid},name:{metadata.name}" kubectl get prioritylevelconfigurations -o custom-columns="uid:{metadata.uid},name:{metadata.name}" ``` to get a mapping of UIDs to names for both FlowSchemas and PriorityLevelConfigurations. ## Debug endpoints With the `APIPriorityAndFairness` feature enabled, the `kube-apiserver` serves the following additional paths at its HTTP(S) ports. You need to ensure you have permissions to access these endpoints. You don't have to do anything if you are using admin. Permissions can be granted if needed following the [RBAC](/docs/reference/access-authn-authz/rbac/) doc to access `/debug/api\_priority\_and\_fairness/` by specifying `nonResourceURLs`. - `/debug/api\_priority\_and\_fairness/dump\_priority\_levels` - a listing of all the priority levels and the current state of each. You can fetch like this: ```shell kubectl get --raw /debug/api\_priority\_and\_fairness/dump\_priority\_levels ``` The output will be in CSV and similar to this: ```none PriorityLevelName, ActiveQueues, IsIdle, IsQuiescing, WaitingRequests, ExecutingRequests, DispatchedRequests, RejectedRequests, TimedoutRequests, CancelledRequests catch-all, 0, true, false, 0, 0, 1, 0, 0, 0 exempt, 0, true, false, 0, 0, 0, 0, 0, 0 global-default, 0, true, false, 0, 0, 46, 0, 0, 0 leader-election, 0, true, false, 0, 0, 4, 0, 0, 0 node-high, 0, true, false, 0, 0, 34, 0, 0, 0 system, 0, true, false, 0, 0, 48, 0, 0, 0 workload-high, 0, true, false, 0, 0, 500, 0, 0, 0 workload-low, 0, true, false, 0, 0, 0, 0, 0, 0 ``` Explanation for selected column names: - `IsQuiescing` indicates if this priority level will be removed when its queues have been drained. - `/debug/api\_priority\_and\_fairness/dump\_queues` - a listing of all the queues and their current state. You can fetch like this: ```shell kubectl get --raw /debug/api\_priority\_and\_fairness/dump\_queues ``` The output will be in CSV and similar to this: ```none PriorityLevelName, Index, PendingRequests, ExecutingRequests, SeatsInUse, NextDispatchR, InitialSeatsSum, MaxSeatsSum, TotalWorkSum workload-low, 14, 27, 0, 0, 77.64342019ss, 270, 270, 0.81000000ss workload-low, 74, 26, 0, 0, 76.95387841ss, 260, 260, 0.78000000ss ... leader-election, 0, 0, 0, 0, 5088.87053833ss, 0, 0, 0.00000000ss leader-election, 1, 0, 0, 0, 0.00000000ss, 0, 0, 0.00000000ss ... workload-high, 0, 0, 0, 0, 0.00000000ss, 0, 0, 0.00000000ss workload-high, 1, 0, 0, 0, 1119.44936475ss, 0, 0, 0.00000000ss ``` Explanation for selected column names: - `NextDispatchR`: The R progress meter reading, in units of seat-seconds, at which the next request will be dispatched. - `InitialSeatsSum`: The sum of InitialSeats associated with all requests in a given queue. - `MaxSeatsSum`: The sum of MaxSeats associated with all requests in a given queue. - `TotalWorkSum`: The sum of total work, in units of seat-seconds, of all waiting requests in a given queue. Note: `seat-second` (abbreviate as `ss`) is a measure of work, in units of seat-seconds, in the APF world. - `/debug/api\_priority\_and\_fairness/dump\_requests` - a listing of all the requests including requests waiting in a queue and requests being executing. You can fetch like this: ```shell kubectl get --raw /debug/api\_priority\_and\_fairness/dump\_requests ``` The output will be in CSV and similar to this: ```none PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, InitialSeats, FinalSeats, AdditionalLatency, StartTime exempt, exempt, -1, -1, , 2023-07-15T04:51:25.596404345Z, 1, 0, 0s, 2023-07-15T04:51:25.596404345Z workload-low, service-accounts, 14, 0, system:serviceaccount:default:loadtest, 2023-07-18T00:12:51.386556253Z, 10, 0, 0s, 0001-01-01T00:00:00Z workload-low,
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/debug-cluster/flow-control.md
main
kubernetes
[ -0.026390014216303825, 0.03507952392101288, 0.04588370770215988, -0.012210071086883545, -0.016289664432406425, -0.055936869233846664, -0.03574840724468231, -0.016944104805588722, 0.10578638315200806, 0.07428377866744995, -0.05520697310566902, -0.07729755342006683, -0.05406548082828522, -0....
0.091418
like this: ```shell kubectl get --raw /debug/api\_priority\_and\_fairness/dump\_requests ``` The output will be in CSV and similar to this: ```none PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, InitialSeats, FinalSeats, AdditionalLatency, StartTime exempt, exempt, -1, -1, , 2023-07-15T04:51:25.596404345Z, 1, 0, 0s, 2023-07-15T04:51:25.596404345Z workload-low, service-accounts, 14, 0, system:serviceaccount:default:loadtest, 2023-07-18T00:12:51.386556253Z, 10, 0, 0s, 0001-01-01T00:00:00Z workload-low, service-accounts, 14, 1, system:serviceaccount:default:loadtest, 2023-07-18T00:12:51.487092539Z, 10, 0, 0s, 0001-01-01T00:00:00Z ``` You can get a more detailed listing with a command like this: ```shell kubectl get --raw '/debug/api\_priority\_and\_fairness/dump\_requests?includeRequestDetails=1' ``` The output will be in CSV and similar to this: ```none PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, InitialSeats, FinalSeats, AdditionalLatency, StartTime, UserName, Verb, APIPath, Namespace, Name, APIVersion, Resource, SubResource exempt, exempt, -1, -1, , 2023-07-15T04:51:25.596404345Z, 1, 0, 0s, 2023-07-15T04:51:25.596404345Z, system:serviceaccount:system:admin, list, /api/v1/namespaces/kube-stress/configmaps, kube-stress, , v1, configmaps, workload-low, service-accounts, 14, 0, system:serviceaccount:default:loadtest, 2023-07-18T00:13:08.986534842Z, 10, 0, 0s, 0001-01-01T00:00:00Z, system:serviceaccount:default:loadtest, list, /api/v1/namespaces/kube-stress/configmaps, kube-stress, , v1, configmaps, workload-low, service-accounts, 14, 1, system:serviceaccount:default:loadtest, 2023-07-18T00:13:09.086476021Z, 10, 0, 0s, 0001-01-01T00:00:00Z, system:serviceaccount:default:loadtest, list, /api/v1/namespaces/kube-stress/configmaps, kube-stress, , v1, configmaps, ``` Explanation for selected column names: - `QueueIndex`: The index of the queue. It will be -1 for priority levels without queues. - `RequestIndexInQueue`: The index in the queue for a given request. It will be -1 for executing requests. - `InitialSeats`: The number of seats will be occupied during the initial (normal) stage of execution of the request. - `FinalSeats`: The number of seats will be occupied during the final stage of request execution, accounting for the associated WATCH notifications. - `AdditionalLatency`: The extra time taken during the final stage of request execution. FinalSeats will be occupied during this time period. It does not mean any latency that a user will observe. - `StartTime`: The time a request starts to execute. It will be 0001-01-01T00:00:00Z for queued requests. ## Debug logging At `-v=3` or more verbosity, the API server outputs an httplog line for every request in the API server log, and it includes the following attributes. - `apf\_fs`: the name of the flow schema to which the request was classified. - `apf\_pl`: the name of the priority level for that flow schema. - `apf\_iseats`: the number of seats determined for the initial (normal) stage of execution of the request. - `apf\_fseats`: the number of seats determined for the final stage of execution (accounting for the associated `watch` notifications) of the request. - `apf\_additionalLatency`: the duration of the final stage of execution of the request. At higher levels of verbosity there will be log lines exposing details of how APF handled the request, primarily for debugging purposes. ## Response headers APF adds the following two headers to each HTTP response message. They won't appear in the audit log. They can be viewed from the client side. For client using `klog`, use verbosity `-v=8` or higher to view these headers. - `X-Kubernetes-PF-FlowSchema-UID` holds the UID of the FlowSchema object to which the corresponding request was classified. - `X-Kubernetes-PF-PriorityLevel-UID` holds the UID of the PriorityLevelConfiguration object associated with that FlowSchema. ## {{% heading "whatsnext" %}} For background information on design details for API priority and fairness, see the [enhancement proposal](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/debug-cluster/flow-control.md
main
kubernetes
[ -0.0014230681117624044, 0.07850275188684464, -0.08668187260627747, 0.00030485016759485006, -0.025524882599711418, -0.06463904678821564, 0.016948005184531212, -0.02532953768968582, 0.11845707148313522, 0.03423083573579788, -0.0339662991464138, -0.12870573997497559, -0.009712408296763897, -0...
0.13284
This page provides details of version compatibility between the Kubernetes [device plugin API](https://github.com/kubernetes/kubelet/tree/master/pkg/apis/deviceplugin), and different versions of Kubernetes itself. ## Compatibility matrix | | `v1alpha1` | `v1beta1` | |-----------------|-------------|-------------| | Kubernetes 1.21 | - | ✓ | | Kubernetes 1.22 | - | ✓ | | Kubernetes 1.23 | - | ✓ | | Kubernetes 1.24 | - | ✓ | | Kubernetes 1.25 | - | ✓ | | Kubernetes 1.26 | - | ✓ | Key: \* `✓` Exactly the same features / API objects in both device plugin API and the Kubernetes version. \* `+` The device plugin API has features or API objects that may not be present in the Kubernetes cluster, either because the device plugin API has added additional new API calls, or that the server has removed an old API call. However, everything they have in common (most other APIs) will work. Note that alpha APIs may vanish or change significantly between one minor release and the next. \* `-` The Kubernetes cluster has features the device plugin API can't use, either because server has added additional API calls, or that device plugin API has removed an old API call. However, everything they share in common (most APIs) will work.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/device-plugin-api-versions.md
main
kubernetes
[ -0.020174670964479446, -0.04481498897075653, 0.05275430902838707, -0.07758054882287979, 0.004252741113305092, 0.005670906510204077, -0.08785384893417358, -0.019222289323806763, 0.024656977504491806, 0.0022183777764439583, 0.038034144788980484, -0.04131051152944565, -0.03406170755624771, -0...
0.078189
{{< feature-state feature\_gate\_name="SystemdWatchdog" >}} On Linux nodes, Kubernetes {{< skew currentVersion >}} supports integrating with [systemd](https://systemd.io/) to allow the operating system supervisor to recover a failed kubelet. This integration is not enabled by default. It can be used as an alternative to periodically requesting the kubelet's `/healthz` endpoint for health checks. If the kubelet does not respond to the watchdog within the timeout period, the watchdog will kill the kubelet. The systemd watchdog works by requiring the service to periodically send a \_keep-alive\_ signal to the systemd process. If the signal is not received within a specified timeout period, the service is considered unresponsive and is terminated. The service can then be restarted according to the configuration. ## Configuration Using the systemd watchdog requires configuring the `WatchdogSec` parameter in the `[Service]` section of the kubelet service unit file: ``` [Service] WatchdogSec=30s ``` Setting `WatchdogSec=30s` indicates a service watchdog timeout of 30 seconds. Within the kubelet, the `sd\_notify()` function is invoked, at intervals of \\( WatchdogSec \div 2\\). to send `WATCHDOG=1` (a keep-alive message). If the watchdog is not fed within the timeout period, the kubelet will be killed. Setting `Restart` to "always", "on-failure", "on-watchdog", or "on-abnormal" will ensure that the service is automatically restarted. Some details about the systemd configuration: 1. If you set the systemd value for `WatchdogSec` to 0, or omit setting it, the systemd watchdog is not enabled for this unit. 2. The kubelet supports a minimum watchdog period of 1.0 seconds; this is to prevent the kubelet from being killed unexpectedly. You can set the value of `WatchdogSec` in a systemd unit definition to a period shorter than 1 second, but Kubernetes does not support any shorter interval. The timeout does not have to be a whole integer number of seconds. 3. The Kubernetes project suggests setting `WatchdogSec` to approximately a 15s period. Periods longer than 10 minutes are supported but explicitly \*\*not\*\* recommended. ### Example Configuration ```systemd [Unit] Description=kubelet: The Kubernetes Node Agent Documentation=https://kubernetes.io/docs/home/ Wants=network-online.target After=network-online.target [Service] ExecStart=/usr/bin/kubelet # Configures the watchdog timeout WatchdogSec=30s Restart=on-failure StartLimitInterval=0 RestartSec=10 [Install] WantedBy=multi-user.target ``` ## {{% heading "whatsnext" %}} For more details about systemd configuration, refer to the [systemd documentation](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#WatchdogSec=)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/systemd-watchdog.md
main
kubernetes
[ -0.01111553329974413, 0.024130696430802345, 0.036677394062280655, -0.028344765305519104, 0.010810283944010735, 0.03253279998898506, -0.029309077188372612, -0.006906214635819197, 0.08068101108074188, 0.02152271382510662, -0.052850332111120224, 0.01512651052325964, 0.012975944206118584, -0.0...
0.161152
The status of a [node](/docs/concepts/architecture/nodes/) in Kubernetes is a critical aspect of managing a Kubernetes cluster. In this article, we'll cover the basics of monitoring and maintaining node status to ensure a healthy and stable cluster. ## Node status fields A Node's status contains the following information: \* [Addresses](#addresses) \* [Conditions](#condition) \* [Capacity and Allocatable](#capacity) \* [Info](#info) \* [Declared Features](#declaredfeatures) You can use `kubectl` to view a Node's status and other details: ```shell kubectl describe node ``` Each section of the output is described below. ## Addresses The usage of these fields varies depending on your cloud provider or bare metal configuration. \* HostName: The hostname as reported by the node's kernel. Can be overridden via the kubelet `--hostname-override` parameter. \* ExternalIP: Typically the IP address of the node that is externally routable (available from outside the cluster). \* InternalIP: Typically the IP address of the node that is routable only within the cluster. ## Conditions {#condition} The `conditions` field describes the status of all `Running` nodes. Examples of conditions include: {{< table caption = "Node conditions, and a description of when each condition applies." >}} | Node Condition | Description | |----------------------|-------------| | `Ready` | `True` if the node is healthy and ready to accept pods, `False` if the node is not healthy and is not accepting pods, and `Unknown` if the node controller has not heard from the node in the last `node-monitor-grace-period` (default is 50 seconds) | | `DiskPressure` | `True` if pressure exists on the disk size—that is, if the disk capacity is low; otherwise `False` | | `MemoryPressure` | `True` if pressure exists on the node memory—that is, if the node memory is low; otherwise `False` | | `PIDPressure` | `True` if pressure exists on the processes—that is, if there are too many processes on the node; otherwise `False` | | `NetworkUnavailable` | `True` if the network for the node is not correctly configured, otherwise `False` | {{< /table >}} {{< note >}} If you use command-line tools to print details of a cordoned Node, the Condition includes `SchedulingDisabled`. `SchedulingDisabled` is not a Condition in the Kubernetes API; instead, cordoned nodes are marked Unschedulable in their spec. {{< /note >}} In the Kubernetes API, a node's condition is represented as part of the `.status` of the Node resource. For example, the following JSON structure describes a healthy node: ```json "conditions": [ { "type": "Ready", "status": "True", "reason": "KubeletReady", "message": "kubelet is posting ready status", "lastHeartbeatTime": "2019-06-05T18:38:35Z", "lastTransitionTime": "2019-06-05T11:41:27Z" } ] ``` When problems occur on nodes, the Kubernetes control plane automatically creates [taints](/docs/concepts/scheduling-eviction/taint-and-toleration/) that match the conditions affecting the node. An example of this is when the `status` of the Ready condition remains `Unknown` or `False` for longer than the kube-controller-manager's `NodeMonitorGracePeriod`, which defaults to 50 seconds. This will cause either an `node.kubernetes.io/unreachable` taint, for an `Unknown` status, or a `node.kubernetes.io/not-ready` taint, for a `False` status, to be added to the Node. These taints affect pending pods as the scheduler takes the Node's taints into consideration when assigning a pod to a Node. Existing pods scheduled to the node may be evicted due to the application of `NoExecute` taints. Pods may also have {{< glossary\_tooltip text="tolerations" term\_id="toleration" >}} that let them schedule to and continue running on a Node even though it has a specific taint. See [Taint Based Evictions](/docs/concepts/scheduling-eviction/taint-and-toleration/#taint-based-evictions) and [Taint Nodes by Condition](/docs/concepts/scheduling-eviction/taint-and-toleration/#taint-nodes-by-condition) for more details. ## Capacity and Allocatable {#capacity} Describes the resources available on the node: CPU, memory, and the maximum number of pods that can be scheduled onto the node. The fields in the capacity block indicate the total amount
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/node-status.md
main
kubernetes
[ 0.056050077080726624, 0.028116680681705475, -0.011011787690222263, 0.011748751625418663, 0.017134595662355423, -0.013622882775962353, -0.02141859382390976, -0.045170366764068604, 0.05495001748204231, 0.06075240299105644, -0.03509649634361267, -0.03781329467892647, -0.013949492946267128, -0...
0.221626
taint. See [Taint Based Evictions](/docs/concepts/scheduling-eviction/taint-and-toleration/#taint-based-evictions) and [Taint Nodes by Condition](/docs/concepts/scheduling-eviction/taint-and-toleration/#taint-nodes-by-condition) for more details. ## Capacity and Allocatable {#capacity} Describes the resources available on the node: CPU, memory, and the maximum number of pods that can be scheduled onto the node. The fields in the capacity block indicate the total amount of resources that a Node has. The allocatable block indicates the amount of resources on a Node that is available to be consumed by normal Pods. You may read more about capacity and allocatable resources while learning how to [reserve compute resources](/docs/tasks/administer-cluster/reserve-compute-resources/#node-allocatable) on a Node. ## Info Describes general information about the node, such as kernel version, Kubernetes version (kubelet and kube-proxy version), container runtime details, and which operating system the node uses. The kubelet gathers this information from the node and publishes it into the Kubernetes API. ## Declared features {#declaredfeatures} {{< feature-state feature\_gate\_name="NodeDeclaredFeatures" >}} This field lists specific Kubernetes features that are currently enabled on the node's kubelet via [feature gates](/docs/reference/command-line-tools-reference/feature-gates/). The features are reported by the kubelet as a list of strings in the `.status.declaredFeatures` field of the Node object. This field is intended for newer features under active development; features that have graduated and no longer require a feature gate are considered baseline and are not declared in this field. This reflects the enablement of Kubernetes features, not the underlying operating system or kernel capabilities of the node. See [Node Declared Features](/docs/concepts/scheduling-eviction/node-declared-features/) for more details. ## Heartbeats Heartbeats, sent by Kubernetes nodes, help your cluster determine the availability of each node, and to take action when failures are detected. For nodes there are two forms of heartbeats: \* updates to the `.status` of a Node \* [Lease](/docs/concepts/architecture/leases/) objects within the `kube-node-lease` {{< glossary\_tooltip term\_id="namespace" text="namespace">}}. Each Node has an associated Lease object. Compared to updates to `.status` of a Node, a Lease is a lightweight resource. Using Leases for heartbeats reduces the performance impact of these updates for large clusters. The kubelet is responsible for creating and updating the `.status` of Nodes, and for updating their related Leases. - The kubelet updates the node's `.status` either when there is change in status or if there has been no update for a configured interval. The default interval for `.status` updates to Nodes is 5 minutes, which is much longer than the 40 second default timeout for unreachable nodes. - The kubelet creates and then updates its Lease object every 10 seconds (the default update interval). Lease updates occur independently from updates to the Node's `.status`. If the Lease update fails, the kubelet retries, using exponential backoff that starts at 200 milliseconds and capped at 7 seconds.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/node-status.md
main
kubernetes
[ 0.036720551550388336, 0.020131658762693405, -0.04519800469279289, 0.03693666309118271, 0.042161449790000916, -0.013883783482015133, -0.006817728281021118, 0.006772435735911131, 0.024984678253531456, 0.016194194555282593, -0.029472345486283302, -0.02796291373670101, -0.011204918846487999, -...
0.236856
When using the kubelet's `--config-dir` flag to specify a drop-in directory for configuration, there is some specific behavior on how different types are merged. Here are some examples of how different data types behave during configuration merging: ### Structure Fields There are two types of structure fields in a YAML structure: singular (or a scalar type) and embedded (structures that contain scalar types). The configuration merging process handles the overriding of singular and embedded struct fields to create a resulting kubelet configuration. For instance, you may want a baseline kubelet configuration for all nodes, but you may want to customize the `address` and `authorization` fields. This can be done as follows: Main kubelet configuration file contents: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 authorization: mode: Webhook webhook: cacheAuthorizedTTL: "5m" cacheUnauthorizedTTL: "30s" serializeImagePulls: false address: "192.168.0.1" ``` Contents of a file in `--config-dir` directory: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration authorization: mode: AlwaysAllow webhook: cacheAuthorizedTTL: "8m" cacheUnauthorizedTTL: "45s" address: "192.168.0.8" ``` The resulting configuration will be as follows: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 serializeImagePulls: false authorization: mode: AlwaysAllow webhook: cacheAuthorizedTTL: "8m" cacheUnauthorizedTTL: "45s" address: "192.168.0.8" ``` ### Lists You can override the slices/lists values of the kubelet configuration. However, the entire list gets overridden during the merging process. For example, you can override the `clusterDNS` list as follows: Main kubelet configuration file contents: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 serializeImagePulls: false clusterDNS: - "192.168.0.9" - "192.168.0.8" ``` Contents of a file in `--config-dir` directory: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration clusterDNS: - "192.168.0.2" - "192.168.0.3" - "192.168.0.5" ``` The resulting configuration will be as follows: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 serializeImagePulls: false clusterDNS: - "192.168.0.2" - "192.168.0.3" - "192.168.0.5" ``` ### Maps, including Nested Structures Individual fields in maps, regardless of their value types (boolean, string, etc.), can be selectively overridden. However, for `map[string][]string`, the entire list associated with a specific field gets overridden. Let's understand this better with an example, particularly on fields like `featureGates` and `staticPodURLHeader`: Main kubelet configuration file contents: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 serializeImagePulls: false featureGates: AllAlpha: false MemoryQoS: true staticPodURLHeader: kubelet-api-support: - "Authorization: 234APSDFA" - "X-Custom-Header: 123" custom-static-pod: - "Authorization: 223EWRWER" - "X-Custom-Header: 456" ``` Contents of a file in `--config-dir` directory: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration featureGates: MemoryQoS: false KubeletTracing: true DynamicResourceAllocation: true staticPodURLHeader: custom-static-pod: - "Authorization: 223EWRWER" - "X-Custom-Header: 345" ``` The resulting configuration will be as follows: ```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration port: 20250 serializeImagePulls: false featureGates: AllAlpha: false MemoryQoS: false KubeletTracing: true DynamicResourceAllocation: true staticPodURLHeader: kubelet-api-support: - "Authorization: 234APSDFA" - "X-Custom-Header: 123" custom-static-pod: - "Authorization: 223EWRWER" - "X-Custom-Header: 345" ```
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kubelet-config-directory-merging.md
main
kubernetes
[ 0.026347637176513672, 0.04122478514909744, 0.051060136407613754, -0.05334042012691498, -0.08768773823976517, -0.031225213780999184, -0.0004620325635187328, 0.003282004501670599, 0.08308643847703934, -0.050012875348329544, 0.037046365439891815, -0.07458002120256424, 0.011572357267141342, -0...
0.065056
{{% thirdparty-content %}} Many features rely on specific kernel functionalities and have minimum kernel version requirements. However, relying solely on kernel version numbers may not be sufficient for certain operating system distributions, as maintainers for distributions such as RHEL, Ubuntu and SUSE often backport selected features to older kernel releases (retaining the older kernel version). ## Pod sysctls On Linux, the `sysctl()` system call configures kernel parameters at run time. There is a command line tool named `sysctl` that you can use to configure these parameters, and many are exposed via the `proc` filesystem. Some sysctls are only available if you have a modern enough kernel. The following sysctls have a minimal kernel version requirement, and are supported in the [safe set](/docs/tasks/administer-cluster/sysctl-cluster/#safe-and-unsafe-sysctls): - `net.ipv4.ip\_local\_reserved\_ports` (since Kubernetes 1.27, needs kernel 3.16+); - `net.ipv4.tcp\_keepalive\_time` (since Kubernetes 1.29, needs kernel 4.5+); - `net.ipv4.tcp\_fin\_timeout` (since Kubernetes 1.29, needs kernel 4.6+); - `net.ipv4.tcp\_keepalive\_intvl` (since Kubernetes 1.29, needs kernel 4.5+); - `net.ipv4.tcp\_keepalive\_probes` (since Kubernetes 1.29, needs kernel 4.5+); - `net.ipv4.tcp\_syncookies` (namespaced since kernel 4.6+). - `net.ipv4.tcp\_rmem` (since Kubernetes 1.32, needs kernel 4.15+). - `net.ipv4.tcp\_wmem` (since Kubernetes 1.32, needs kernel 4.15+). - `net.ipv4.vs.conn\_reuse\_mode` (used in `ipvs` proxy mode, needs kernel 4.1+); ### kube proxy `nftables` proxy mode For Kubernetes {{< skew currentVersion >}}, the [`nftables` mode](/docs/reference/networking/virtual-ips/#proxy-mode-nftables) of kube-proxy requires version 1.0.1 or later of the nft command-line tool, as well as kernel 5.13 or later. For testing/development purposes, you can use older kernels, as far back as 5.4 if you set the `nftables.skipKernelVersionCheck` option in the kube-proxy config. But this is not recommended in production since it may cause problems with other nftables users on the system. ## Version 2 control groups Kubernetes cgroup v1 support is in maintained mode starting from Kubernetes v1.31; using cgroup v2 is recommended. In [Linux 5.8](https://github.com/torvalds/linux/commit/4a7e89c5ec0238017a757131eb9ab8dc111f961c), the system-level `cpu.stat` file was added to the root cgroup for convenience. In runc document, Kernel older than 5.2 is not recommended due to lack of freezer. ## Pressure Stall Information (PSI) {#requirements-psi} [Pressure Stall Information](/docs/reference/instrumentation/understand-psi-metrics/) is supported in Linux kernel versions 4.20 and up, but requires the following configuration: - The kernel must be compiled with the `CONFIG\_PSI=y` option. Most modern distributions enable this by default. You can check your kernel's configuration by running `zgrep CONFIG\_PSI /proc/config.gz`. - Some Linux distributions may compile PSI into the kernel but disable it by default. If so, you need to enable it at boot time by adding the `psi=1` parameter to the kernel command line. ## Other kernel requirements {#requirements-other} Some features may depend on new kernel functionalities and have specific kernel requirements: 1. [Recursive read only mount](/docs/concepts/storage/volumes/#recursive-read-only-mounts): This is implemented by applying the `MOUNT\_ATTR\_RDONLY` attribute with the `AT\_RECURSIVE` flag using `mount\_setattr`(2) added in Linux kernel v5.12. 2. Pod user namespace support requires minimal kernel version 6.5+, according to [KEP-127](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/127-user-namespaces/README.md). 3. For [node system swap](/docs/concepts/architecture/nodes/#swap-memory), tmpfs set to `noswap` is not supported until kernel 6.3. ## Linux kernel long term maintenance Active kernel releases can be found in [kernel.org](https://www.kernel.org/category/releases.html). There are usually several \_long term maintenance\_ kernel releases provided for the purposes of backporting bug fixes for older kernel trees. Only important bug fixes are applied to such kernels and they don't usually see very frequent releases, especially for older trees. See the Linux kernel website for the [list of releases](https://www.kernel.org/category/releases.html) in the \_Longterm\_ category. ## {{% heading "whatsnext" %}} - See [sysctls](/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - Allow running kube-proxy with in [nftables mode](/docs/reference/networking/virtual-ips/#proxy-mode-nftables). - Read more information in [cgroups v2](/docs/concepts/architecture/cgroups/).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kernel-version-requirements.md
main
kubernetes
[ 0.0053762043826282024, -0.07578083872795105, -0.04938403144478798, -0.06635662913322449, 0.10328178107738495, -0.036572832614183426, -0.03366825357079506, 0.05850572511553764, -0.022661639377474785, -0.01539202407002449, 0.07599268108606339, -0.016986845061182976, -0.06791431456804276, -0....
0.157401
heading "whatsnext" %}} - See [sysctls](/docs/tasks/administer-cluster/sysctl-cluster/) for more details. - Allow running kube-proxy with in [nftables mode](/docs/reference/networking/virtual-ips/#proxy-mode-nftables). - Read more information in [cgroups v2](/docs/concepts/architecture/cgroups/).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kernel-version-requirements.md
main
kubernetes
[ -0.0009893450187519193, -0.00420448649674654, -0.02660241536796093, -0.02502496913075447, -0.08973151445388794, 0.020042356103658676, 0.0010037686442956328, -0.034856852144002914, -0.004432723857462406, -0.007444245275110006, -0.0345255583524704, -0.047419752925634384, -0.0240472499281168, ...
0.207572
Kubernetes {{< glossary\_tooltip text="nodes" term\_id="node" >}} come pre-populated with a standard set of {{< glossary\_tooltip text="labels" term\_id="label" >}}. You can also set your own labels on nodes, either through the kubelet configuration or using the Kubernetes API. ## Preset labels The preset labels that Kubernetes sets on nodes are: \* [`kubernetes.io/arch`](/docs/reference/labels-annotations-taints/#kubernetes-io-arch) \* [`kubernetes.io/hostname`](/docs/reference/labels-annotations-taints/#kubernetesiohostname) \* [`kubernetes.io/os`](/docs/reference/labels-annotations-taints/#kubernetes-io-os) \* [`node.kubernetes.io/instance-type`](/docs/reference/labels-annotations-taints/#nodekubernetesioinstance-type) (if known to the kubelet – Kubernetes may not have this information to set the label) \* [`topology.kubernetes.io/region`](/docs/reference/labels-annotations-taints/#topologykubernetesioregion) (if known to the kubelet – Kubernetes may not have this information to set the label) \* [`topology.kubernetes.io/zone`](/docs/reference/labels-annotations-taints/#topologykubernetesiozone) (if known to the kubelet – Kubernetes may not have this information to set the label) {{}} The value of these labels is cloud provider specific and is not guaranteed to be reliable. For example, the value of `kubernetes.io/hostname` may be the same as the node name in some environments and a different value in other environments. {{}} ## {{% heading "whatsnext" %}} - See [Well-Known Labels, Annotations and Taints](/docs/reference/labels-annotations-taints/) for a list of common labels. - Learn how to [add a label to a node](/docs/tasks/configure-pod-container/assign-pods-nodes/#add-a-label-to-a-node).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/node-labels.md
main
kubernetes
[ -0.019705304875969887, 0.033857595175504684, 0.054726142436265945, -0.016988061368465424, -0.03798306733369827, 0.026979563757777214, 0.08099190890789032, -0.06132134050130844, 0.08236537128686905, -0.017846854403614998, -0.030632952228188515, -0.12109817564487457, -0.03522072359919548, -0...
0.072791
Seccomp stands for secure computing mode and has been a feature of the Linux kernel since version 2.6.12. It can be used to sandbox the privileges of a process, restricting the calls it is able to make from userspace into the kernel. Kubernetes lets you automatically apply seccomp profiles loaded onto a {{< glossary\_tooltip text="node" term\_id="node" >}} to your Pods and containers. ## Seccomp fields {{< feature-state for\_k8s\_version="v1.19" state="stable" >}} There are four ways to specify a seccomp profile for a {{< glossary\_tooltip text="pod" term\_id="pod" >}}: - for the whole Pod using [`spec.securityContext.seccompProfile`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context) - for a single container using [`spec.containers[\*].securityContext.seccompProfile`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) - for an (restartable / sidecar) init container using [`spec.initContainers[\*].securityContext.seccompProfile`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-1) - for an [ephemeral container](/docs/concepts/workloads/pods/ephemeral-containers) using [`spec.ephemeralContainers[\*].securityContext.seccompProfile`](/docs/reference/kubernetes-api/workload-resources/pod-v1/#security-context-2) {{% code\_sample file="pods/security/seccomp/fields.yaml" %}} The Pod in the example above runs as `Unconfined`, while the `ephemeral-container` and `init-container` specifically defines `RuntimeDefault`. If the ephemeral or init container would not have set the `securityContext.seccompProfile` field explicitly, then the value would be inherited from the Pod. The same applies to the container, which runs a `Localhost` profile `my-profile.json`. Generally speaking, fields from (ephemeral) containers have a higher priority than the Pod level value, while containers which do not set the seccomp field inherit the profile from the Pod. {{< note >}} It is not possible to apply a seccomp profile to a Pod or container running with `privileged: true` set in the container's `securityContext`. Privileged containers always run as `Unconfined`. {{< /note >}} The following values are possible for the `seccompProfile.type`: `Unconfined` : The workload runs without any seccomp restrictions. `RuntimeDefault` : A default seccomp profile defined by the {{< glossary\_tooltip text="container runtime" term\_id="container-runtime" >}} is applied. The default profiles aim to provide a strong set of security defaults while preserving the functionality of the workload. It is possible that the default profiles differ between container runtimes and their release versions, for example when comparing those from {{< glossary\_tooltip text="CRI-O" term\_id="cri-o" >}} and {{< glossary\_tooltip text="containerd" term\_id="containerd" >}}. `Localhost` : The `localhostProfile` will be applied, which has to be available on the node disk (on Linux it's `/var/lib/kubelet/seccomp`). The availability of the seccomp profile is verified by the {{< glossary\_tooltip text="container runtime" term\_id="container-runtime" >}} on container creation. If the profile does not exist, then the container creation will fail with a `CreateContainerError`. ### `Localhost` profiles Seccomp profiles are JSON files following the scheme defined by the [OCI runtime specification](https://github.com/opencontainers/runtime-spec/blob/f329913/config-linux.md#seccomp). A profile basically defines actions based on matched syscalls, but also allows to pass specific values as arguments to syscalls. For example: ```json { "defaultAction": "SCMP\_ACT\_ERRNO", "defaultErrnoRet": 38, "syscalls": [ { "names": [ "adjtimex", "alarm", "bind", "waitid", "waitpid", "write", "writev" ], "action": "SCMP\_ACT\_ALLOW" } ] } ``` The `defaultAction` in the profile above is defined as `SCMP\_ACT\_ERRNO` and will return as fallback to the actions defined in `syscalls`. The error is defined as code `38` via the `defaultErrnoRet` field. The following actions are generally possible: `SCMP\_ACT\_ERRNO` : Return the specified error code. `SCMP\_ACT\_ALLOW` : Allow the syscall to be executed. `SCMP\_ACT\_KILL\_PROCESS` : Kill the process. `SCMP\_ACT\_KILL\_THREAD` and `SCMP\_ACT\_KILL` : Kill only the thread. `SCMP\_ACT\_TRAP` : Throw a `SIGSYS` signal. `SCMP\_ACT\_NOTIFY` and `SECCOMP\_RET\_USER\_NOTIF`. : Notify the user space. `SCMP\_ACT\_TRACE` : Notify a tracing process with the specified value. `SCMP\_ACT\_LOG` : Allow the syscall to be executed after the action has been logged to syslog or auditd. Some actions like `SCMP\_ACT\_NOTIFY` or `SECCOMP\_RET\_USER\_NOTIF` may be not supported depending on the container runtime, OCI runtime or Linux kernel version being used. There may be also further limitations, for example that `SCMP\_ACT\_NOTIFY` cannot be used as `defaultAction` or for certain syscalls like `write`. All those limitations are defined by either
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/seccomp.md
main
kubernetes
[ -0.0027168020606040955, 0.03501585125923157, 0.03528760001063347, -0.012275642715394497, -0.0007535585900768638, -0.006358929444104433, 0.10472352057695389, -0.011638429015874863, 0.04984631389379501, -0.006862689275294542, 0.03248373419046402, -0.10515651106834412, 0.0029272129759192467, ...
0.168737
actions like `SCMP\_ACT\_NOTIFY` or `SECCOMP\_RET\_USER\_NOTIF` may be not supported depending on the container runtime, OCI runtime or Linux kernel version being used. There may be also further limitations, for example that `SCMP\_ACT\_NOTIFY` cannot be used as `defaultAction` or for certain syscalls like `write`. All those limitations are defined by either the OCI runtime ([runc](https://github.com/opencontainers/runc), [crun](https://github.com/containers/crun)) or [libseccomp](https://github.com/seccomp/libseccomp). The `syscalls` JSON array contains a list of objects referencing syscalls by their respective `names`. For example, the action `SCMP\_ACT\_ALLOW` can be used to create a whitelist of allowed syscalls as outlined in the example above. It would also be possible to define another list using the action `SCMP\_ACT\_ERRNO` but a different return (`errnoRet`) value. It is also possible to specify the arguments (`args`) passed to certain syscalls. More information about those advanced use cases can be found in the [OCI runtime spec](https://github.com/opencontainers/runtime-spec/blob/f329913/config-linux.md#seccomp) and the [Seccomp Linux kernel documentation](https://www.kernel.org/doc/Documentation/prctl/seccomp\_filter.txt). ## Further reading - [Restrict a Container's Syscalls with seccomp](/docs/tutorials/security/seccomp/) - [Pod Security Standards](/docs/concepts/security/pod-security-standards/)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/seccomp.md
main
kubernetes
[ -0.04313434660434723, -0.07039269059896469, -0.07759347558021545, -0.019302653148770332, 0.0670868530869484, -0.026125403121113777, 0.06607165932655334, 0.06180599331855774, -0.03577060624957085, 0.013099691830575466, 0.02556220255792141, -0.04555198550224304, -0.012701041996479034, 0.0459...
0.288544
The {{< glossary\_tooltip text="kubelet" term\_id="kubelet" >}} is mostly a stateless process running on a Kubernetes {{< glossary\_tooltip text="node" term\_id="node" >}}. This document outlines files that kubelet reads and writes. {{< note >}} This document is for informational purpose and not describing any guaranteed behaviors or APIs. It lists resources used by the kubelet, which is an implementation detail and a subject to change at any release. {{< /note >}} The kubelet typically uses the {{< glossary\_tooltip text="control plane" term\_id="control-plane" >}} as the source of truth on what needs to run on the Node, and the {{}} to retrieve the current state of containers. So long as you provide a \_kubeconfig\_ (API client configuration) to the kubelet, the kubelet does connect to your control plane; otherwise the node operates in \_standalone mode\_. On Linux nodes, the kubelet also relies on reading cgroups and various system files to collect metrics. On Windows nodes, the kubelet collects metrics via a different mechanism that does not rely on paths. There are also a few other files that are used by the kubelet as well, as kubelet communicates using local Unix-domain sockets. Some are sockets that the kubelet listens on, and for other sockets the kubelet discovers them and then connects as a client. {{< note >}} This page lists paths as Linux paths, which map to the Windows paths by adding a root disk `C:\` in place of `/` (unless specified otherwise). For example, `/var/lib/kubelet/device-plugins` maps to `C:\var\lib\kubelet\device-plugins`. {{< /note >}} ## Configuration ### Kubelet configuration files The path to the kubelet configuration file can be configured using the command line argument `--config`. The kubelet also supports [drop-in configuration files](/docs/tasks/administer-cluster/kubelet-config-file/#kubelet-conf-d) to enhance configuration. ### Certificates Certificates and private keys are typically located at `/var/lib/kubelet/pki`, but can be configured using the `--cert-dir` kubelet command line argument. Names of certificate files are also configurable. ### Manifests Manifests for static pods are typically located in `/etc/kubernetes/manifests`. Location can be configured using the `staticPodPath` kubelet configuration option. ### Systemd unit settings When kubelet is running as a systemd unit, some kubelet configuration may be declared in systemd unit settings file. Typically it includes: - command line arguments to [run kubelet](/docs/reference/command-line-tools-reference/kubelet/) - environment variables, used by kubelet or [configuring golang runtime](https://pkg.go.dev/runtime#hdr-Environment\_Variables) ## State ### Checkpoint files for resource managers {#resource-managers-state} All resource managers keep the mapping of Pods to allocated resources in state files. State files are located in the kubelet's base directory, also termed the \_root directory\_ (but not the same as `/`, the node root directory). You can configure the base directory for the kubelet using the kubelet command line argument `--root-dir`. Names of files: - `memory\_manager\_state` for the [Memory Manager](/docs/tasks/administer-cluster/memory-manager/) - `cpu\_manager\_state` for the [CPU Manager](/docs/tasks/administer-cluster/cpu-management-policies/) - `dra\_manager\_state` for [DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/) ### Checkpoint file for device manager {#device-manager-state} Device manager creates checkpoints in the same directory with socket files: `/var/lib/kubelet/device-plugins/`. The name of a checkpoint file is `kubelet\_internal\_checkpoint` for [Device Manager](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-integration-with-the-topology-manager) ### Pod resource checkpoints {{< feature-state feature\_gate\_name="InPlacePodVerticalScaling" >}} If a node has enabled the `InPlacePodVerticalScaling`[feature gate](/docs/reference/command-line-tools-reference/feature-gates/), the kubelet stores a local record of \_allocated\_ and \_actuated\_ Pod resources. See [Resize CPU and Memory Resources assigned to Containers](/docs/tasks/configure-pod-container/resize-container-resources/) for more details on how these records are used. Names of files: - `allocated\_pods\_state` records the resources allocated to each pod running on the node - `actuated\_pods\_state` records the resources that have been accepted by the runtime for each pod pod running on the node The files are located within the kubelet base directory (`/var/lib/kubelet` by default on Linux; configurable using `--root-dir`). ### Container runtime Kubelet communicates with the container runtime using socket configured via the configuration parameters: -
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kubelet-files.md
main
kubernetes
[ -0.058858681470155716, 0.036479707807302475, 0.029788369312882423, -0.009346487931907177, -0.06743334233760834, -0.012866465374827385, 0.03914171829819679, -0.032989080995321274, 0.1283760368824005, -0.02626907266676426, -0.008787103928625584, -0.07433455437421799, -0.01585537940263748, -0...
0.110679
resources that have been accepted by the runtime for each pod pod running on the node The files are located within the kubelet base directory (`/var/lib/kubelet` by default on Linux; configurable using `--root-dir`). ### Container runtime Kubelet communicates with the container runtime using socket configured via the configuration parameters: - `containerRuntimeEndpoint` for runtime operations - `imageServiceEndpoint` for image management operations The actual values of those endpoints depend on the container runtime being used. ### Device plugins The kubelet exposes a socket at the path `/var/lib/kubelet/device-plugins/kubelet.sock` for various [Device Plugins to register](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#device-plugin-implementation). When a device plugin registers itself, it provides its socket path for the kubelet to connect. The device plugin socket should be in the directory `device-plugins` within the kubelet base directory. On a typical Linux node, this means `/var/lib/kubelet/device-plugins`. ### Pod resources API [Pod Resources API](/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins/#monitoring-device-plugin-resources) will be exposed at the path `/var/lib/kubelet/pod-resources`. ### DRA, CSI, and Device plugins The kubelet looks for socket files created by device plugins managed via [DRA](/docs/concepts/scheduling-eviction/dynamic-resource-allocation/), device manager, or storage plugins, and then attempts to connect to these sockets. The directory that the kubelet looks in is `plugins\_registry` within the kubelet base directory, so on a typical Linux node this means `/var/lib/kubelet/plugins\_registry`. Note, for the device plugins there are two alternative registration mechanisms Only one should be used for a given plugin. The types of plugins that can place socket files into that directory are: - CSI plugins - DRA plugins - Device Manager plugins (typically `/var/lib/kubelet/plugins\_registry`). ### Graceful node shutdown {{< feature-state feature\_gate\_name="GracefulNodeShutdown" >}} [Graceful node shutdown](/docs/concepts/cluster-administration/node-shutdown/#graceful-node-shutdown) stores state locally at `/var/lib/kubelet/graceful\_node\_shutdown\_state`. ### Image Pull Records {{< feature-state feature\_gate\_name="KubeletEnsureSecretPulledImages" >}} The kubelet stores records of attempted and successful image pulls, and uses it to verify that the image was previously successfully pulled with the same credentials. These records are cached as files in the `image\_registry` directory within the kubelet base directory. On a typical Linux node, this means `/var/lib/kubelet/image\_manager`. There are two subdirectories to `image\_manager`: \* `pulling` - stores records about images the Kubelet is attempting to pull. \* `pulled` - stores records about images that were successfully pulled by the Kubelet, along with metadata about the credentials used for the pulls. See [Ensure Image Pull Credential Verification](/docs/concepts/containers/images#ensureimagepullcredentialverification) for details. ## Security profiles & configuration ### Seccomp Seccomp profile files referenced from Pods should be placed in `/var/lib/kubelet/seccomp`. See the [seccomp reference](/docs/reference/node/seccomp/) for details. ### AppArmor The kubelet does not load or refer to AppArmor profiles by a Kubernetes-specific path. AppArmor profiles are loaded via the node operating system rather then referenced by their path. ## Locking {{< feature-state state="alpha" for\_k8s\_version="v1.2" >}} A lock file for the kubelet; typically `/var/run/kubelet.lock`. The kubelet uses this to ensure that two different kubelets don't try to run in conflict with each other. You can configure the path to the lock file using the the `--lock-file` kubelet command line argument. If two kubelets on the same node use a different value for the lock file path, they will not be able to detect a conflict when both are running. ## {{% heading "whatsnext" %}} - Learn about the kubelet [command line arguments](/docs/reference/command-line-tools-reference/kubelet/). - Review the [Kubelet Configuration (v1beta1) reference](/docs/reference/config-api/kubelet-config.v1beta1/)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kubelet-files.md
main
kubernetes
[ 0.03213227540254593, 0.008290449157357216, 0.012290475890040398, 0.004821960348635912, -0.040224652737379074, -0.00939156860113144, -0.018503785133361816, 0.012805896811187267, 0.10330232232809067, -0.009654619731009007, 0.013274791650474072, -0.03578644245862961, -0.015574643388390541, -0...
0.172083
{{< feature-state feature\_gate\_name="ContainerCheckpoint" >}} Checkpointing a container is the functionality to create a stateful copy of a running container. Once you have a stateful copy of a container, you could move it to a different computer for debugging or similar purposes. If you move the checkpointed container data to a computer that's able to restore it, that restored container continues to run at exactly the same point it was checkpointed. You can also inspect the saved data, provided that you have suitable tools for doing so. Creating a checkpoint of a container might have security implications. Typically a checkpoint contains all memory pages of all processes in the checkpointed container. This means that everything that used to be in memory is now available on the local disk. This includes all private data and possibly keys used for encryption. The underlying CRI implementations (the container runtime on that node) should create the checkpoint archive to be only accessible by the `root` user. It is still important to remember if the checkpoint archive is transferred to another system all memory pages will be readable by the owner of the checkpoint archive. ## Operations {#operations} ### `post` checkpoint the specified container {#post-checkpoint} Tell the kubelet to checkpoint a specific container from the specified Pod. Consult the [Kubelet authentication/authorization reference](/docs/reference/access-authn-authz/kubelet-authn-authz) for more information about how access to the kubelet checkpoint interface is controlled. The kubelet will request a checkpoint from the underlying {{}} implementation. In the checkpoint request the kubelet will specify the name of the checkpoint archive as `checkpoint---.tar` and also request to store the checkpoint archive in the `checkpoints` directory below its root directory (as defined by `--root-dir`). This defaults to `/var/lib/kubelet/checkpoints`. The checkpoint archive is in \_tar\_ format, and could be listed using an implementation of [`tar`](https://pubs.opengroup.org/onlinepubs/7908799/xcu/tar.html). The contents of the archive depend on the underlying CRI implementation (the container runtime on that node). #### HTTP Request {#post-checkpoint-request} POST /checkpoint/{namespace}/{pod}/{container} #### Parameters {#post-checkpoint-params} - \*\*namespace\*\* (\*in path\*): string, required {{< glossary\_tooltip term\_id="namespace" >}} - \*\*pod\*\* (\*in path\*): string, required {{< glossary\_tooltip term\_id="pod" >}} - \*\*container\*\* (\*in path\*): string, required {{< glossary\_tooltip term\_id="container" >}} - \*\*timeout\*\* (\*in query\*): integer Timeout in seconds to wait until the checkpoint creation is finished. If zero or no timeout is specified the default {{}} timeout value will be used. Checkpoint creation time depends directly on the used memory of the container. The more memory a container uses the more time is required to create the corresponding checkpoint. #### Response {#post-checkpoint-response} 200: OK 401: Unauthorized 404: Not Found (if the `ContainerCheckpoint` feature gate is disabled) 404: Not Found (if the specified `namespace`, `pod` or `container` cannot be found) 500: Internal Server Error (if the CRI implementation encounter an error during checkpointing (see error message for further details)) 500: Internal Server Error (if the CRI implementation does not implement the checkpoint CRI API (see error message for further details)) {{< comment >}} TODO: Add more information about return codes once CRI implementation have checkpoint/restore. This TODO cannot be fixed before the release, because the CRI implementation need the Kubernetes changes to be merged to implement the new ContainerCheckpoint CRI API call. We need to wait after the 1.25 release to fix this. {{< /comment >}}
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/kubelet-checkpoint-api.md
main
kubernetes
[ 0.014311576262116432, 0.043455056846141815, -0.04761834442615509, -0.008688471280038357, 0.10034547746181488, -0.0556485541164875, 0.026043465360999107, -0.04123667627573013, -0.011195019818842411, -0.010145210660994053, -0.005782430991530418, 0.06779906898736954, 0.02594084106385708, -0.0...
0.072325
This is a list of articles and other pages that are either about the Kubernetes' deprecation and removal of \_dockershim\_, or about using CRI-compatible container runtimes, in connection with that removal. ## Kubernetes project \* Kubernetes blog: [Dockershim Removal FAQ](/blog/2020/12/02/dockershim-faq/) (originally published 2020/12/02) \* Kubernetes blog: [Updated: Dockershim Removal FAQ](/blog/2022/02/17/dockershim-faq/) (updated published 2022/02/17) \* Kubernetes blog: [Kubernetes is Moving on From Dockershim: Commitments and Next Steps](/blog/2022/01/07/kubernetes-is-moving-on-from-dockershim/) (published 2022/01/07) \* Kubernetes blog: [Dockershim removal is coming. Are you ready?](/blog/2021/11/12/are-you-ready-for-dockershim-removal/) (published 2021/11/12) \* Kubernetes documentation: [Migrating from dockershim](/docs/tasks/administer-cluster/migrating-from-dockershim/) \* Kubernetes documentation: [Container Runtimes](/docs/setup/production-environment/container-runtimes/) \* Kubernetes enhancement proposal: [KEP-2221: Removing dockershim from kubelet](https://github.com/kubernetes/enhancements/blob/master/keps/sig-node/2221-remove-dockershim/README.md) \* Kubernetes enhancement proposal issue: [Removing dockershim from kubelet](https://github.com/kubernetes/enhancements/issues/2221) (\_k/enhancements#2221\_) You can provide feedback via the GitHub issue [\*\*Dockershim removal feedback & issues\*\*](https://github.com/kubernetes/kubernetes/issues/106917). (\_k/kubernetes/#106917\_) ## External sources {#third-party} \* Amazon Web Services EKS documentation: [Amazon EKS is ending support for Dockershim](https://docs.aws.amazon.com/eks/latest/userguide/dockershim-deprecation.html) \* CNCF conference video: [Lessons Learned Migrating Kubernetes from Docker to containerd Runtime](https://www.youtube.com/watch?v=uDOu6rK4yOk) (Ana Caylin, at KubeCon Europe 2019) \* Docker.com blog: [What developers need to know about Docker, Docker Engine, and Kubernetes v1.20](https://www.docker.com/blog/what-developers-need-to-know-about-docker-docker-engine-and-kubernetes-v1-20/) (published 2020/12/04) \* "\_Google Open Source\_" channel on YouTube: [Learn Kubernetes with Google - Migrating from Dockershim to Containerd](https://youtu.be/fl7\_4hjT52g) \* Microsoft Apps on Azure blog: [Dockershim deprecation and AKS](https://techcommunity.microsoft.com/t5/apps-on-azure-blog/dockershim-deprecation-and-aks/ba-p/3055902) (published 2022/01/21) \* Mirantis blog: [The Future of Dockershim is cri-dockerd](https://www.mirantis.com/blog/the-future-of-dockershim-is-cri-dockerd/) (published 2021/04/21) \* Mirantis: [Mirantis/cri-dockerd](https://mirantis.github.io/cri-dockerd/) Official Documentation \* Tripwire: [How Dockershim’s Forthcoming Deprecation Affects Your Kubernetes](https://www.tripwire.com/state-of-security/security-data-protection/cloud/how-dockershim-forthcoming-deprecation-affects-your-kubernetes/) (published 2021/07/01)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes.md
main
kubernetes
[ -0.05329035222530365, 0.0678764283657074, 0.09342090785503387, -0.03111300617456436, 0.0633264109492302, -0.0006181357894092798, -0.031785640865564346, -0.06352078169584274, 0.03616206347942352, 0.03548707440495491, -0.002687067724764347, 0.037667445838451385, -0.02761179953813553, 0.00536...
0.140774
To allow Kubernetes workloads to use swap, on a Linux node, you must disable the kubelet's default behavior of failing when swap is detected, and specify memory-swap behavior as `LimitedSwap`: The available choices for swap behavior are: `NoSwap` : (default) Workloads running as Pods on this node do not and cannot use swap. However, processes outside of Kubernetes' scope, such as system daemons (including the kubelet itself!) \*\*can\*\* utilize swap. This behavior is beneficial for protecting the node from system-level memory spikes, but it does not safeguard the workloads themselves from such spikes. `LimitedSwap` : Kubernetes workloads can utilize swap memory. The amount of swap available to a Pod is determined automatically. To learn more, read [swap memory management](/docs/concepts/cluster-administration/swap-memory-management/).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/swap-behavior.md
main
kubernetes
[ 0.003536291653290391, 0.011398885399103165, 0.06445536762475967, 0.020136181265115738, -0.055964063853025436, 0.03035997785627842, -0.0102797606959939, -0.0027472451329231262, 0.0888541117310524, 0.04135407507419586, -0.06628130376338959, 0.04313581809401512, -0.024195559322834015, -0.0722...
0.195198
This section contains the following reference topics about nodes: \* the kubelet's [checkpoint API](/docs/reference/node/kubelet-checkpoint-api/) \* a list of [Articles on dockershim Removal and on Using CRI-compatible Runtimes](/docs/reference/node/topics-on-dockershim-and-cri-compatible-runtimes/) \* [Kubelet Device Manager API Versions](/docs/reference/node/device-plugin-api-versions) \* [Node Labels Populated By The Kubelet](/docs/reference/node/node-labels) \* [Local Files And Paths Used By The Kubelet](/docs/reference/node/kubelet-files) \* [Node `.status` information](/docs/reference/node/node-status/) \* [Linux Node Swap Behaviors](/docs/reference/node/swap-behavior/) \* [Seccomp information](/docs/reference/node/seccomp/) You can also read node reference details from elsewhere in the Kubernetes documentation, including: \* [Node Metrics Data](/docs/reference/instrumentation/node-metrics). \* [CRI Pod & Container Metrics](/docs/reference/instrumentation/cri-pod-container-metrics). \* [Understand Pressure Stall Information (PSI) Metrics](/docs/reference/instrumentation/understand-psi-metrics).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/node/_index.md
main
kubernetes
[ -0.02419123612344265, 0.04472331330180168, 0.003101019188761711, -0.01829659193754196, 0.033047452569007874, 0.013441755436360836, -0.0053969440050423145, 0.001480640610679984, 0.048352040350437164, -0.02742072008550167, 0.0010200823890045285, -0.04871243238449097, 0.006358481477946043, -0...
0.195738
To report a security issue, please follow the [Kubernetes security disclosure process](/docs/reference/issues-security/security/#report-a-vulnerability). Work on Kubernetes code and public issues are tracked using [GitHub Issues](https://github.com/kubernetes/kubernetes/issues/). \* Official [list of known CVEs](/docs/reference/issues-security/official-cve-feed/) (security vulnerabilities) that have been announced by the [Security Response Committee](https://github.com/kubernetes/committee-security-response) \* [CVE-related GitHub issues](https://github.com/kubernetes/kubernetes/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3Aarea%2Fsecurity+in%3Atitle+CVE) Security-related announcements are sent to the [kubernetes-security-announce@googlegroups.com](https://groups.google.com/forum/#!forum/kubernetes-security-announce) mailing list.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/issues-security/issues.md
main
kubernetes
[ -0.07718038558959961, 0.04583602771162987, -0.0051770820282399654, 0.008313348516821861, 0.055523574352264404, 0.056115493178367615, 0.018179992213845253, -0.03246669843792915, 0.046791817992925644, 0.033315468579530716, 0.015141681768000126, -0.08658338338136673, 0.029593689367175102, -0....
0.109598
{{< feature-state for\_k8s\_version="v1.27" state="beta" >}} This is a community maintained list of official CVEs announced by the Kubernetes Security Response Committee. See [Kubernetes Security and Disclosure Information](/docs/reference/issues-security/security/) for more details. The Kubernetes project publishes a programmatically accessible feed of published security issues in [JSON feed](/docs/reference/issues-security/official-cve-feed/index.json) and [RSS feed](/docs/reference/issues-security/official-cve-feed/feed.xml) formats. You can access it by executing the following commands: {{< tabs name="CVE feeds" >}} {{% tab name="JSON feed" %}} [Link to JSON format](/docs/reference/issues-security/official-cve-feed/index.json) ```shell curl -Lv https://k8s.io/docs/reference/issues-security/official-cve-feed/index.json ``` {{% /tab %}} {{% tab name="RSS feed" %}} [Link to RSS format](/docs/reference/issues-security/official-cve-feed/feed.xml) ```shell curl -Lv https://k8s.io/docs/reference/issues-security/official-cve-feed/feed.xml ``` {{% /tab %}} {{< /tabs >}} {{< cve-feed >}} This feed is auto-refreshing with a noticeable but small lag (minutes to hours) from the time a CVE is announced to the time it is accessible in this feed. The source of truth of this feed is a set of GitHub Issues, filtered by a controlled and restricted label `official-cve-feed`. The raw data is stored in a Google Cloud Bucket which is writable only by a small number of trusted members of the Community.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/issues-security/official-cve-feed.md
main
kubernetes
[ 0.006091792602092028, 0.02594097889959812, -0.033012744039297104, -0.006089044734835625, 0.04509862884879112, 0.06008537858724594, -0.09828083962202072, 0.002898933831602335, 0.031013591215014458, 0.024487502872943878, -0.02890441007912159, -0.030917076393961906, -0.02371969260275364, 0.02...
0.091083
This page describes Kubernetes security and disclosure information. ## Security Announcements Join the [kubernetes-security-announce](https://groups.google.com/forum/#!forum/kubernetes-security-announce) group for emails about security and major API announcements. ## Report a Vulnerability We're extremely grateful for security researchers and users that report vulnerabilities to the Kubernetes Open Source Community. All reports are thoroughly investigated by a set of community volunteers. To make a report, submit your vulnerability to the [Kubernetes bug bounty program](https://hackerone.com/kubernetes). This allows triage and handling of the vulnerability with standardized response times. You can also email the private [security@kubernetes.io](mailto:security@kubernetes.io) list with the security details and the details expected for [all Kubernetes bug reports](https://github.com/kubernetes/kubernetes/blob/master/.github/ISSUE\_TEMPLATE/bug-report.yaml). You may encrypt your email to this list using the GPG keys of the [Security Response Committee members](https://git.k8s.io/security/README.md#product-security-committee-psc). Encryption using GPG is NOT required to make a disclosure. ### When Should I Report a Vulnerability? - You think you discovered a potential security vulnerability in Kubernetes - You are unsure how a vulnerability affects Kubernetes - You think you discovered a vulnerability in another project that Kubernetes depends on - For projects with their own vulnerability reporting and disclosure process, please report it directly there ### When Should I NOT Report a Vulnerability? - You need help tuning Kubernetes components for security - You need help applying security related updates - Your issue is not security related ## Security Vulnerability Response Each report is acknowledged and analyzed by Security Response Committee members within 3 working days. This will set off the [Security Release Process](https://git.k8s.io/security/security-release-process.md#disclosures). Any vulnerability information shared with Security Response Committee stays within Kubernetes project and will not be disseminated to other projects unless it is necessary to get the issue fixed. As the security issue moves from triage, to identified fix, to release planning we will keep the reporter updated. ## Public Disclosure Timing A public disclosure date is negotiated by the Kubernetes Security Response Committee and the bug submitter. We prefer to fully disclose the bug as soon as possible once a user mitigation is available. It is reasonable to delay disclosure when the bug or the fix is not yet fully understood, the solution is not well-tested, or for vendor coordination. The timeframe for disclosure is from immediate (especially if it's already publicly known) to a few weeks. For a vulnerability with a straightforward mitigation, we expect report date to disclosure date to be on the order of 7 days. The Kubernetes Security Response Committee holds the final say when setting a disclosure date.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/issues-security/security.md
main
kubernetes
[ -0.011645644903182983, 0.06845042109489441, 0.01726538874208927, 0.037861328572034836, -0.006912603508681059, 0.025072336196899414, -0.017810503020882607, 0.042387235909700394, 0.04689546674489975, 0.05742881819605827, -0.05733969807624817, -0.0830824077129364, 0.01585829257965088, -0.0189...
0.133226
This page contains a list of commonly used `kubectl` commands and flags. {{< note >}} These instructions are for Kubernetes v{{< skew currentVersion >}}. To check the version, use the `kubectl version` command. {{< /note >}} ## Kubectl autocomplete ### BASH ```bash source <(kubectl completion bash) # set up autocomplete in bash into the current shell, bash-completion package should be installed first. echo "source <(kubectl completion bash)" >> ~/.bashrc # add autocomplete permanently to your bash shell. ``` You can also use a shorthand alias for `kubectl` that also works with completion: ```bash alias k=kubectl complete -o default -F \_\_start\_kubectl k ``` ### ZSH ```bash source <(kubectl completion zsh) # set up autocomplete in zsh into the current shell echo '[[ $commands[kubectl] ]] && source <(kubectl completion zsh)' >> ~/.zshrc # add autocomplete permanently to your zsh shell ``` ### FISH {{< note >}} Requires kubectl version 1.23 or above. {{< /note >}} ```bash echo 'kubectl completion fish | source' > ~/.config/fish/completions/kubectl.fish && source ~/.config/fish/completions/kubectl.fish ``` ### A note on `--all-namespaces` Appending `--all-namespaces` happens frequently enough that you should be aware of the shorthand for `--all-namespaces`: ```kubectl -A``` ## Kubectl context and configuration Set which Kubernetes cluster `kubectl` communicates with and modifies configuration information. See [Authenticating Across Clusters with kubeconfig](/docs/tasks/access-application-cluster/configure-access-multiple-clusters/) documentation for detailed config file information. ```bash kubectl config view # Show Merged kubeconfig settings. # use multiple kubeconfig files at the same time and view merged config KUBECONFIG=~/.kube/config:~/.kube/kubconfig2 kubectl config view # Show merged kubeconfig settings and raw certificate data and exposed secrets kubectl config view --raw # get the password for the e2e user kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}' # get the certificate for the e2e user kubectl config view --raw -o jsonpath='{.users[?(.name == "e2e")].user.client-certificate-data}' | base64 -d kubectl config view -o jsonpath='{.users[].name}' # display the first user kubectl config view -o jsonpath='{.users[\*].name}' # get a list of users kubectl config get-contexts # display list of contexts kubectl config get-contexts -o name # get all context names kubectl config current-context # display the current-context kubectl config use-context my-cluster-name # set the default context to my-cluster-name kubectl config set-cluster my-cluster-name # set a cluster entry in the kubeconfig # configure the URL to a proxy server to use for requests made by this client in the kubeconfig kubectl config set-cluster my-cluster-name --proxy-url=my-proxy-url # add a new user to your kubeconf that supports basic auth kubectl config set-credentials kubeuser/foo.kubernetes.com --username=kubeuser --password=kubepassword # permanently save the namespace for all subsequent kubectl commands in that context. kubectl config set-context --current --namespace=ggckad-s2 # set a context utilizing a specific username and namespace. kubectl config set-context gce --user=cluster-admin --namespace=foo \ && kubectl config use-context gce kubectl config unset users.foo # delete user foo # short alias to set/show context/namespace (only works for bash and bash-compatible shells, current context to be set before using kn to set namespace) alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f' alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f' ``` ## Kubectl apply `apply` manages applications through files defining Kubernetes resources. It creates and updates resources in a cluster through running `kubectl apply`. This is the recommended way of managing Kubernetes applications on production. See [Kubectl Book](https://kubectl.docs.kubernetes.io). ## Creating objects Kubernetes manifests can be defined in YAML or JSON. The file extension `.yaml`, `.yml`, and `.json` can be used. ```bash kubectl apply -f ./my-manifest.yaml # create resource(s) kubectl apply -f ./my1.yaml -f ./my2.yaml # create
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/quick-reference.md
main
kubernetes
[ 0.043268218636512756, 0.010776182636618614, 0.005670685321092606, -0.053196921944618225, 0.02325473353266716, 0.03996364772319794, 0.03380277380347252, -0.0365571454167366, 0.03734900429844856, 0.020108142867684364, -0.039757125079631805, -0.08402733504772186, -0.045420192182064056, 0.0125...
0.095041
the recommended way of managing Kubernetes applications on production. See [Kubectl Book](https://kubectl.docs.kubernetes.io). ## Creating objects Kubernetes manifests can be defined in YAML or JSON. The file extension `.yaml`, `.yml`, and `.json` can be used. ```bash kubectl apply -f ./my-manifest.yaml # create resource(s) kubectl apply -f ./my1.yaml -f ./my2.yaml # create from multiple files kubectl apply -f ./dir # create resource(s) in all manifest files in dir kubectl apply -f https://example.com/manifest.yaml # create resource(s) from url (Note: this is an example domain and does not contain a valid manifest) kubectl create deployment nginx --image=nginx # start a single instance of nginx # create a Job which prints "Hello World" kubectl create job hello --image=busybox:1.28 -- echo "Hello World" # create a CronJob that prints "Hello World" every minute kubectl create cronjob hello --image=busybox:1.28 --schedule="\*/1 \* \* \* \*" -- echo "Hello World" kubectl explain pods # get the documentation for pod manifests # Create multiple YAML objects from stdin kubectl apply -f - < pod.yaml # Generate spec for running pod nginx and write it into a file called pod.yaml kubectl attach my-pod -i # Attach to Running Container kubectl port-forward my-pod 5000:6000 # Listen on port 5000 on the local machine and forward to port 6000 on my-pod kubectl exec my-pod -- ls / # Run command in existing pod (1 container case) kubectl exec --stdin --tty my-pod -- /bin/sh # Interactive shell access to a running pod (1 container case) kubectl exec my-pod -c my-container -- ls / # Run command in existing pod (multi-container case) kubectl debug my-pod -it --image=busybox:1.28 # Create an interactive debugging session within existing pod and immediately attach to it kubectl debug node/my-node -it --image=busybox:1.28 # Create an interactive debugging session on a node and immediately attach to it kubectl top pod # Show metrics for all pods in the default namespace kubectl top pod POD\_NAME --containers # Show metrics for a given pod and its containers kubectl top pod POD\_NAME --sort-by=cpu # Show metrics for a given pod and sort it by 'cpu' or 'memory' ``` ## Copying files and directories to and from containers ```bash kubectl cp /tmp/foo\_dir my-pod:/tmp/bar\_dir # Copy /tmp/foo\_dir local directory to /tmp/bar\_dir in a remote pod in the current namespace kubectl cp /tmp/foo my-pod:/tmp/bar -c my-container # Copy /tmp/foo local file to /tmp/bar in a remote pod in a specific container kubectl cp /tmp/foo my-namespace/my-pod:/tmp/bar # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace my-namespace kubectl cp my-namespace/my-pod:/tmp/foo /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally ``` {{< note >}} `kubectl cp` requires that the 'tar' binary is present in your container image. If 'tar' is not present, `kubectl cp` will fail. For advanced use cases, such as symlinks, wildcard expansion or file mode preservation consider using `kubectl exec`. {{< /note >}} ```bash tar cf - /tmp/foo | kubectl exec -i -n my-namespace my-pod -- tar xf - -C /tmp/bar # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace my-namespace kubectl exec -n my-namespace my-pod -- tar cf - /tmp/foo | tar xf - -C /tmp/bar # Copy /tmp/foo from a remote pod to /tmp/bar locally ``` ## Interacting with Deployments and Services ```bash kubectl logs deploy/my-deployment # dump Pod logs for a Deployment (single-container case) kubectl logs deploy/my-deployment -c my-container # dump Pod logs for a Deployment (multi-container case) kubectl port-forward svc/my-service 5000 # listen on local port 5000 and forward to port 5000 on Service backend kubectl port-forward svc/my-service 5000:my-service-port # listen on local port 5000 and forward to Service target port with name kubectl
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/quick-reference.md
main
kubernetes
[ -0.016166195273399353, -0.00854169949889183, 0.02431662380695343, -0.05440300703048706, -0.023901009932160378, -0.04648049920797348, -0.007678350433707237, 0.013489320874214172, 0.06713244318962097, 0.02991716004908085, -0.030536647886037827, -0.07103846967220306, 0.015419308096170425, -0....
0.085288
logs deploy/my-deployment -c my-container # dump Pod logs for a Deployment (multi-container case) kubectl port-forward svc/my-service 5000 # listen on local port 5000 and forward to port 5000 on Service backend kubectl port-forward svc/my-service 5000:my-service-port # listen on local port 5000 and forward to Service target port with name kubectl port-forward deploy/my-deployment 5000:6000 # listen on local port 5000 and forward to port 6000 on a Pod created by kubectl exec deploy/my-deployment -- ls # run command in first Pod and first container in Deployment (single- or multi-container cases) ``` ## Interacting with Nodes and cluster ```bash kubectl cordon my-node # Mark my-node as unschedulable kubectl drain my-node # Drain my-node in preparation for maintenance kubectl uncordon my-node # Mark my-node as schedulable kubectl top node # Show metrics for all nodes kubectl top node my-node # Show metrics for a given node kubectl cluster-info # Display addresses of the master and services kubectl cluster-info dump # Dump current cluster state to stdout kubectl cluster-info dump --output-directory=/path/to/cluster-state # Dump current cluster state to /path/to/cluster-state # View existing taints on which exist on current nodes. kubectl get nodes -o='custom-columns=NodeName:.metadata.name,TaintKey:.spec.taints[\*].key,TaintValue:.spec.taints[\*].value,TaintEffect:.spec.taints[\*].effect' # If a taint with that key and effect already exists, its value is replaced as specified. kubectl taint nodes foo dedicated=special-user:NoSchedule ``` ### Resource types List all supported resource types along with their shortnames, [API group](/docs/concepts/overview/kubernetes-api/#api-groups-and-versioning), whether they are [namespaced](/docs/concepts/overview/working-with-objects/namespaces), and [kind](/docs/concepts/overview/working-with-objects/): ```bash kubectl api-resources ``` Other operations for exploring API resources: ```bash kubectl api-resources --namespaced=true # All namespaced resources kubectl api-resources --namespaced=false # All non-namespaced resources kubectl api-resources -o name # All resources with simple output (only the resource name) kubectl api-resources -o wide # All resources with expanded (aka "wide") output kubectl api-resources --verbs=list,get # All resources that support the "list" and "get" request verbs kubectl api-resources --api-group=extensions # All resources in the "extensions" API group ``` ### Formatting output To output details to your terminal window in a specific format, add the `-o` (or `--output`) flag to a supported `kubectl` command. Output format | Description --------------| ----------- `-o=custom-columns=` | Print a table using a comma separated list of custom columns `-o=custom-columns-file=` | Print a table using the custom columns template in the `` file `-o=go-template=` | Print the fields defined in a [golang template](https://pkg.go.dev/text/template) `-o=go-template-file=` | Print the fields defined by the [golang template](https://pkg.go.dev/text/template) in the `` file `-o=json` | Output a JSON formatted API object `-o=jsonpath=` | Print the fields defined in a [jsonpath](/docs/reference/kubectl/jsonpath) expression `-o=jsonpath-file=` | Print the fields defined by the [jsonpath](/docs/reference/kubectl/jsonpath) expression in the `` file `-o=kyaml` (beta) | Output a [KYAML](/docs/reference/encodings/kyaml) formatted API object. KYAML is an Kubernetes-specific dialect of YAML, and can be parsed as YAML. `-o=name` | Print only the resource name and nothing else `-o=wide` | Output in the plain-text format with any additional information, and for pods, the node name is included `-o=yaml` | Output a YAML formatted API object Examples using `-o=custom-columns`: ```bash # All images running in a cluster kubectl get pods -A -o=custom-columns='DATA:spec.containers[\*].image' # All images running in namespace: default, grouped by Pod kubectl get pods --namespace default --output=custom-columns="NAME:.metadata.name,IMAGE:.spec.containers[\*].image" # All images excluding "registry.k8s.io/coredns:1.6.2" kubectl get pods -A -o=custom-columns='DATA:spec.containers[?(@.image!="registry.k8s.io/coredns:1.6.2")].image' # All fields under metadata regardless of name kubectl get pods -A -o=custom-columns='DATA:metadata.\*' ``` More examples in the kubectl [reference documentation](/docs/reference/kubectl/#custom-columns). ### Kubectl output verbosity and debugging Kubectl verbosity is controlled with the `-v` or `--v` flags followed by an integer representing the log level. General Kubernetes logging conventions and the associated log levels are described [here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md). Verbosity | Description --------------| ----------- `--v=0` | Generally useful for this to \*always\* be visible to a cluster operator. `--v=1`
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/quick-reference.md
main
kubernetes
[ 0.04079142585396767, 0.0011020335368812084, 0.021187996491789818, -0.013118935748934746, 0.00954512320458889, -0.06437362730503082, 0.015457983128726482, -0.012374349869787693, 0.05275093764066696, 0.05729569494724274, -0.038037803024053574, -0.08436692506074905, -0.004918672144412994, -0....
0.112898
Kubectl verbosity is controlled with the `-v` or `--v` flags followed by an integer representing the log level. General Kubernetes logging conventions and the associated log levels are described [here](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-instrumentation/logging.md). Verbosity | Description --------------| ----------- `--v=0` | Generally useful for this to \*always\* be visible to a cluster operator. `--v=1` | A reasonable default log level if you don't want verbosity. `--v=2` | Useful steady state information about the service and important log messages that may correlate to significant changes in the system. This is the recommended default log level for most systems. `--v=3` | Extended information about changes. `--v=4` | Debug level verbosity. `--v=5` | Trace level verbosity. `--v=6` | Display requested resources. `--v=7` | Display HTTP request headers. `--v=8` | Display HTTP request contents. `--v=9` | Display HTTP request contents without truncation of contents. ## {{% heading "whatsnext" %}} \* Read the [kubectl overview](/docs/reference/kubectl/) and learn about [JsonPath](/docs/reference/kubectl/jsonpath). \* See [kubectl](/docs/reference/kubectl/kubectl/) options. \* See [kuberc](/docs/reference/kubectl/kuberc) options. \* Also read [kubectl Usage Conventions](/docs/reference/kubectl/conventions/) to understand how to use kubectl in reusable scripts. \* See more community [kubectl cheatsheets](https://github.com/dennyzhang/cheatsheet-kubernetes-A4).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/quick-reference.md
main
kubernetes
[ 0.05446876212954521, 0.0077504441142082214, 0.04573964700102806, 0.016272835433483124, 0.005658091977238655, -0.023880213499069214, 0.0042004454880952835, -0.02667856216430664, 0.048518553376197815, 0.029366450384259224, -0.05567043647170067, -0.11186837404966354, -0.013384383171796799, -0...
0.155784
Recommended usage conventions for `kubectl`. ## Using `kubectl` in Reusable Scripts For a stable output in a script: \* Request one of the machine-oriented output forms, such as `-o name`, `-o json`, `-o yaml`, `-o go-template`, or `-o jsonpath`. \* Fully-qualify the version. For example, `jobs.v1.batch/myjob`. This will ensure that kubectl does not use its default version that can change over time. \* Don't rely on context, preferences, or other implicit states. ## Subresources \* You can use the `--subresource` argument for kubectl subcommands such as `get`, `patch`, `edit`, `apply` and `replace` to fetch and update subresources for all resources that support them. In Kubernetes version {{< skew currentVersion >}}, only the `status`, `scale` and `resize` subresources are supported. \* For `kubectl edit`, the `scale` subresource is not supported. If you use `--subresource` with `kubectl edit` and specify `scale` as the subresource, the command will error out. \* The API contract against a subresource is identical to a full resource. While updating the `status` subresource to a new value, keep in mind that the subresource could be potentially reconciled by a controller to a different value. ## Best Practices ### `kubectl run` For `kubectl run` to satisfy infrastructure as code: \* Tag the image with a version-specific tag and don't move that tag to a new version. For example, use `:v1234`, `v1.2.3`, `r03062016-1-4`, rather than `:latest` (For more information, see [Kubernetes Configuration Good Practices](/blog/2025/11/25/configuration-good-practices/)). \* Check in the script for an image that is heavily parameterized. \* Switch to configuration files checked into source control for features that are needed, but not expressible via `kubectl run` flags. You can use the `--dry-run=client` flag to preview the object that would be sent to your cluster, without really submitting it. ### `kubectl apply` \* You can use `kubectl apply` to create or update resources. For more information about using kubectl apply to update resources, see [Kubectl Book](https://kubectl.docs.kubernetes.io).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/conventions.md
main
kubernetes
[ -0.048093147575855255, 0.001628572354093194, 0.025704016909003258, -0.036735303699970245, -0.0368073396384716, 0.03132571280002594, -0.047815848141908646, -0.009051931090652943, 0.03587707504630089, -0.0007965054828673601, -0.05243127793073654, -0.052260417491197586, -0.03737146034836769, ...
0.1006
The {{< glossary\_tooltip term\_id="kubectl" text="kubectl" >}} tool supports JSONPath templates as an output format. A \_JSONPath template\_ is composed of JSONPath expressions enclosed by curly braces: `{` and `}`. Kubectl uses JSONPath expressions to filter on specific fields in the JSON object and format the output. In addition to the original JSONPath template syntax, the following functions and syntax are valid: 1. Use double quotes to quote text inside JSONPath expressions. 2. Use the `range`, `end` operators to iterate lists. 3. Use negative slice indices to step backwards through a list. Negative indices do \_not\_ "wrap around" a list and are valid as long as \\( ( - index + listLength ) \ge 0 \\). {{< note >}} - The `$` operator is optional since the expression always starts from the root object by default. - The result object is printed as its `String()` function. {{< /note >}} ## Functions in Kubernetes JSONPath {#functions} Given the JSON input: ```json { "kind": "List", "items":[ { "kind":"None", "metadata":{ "name":"127.0.0.1", "labels":{ "kubernetes.io/hostname":"127.0.0.1" } }, "status":{ "capacity":{"cpu":"4"}, "addresses":[{"type": "LegacyHostIP", "address":"127.0.0.1"}] } }, { "kind":"None", "metadata":{"name":"127.0.0.2"}, "status":{ "capacity":{"cpu":"8"}, "addresses":[ {"type": "LegacyHostIP", "address":"127.0.0.2"}, {"type": "another", "address":"127.0.0.3"} ] } } ], "users":[ { "name": "myself", "user": {} }, { "name": "e2e", "user": {"username": "admin", "password": "secret"} } ] } ``` {{< table caption="Functions, their parameters, an example invocation, and the result" >}} Function | Description | Example | Result --------------------|------------------------------|-----------------------------------------------------------------|------------------ `text` | the plain text | `kind is {.kind}` | `kind is List` `@` | the current object | `{@}` | the same as input `.` or `[]` | child operator | `{.kind}`, `{['kind']}` or `{['name\.type']}` | `List` `..` | recursive descent | `{..name}` | `127.0.0.1 127.0.0.2 myself e2e` `\*` | wildcard. Get all objects | `{.items[\*].metadata.name}` | `[127.0.0.1 127.0.0.2]` `[start:end:step]` | subscript operator | `{.users[0].name}` | `myself` `[,]` | union operator | `{.items[\*]['metadata.name', 'status.capacity']}` | `127.0.0.1 127.0.0.2 map[cpu:4] map[cpu:8]` `?()` | filter | `{.users[?(@.name=="e2e")].user.password}` | `secret` `range`, `end` | iterate list | `{range .items[\*]}[{.metadata.name}, {.status.capacity}] {end}` | `[127.0.0.1, map[cpu:4]] [127.0.0.2, map[cpu:8]]` `''` | quote interpreted string | `{range .items[\*]}{.metadata.name}{'\t'}{end}` | `127.0.0.1 127.0.0.2` `\` | escape termination character | `{.items[0].metadata.labels.kubernetes\.io/hostname}` | `127.0.0.1` {{< /table >}} ## Using JSONPath expressions with kubectl {#use-with-kubectl} Examples using `kubectl` and JSONPath expressions: ```shell kubectl get pods -o json kubectl get pods -o=jsonpath='{@}' kubectl get pods -o=jsonpath='{.items[0]}' kubectl get pods -o=jsonpath='{.items[0].metadata.name}' kubectl get pods -o=jsonpath="{.items[\*]['metadata.name', 'status.capacity']}" kubectl get pods -o=jsonpath='{range .items[\*]}{.metadata.name}{"\t"}{.status.startTime}{"\n"}{end}' kubectl get pods -o=jsonpath='{.items[0].metadata.labels.kubernetes\.io/hostname}' ``` Or, with a "my\_pod" and "my\_namespace" (adjust these names to your environment): ```shell kubectl get pod/my\_pod -n my\_namespace -o=jsonpath='{@}' kubectl get pod/my\_pod -n my\_namespace -o=jsonpath='{.metadata.name}' kubectl get pod/my\_pod -n my\_namespace -o=jsonpath='{.status}' ``` {{< note >}} On Windows, you must \_double\_ quote any JSONPath template that contains spaces (not single quote as shown above for bash). This in turn means that you must use a single quote or escaped double quote around any literals in the template. For example: ```cmd kubectl get pods -o=jsonpath="{range .items[\*]}{.metadata.name}{'\t'}{.status.startTime}{'\n'}{end}" kubectl get pods -o=jsonpath="{range .items[\*]}{.metadata.name}{\"\t\"}{.status.startTime}{\"\n\"}{end}" ``` {{< /note >}} ## Regular expressions in JSONPath JSONPath regular expressions are not supported. If you want to match using regular expressions, you can use a tool such as `jq`. ```shell # kubectl does not support regular expressions for JSONpath output # The following command does not work kubectl get pods -o jsonpath='{.items[?(@.metadata.name=~/^test$/)].metadata.name}' # The following command achieves the desired result kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).metadata.name' ```
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/jsonpath.md
main
kubernetes
[ -0.07530419528484344, 0.09855469316244125, 0.08380494266748428, -0.004978757817298174, -0.0535488985478878, -0.021970439702272415, 0.04233740270137787, -0.04030986130237579, 0.10326746106147766, -0.03451379016041756, 0.01913323812186718, -0.09207270294427872, -0.03523017838597298, -0.00140...
0.044811
command achieves the desired result kubectl get pods -o json | jq -r '.items[] | select(.metadata.name | test("test-")).metadata.name' ```
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/jsonpath.md
main
kubernetes
[ 0.050963498651981354, 0.08338465541601181, 0.03532012552022934, 0.03803979977965355, -0.05954394489526749, -0.013819342479109764, 0.018027272075414658, 0.015068062581121922, 0.07366687804460526, -0.003840571967884898, 0.01300962083041668, -0.10060600191354752, -0.0176117904484272, -0.03096...
0.074473
## {{% heading "synopsis" %}} kubectl controls the Kubernetes cluster manager. Find more information in [Command line tool](/docs/reference/kubectl/) (`kubectl`). ```shell kubectl [flags] ``` ## {{% heading "options" %}} | --add-dir-header | | | --- | --- | | | If true, adds the file directory to the header of the log messages | | --alsologtostderr | | | | log to standard error as well as files | | --as string | | | | Username to impersonate for the operation | | --as-group stringArray | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --azure-container-registry-config string | | | | Path to the file containing Azure container registry configuration information. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cloud-provider-gce-l7lb-src-cidrs cidrs Default: 130.211.0.0/22,35.191.0.0/16 | | | | CIDRs opened in GCE firewall for L7 LB traffic proxy & health checks | | --cloud-provider-gce-lb-src-cidrs cidrs Default: 130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16 | | | | CIDRs opened in GCE firewall for L4 LB traffic proxy & health checks | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --default-not-ready-toleration-seconds int Default: 300 | | | | Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration. | | --default-unreachable-toleration-seconds int Default: 300 | | | | Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration. | | -h, --help | | | | help for kubectl | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --log-backtrace-at traceLocation Default: :0 | | | | when logging hits line file:N, emit a stack trace | | --log-dir string | | | | If non-empty, write log files in this directory | | --log-file string | | | | If non-empty, use this log file | | --log-file-max-size uint Default: 1800 | | | | Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. | | --log-flush-frequency duration Default: 5s | | | | Maximum number of seconds between log flushes | | --logtostderr Default: true | | | | log to standard error instead of files | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --one-output | | | | If true, only write logs to their native severity level (vs also writing to each lower severity level) | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) | | --profile-output string Default: "profile.pprof" | | |
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kubectl.md
main
kubernetes
[ 0.04809900000691414, 0.049897465854883194, -0.009291194379329681, 0.06569793075323105, -0.004400002770125866, 0.03122478350996971, 0.09416994452476501, -0.033922940492630005, 0.06969047337770462, 0.11740782111883163, -0.0035464351531118155, -0.1201171800494194, 0.03662540018558502, 0.03079...
0.079218
also writing to each lower severity level) | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --skip-headers | | | | If true, avoid header prefixes in the log messages | | --skip-log-headers | | | | If true, avoid headers when opening log files | | --stderrthreshold severity Default: 2 | | | | logs at or above this threshold go to stderr | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | -v, --v Level | | | | number for the log level verbosity | | --version version[=true] | | | | Print version information and quit | | --vmodule moduleSpec | | | | comma-separated list of pattern=N settings for file-filtered logging | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "envvars" %}} | KUBECONFIG | | | --- | --- | | | Path to the kubectl configuration ("kubeconfig") file. Default: "$HOME/.kube/config" | | KUBECTL\_EXPLAIN\_OPENAPIV3 | | | | Toggles whether calls to `kubectl explain` use the new OpenAPIv3 data source available. OpenAPIV3 is enabled by default since Kubernetes 1.24. | | KUBECTL\_ENABLE\_CMD\_SHADOW | | | | When set to true, external plugins can be used as subcommands for builtin commands if subcommand does not exist. In alpha stage, this feature can only be used for create command(e.g. kubectl create networkpolicy). | | KUBECTL\_PORT\_FORWARD\_WEBSOCKETS | | | | When set to true, the kubectl port-forward command will attempt to stream using the websockets protocol. If the upgrade to websockets fails, the commands will fallback to use the current SPDY protocol. | | KUBECTL\_REMOTE\_COMMAND\_WEBSOCKETS | | | | When set to true, the kubectl exec, cp, and attach commands will attempt to stream using the websockets protocol. If the upgrade to websockets fails, the commands will fallback to use the current SPDY protocol. | | KUBECTL\_KUBERC | | | | When set to true, kuberc file is taken into account to define user specific preferences. | | KUBECTL\_KYAML | | | | When set to true, kubectl is capable of producing Kubernetes-specific dialect of YAML output format. | ## {{% heading "seealso" %}} \* [kubectl annotate](/docs/reference/kubectl/generated/kubectl\_annotate/) - Update the annotations on a resource \* [kubectl api-resources](/docs/reference/kubectl/generated/kubectl\_api-resources/) - Print the supported API resources on the server \* [kubectl api-versions](/docs/reference/kubectl/generated/kubectl\_api-versions/) - Print the supported API versions on the server, in the form of "group/version" \* [kubectl apply](/docs/reference/kubectl/generated/kubectl\_apply/) - Apply a configuration to a resource by filename or stdin \* [kubectl attach](/docs/reference/kubectl/generated/kubectl\_attach/) - Attach
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kubectl.md
main
kubernetes
[ 0.026513665914535522, 0.0432792566716671, -0.037508536130189896, 0.011557726189494133, -0.06643877923488617, 0.0022895624861121178, -0.0435580350458622, 0.0570012591779232, 0.08146706968545914, 0.011722426861524582, -0.018327046185731888, -0.07637876272201538, 0.0458686538040638, -0.039221...
0.089804
a resource \* [kubectl api-resources](/docs/reference/kubectl/generated/kubectl\_api-resources/) - Print the supported API resources on the server \* [kubectl api-versions](/docs/reference/kubectl/generated/kubectl\_api-versions/) - Print the supported API versions on the server, in the form of "group/version" \* [kubectl apply](/docs/reference/kubectl/generated/kubectl\_apply/) - Apply a configuration to a resource by filename or stdin \* [kubectl attach](/docs/reference/kubectl/generated/kubectl\_attach/) - Attach to a running container \* [kubectl auth](/docs/reference/kubectl/generated/kubectl\_auth/) - Inspect authorization \* [kubectl autoscale](/docs/reference/kubectl/generated/kubectl\_autoscale/) - Auto-scale a Deployment, ReplicaSet, or ReplicationController \* [kubectl certificate](/docs/reference/kubectl/generated/kubectl\_certificate/) - Modify certificate resources. \* [kubectl cluster-info](/docs/reference/kubectl/generated/kubectl\_cluster-info/) - Display cluster info \* [kubectl completion](/docs/reference/kubectl/generated/kubectl\_completion/) - Output shell completion code for the specified shell (bash or zsh) \* [kubectl config](/docs/reference/kubectl/generated/kubectl\_config/) - Modify kubeconfig files \* [kubectl cordon](/docs/reference/kubectl/generated/kubectl\_cordon/) - Mark node as unschedulable \* [kubectl cp](/docs/reference/kubectl/generated/kubectl\_cp/) - Copy files and directories to and from containers. \* [kubectl create](/docs/reference/kubectl/generated/kubectl\_create/) - Create a resource from a file or from stdin. \* [kubectl debug](/docs/reference/kubectl/generated/kubectl\_debug/) - Create debugging sessions for troubleshooting workloads and nodes \* [kubectl delete](/docs/reference/kubectl/generated/kubectl\_delete/) - Delete resources by filenames, stdin, resources and names, or by resources and label selector \* [kubectl describe](/docs/reference/kubectl/generated/kubectl\_describe/) - Show details of a specific resource or group of resources \* [kubectl diff](/docs/reference/kubectl/generated/kubectl\_diff/) - Diff live version against would-be applied version \* [kubectl drain](/docs/reference/kubectl/generated/kubectl\_drain/) - Drain node in preparation for maintenance \* [kubectl edit](/docs/reference/kubectl/generated/kubectl\_edit/) - Edit a resource on the server \* [kubectl events](/docs/reference/kubectl/generated/kubectl\_events/) - List events \* [kubectl exec](/docs/reference/kubectl/generated/kubectl\_exec/) - Execute a command in a container \* [kubectl explain](/docs/reference/kubectl/generated/kubectl\_explain/) - Documentation of resources \* [kubectl expose](/docs/reference/kubectl/generated/kubectl\_expose/) - Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service \* [kubectl get](/docs/reference/kubectl/generated/kubectl\_get/) - Display one or many resources \* [kubectl kustomize](/docs/reference/kubectl/generated/kubectl\_kustomize/) - Build a kustomization target from a directory or a remote url. \* [kubectl label](/docs/reference/kubectl/generated/kubectl\_label/) - Update the labels on a resource \* [kubectl logs](/docs/reference/kubectl/generated/kubectl\_logs/) - Print the logs for a container in a pod \* [kubectl options](/docs/reference/kubectl/generated/kubectl\_options/) - Print the list of flags inherited by all commands \* [kubectl patch](/docs/reference/kubectl/generated/kubectl\_patch/) - Update field(s) of a resource \* [kubectl plugin](/docs/reference/kubectl/generated/kubectl\_plugin/) - Provides utilities for interacting with plugins. \* [kubectl port-forward](/docs/reference/kubectl/generated/kubectl\_port-forward/) - Forward one or more local ports to a pod \* [kubectl proxy](/docs/reference/kubectl/generated/kubectl\_proxy/) - Run a proxy to the Kubernetes API server \* [kubectl replace](/docs/reference/kubectl/generated/kubectl\_replace/) - Replace a resource by filename or stdin \* [kubectl rollout](/docs/reference/kubectl/generated/kubectl\_rollout/) - Manage the rollout of a resource \* [kubectl run](/docs/reference/kubectl/generated/kubectl\_run/) - Run a particular image on the cluster \* [kubectl scale](/docs/reference/kubectl/generated/kubectl\_scale/) - Set a new size for a Deployment, ReplicaSet or Replication Controller \* [kubectl set](/docs/reference/kubectl/generated/kubectl\_set/) - Set specific features on objects \* [kubectl taint](/docs/reference/kubectl/generated/kubectl\_taint/) - Update the taints on one or more nodes \* [kubectl top](/docs/reference/kubectl/generated/kubectl\_top/) - Display Resource (CPU/Memory/Storage) usage. \* [kubectl uncordon](/docs/reference/kubectl/generated/kubectl\_uncordon/) - Mark node as schedulable \* [kubectl version](/docs/reference/kubectl/generated/kubectl\_version/) - Print the client and server version information \* [kubectl wait](/docs/reference/kubectl/generated/kubectl\_wait/) - Experimental: Wait for a specific condition on one or many resources.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kubectl.md
main
kubernetes
[ 0.019377483054995537, 0.04487667232751846, 0.02373933419585228, -0.029403964057564735, -0.012362468987703323, -0.01376655325293541, -0.0519663505256176, -0.04240122810006142, 0.012990322895348072, -0.03825635090470314, -0.009975159540772438, -0.09357450157403946, -0.017587516456842422, -0....
0.097096
kubectl is the Kubernetes cli version of a swiss army knife, and can do many things. While this Book is focused on using kubectl to declaratively manage applications in Kubernetes, it also covers other kubectl functions. ## Command Families Most kubectl commands typically fall into one of a few categories: | Type | Used For | Description | |----------------------------------------|----------------------------|----------------------------------------------------| | Declarative Resource Management | Deployment and operations (e.g. GitOps) | Declaratively manage Kubernetes workloads using resource configuration | | Imperative Resource Management | Development Only | Run commands to manage Kubernetes workloads using Command Line arguments and flags | | Printing Workload State | Debugging | Print information about workloads | | Interacting with Containers | Debugging | Exec, attach, cp, logs | | Cluster Management | Cluster operations | Drain and cordon Nodes | ## Declarative Application Management The preferred approach for managing resources is through declarative files called resource configuration used with the kubectl \*Apply\* command. This command reads a local (or remote) file structure and modifies cluster state to reflect the declared intent. {{< alert color="success" title="Apply" >}} Apply is the preferred mechanism for managing resources in a Kubernetes cluster. {{< /alert >}} ## Printing State about Workloads Users will need to view workload state. - Printing summarize state and information about resources - Printing complete state and information about resources - Printing specific fields from resources - Query resources matching labels ## Debugging Workloads kubectl supports debugging by providing commands for: - Printing Container logs - Printing cluster events - Exec or attaching to a Container - Copying files from Containers in the cluster to a user's filesystem ## Cluster Management On occasion, users may need to perform operations to the Nodes of cluster. kubectl supports commands to drain workloads from a Node so that it can be decommissioned or debugged. ## Porcelain Users may find using resource configuration overly verbose for \*development\* and prefer to work with the cluster \*imperatively\* with a shell-like workflow. kubectl offers porcelain commands for generating and modifying resources. - Generating + creating resources such as Deployments, StatefulSets, Services, ConfigMaps, etc. - Setting fields on resources - Editing (live) resources in a text editor {{< alert color="warning" title="Porcelain for Dev Only" >}} Porcelain commands are time saving for experimenting with workloads in a dev cluster, but shouldn't be used for production. {{< /alert >}}
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/introduction.md
main
kubernetes
[ -0.012522965669631958, 0.018983447924256325, 0.02129399962723255, -0.014497018419206142, -0.03021923080086708, -0.05469372123479843, 0.017616918310523033, -0.04569442942738533, 0.05411776155233383, 0.04278094694018364, -0.017010843381285667, -0.040824130177497864, 0.016544686630368233, -0....
0.238532
{{< feature-state state="beta" for\_k8s\_version="1.34" >}} A Kubernetes `kuberc` configuration file allows you to define preferences for {{}}, such as default options and command aliases. Unlike the kubeconfig file, a `kuberc` configuration file does \*\*not\*\* contain cluster details, usernames or passwords. On Linux / POSIX computers, the default location of this configuration file is `$HOME/.kube/kuberc`. The default path on Windows is similar: `%USERPROFILE%\.kube\kuberc`. To provide kubectl with a path to a custom kuberc file, use the `--kuberc` command line option, or set the `KUBERC` environment variable. A `kuberc` using the `kubectl.config.k8s.io/v1beta1` format allows you to define the following types of user preferences: 1. [Aliases](#aliases) - allow you to create shorter versions of your favorite commands, optionally setting options and arguments. 2. [Defaults](#defaults) - allow you to configure default option values for your favorite commands. 3. [Credential Plugin Policy](#credential-plugin-policy) - allow you to configure a policy for exec credential plugins. ## aliases Within a `kuberc` configuration, the \_aliases\_ section allows you to define custom shortcuts for kubectl commands, optionally with preset command line arguments and flags. This next example defines a `kubectl getn` alias for the `kubectl get` subcommand, additionally specifying JSON output format: `--output=json`. ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference aliases: - name: getn command: get options: - name: output default: json ``` In this example, the following settings were used: 1. `name` - Alias name must not collide with the built-in commands. 1. `command` - Specify the underlying built-in command that your alias will execute. This includes support for subcommands like `create role`. 1. `options` - Specify default values for options. If you explicitly specify an option when you run `kubectl`, the value you provide takes precedence over the default one defined in `kuberc`. With this alias, running `kubectl getn pods` will default JSON output. However, if you execute `kubectl getn pods -oyaml`, the output will be in YAML format. Full `kuberc` schema is available [here](/docs/reference/config-api/kuberc.v1beta1/). ### prependArgs This next example, will expand the previous one, introducing `prependArgs` section, which allows inserting arbitrary arguments immediately after the kubectl command and its subcommand (if any). ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference aliases: - name: getn command: get options: - name: output default: json prependArgs: - namespace ``` In this example, the following settings were used: 1. `name` - Alias name must not collide with the built-in commands. 1. `command` - Specify the underlying built-in command that your alias will execute. This includes support for subcommands like `create role`. 1. `options` - Specify default values for options. If you explicitly specify an option when you run `kubectl`, the value you provide takes precedence over the default one defined in `kuberc`. 1. `prependArgs` - Specify explicit argument that will be placed right after the command. Here, this will be translated to `kubectl get namespace test-ns --output json`. ### appendArgs This next example, will introduce a mechanism similar to prepending arguments, this time, though, we will append arguments to the end of the kubectl command. ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference aliases: - name: runx command: run options: - name: image default: busybox - name: namespace default: test-ns appendArgs: - -- - custom-arg ``` In this example, the following settings were used: 1. `name` - Alias name must not collide with the built-in commands. 1. `command` - Specify the underlying built-in command that your alias will execute. This includes support for subcommands like `create role`. 1. `options` - Specify default values for options. If you explicitly specify an option when you run `kubectl`, the value you provide takes precedence over the default one defined in `kuberc`. 1. `appendArgs` - Specify explicit arguments that will be placed at
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kuberc.md
main
kubernetes
[ 0.05295945703983307, -0.009402081370353699, 0.008866854012012482, 0.028829624876379967, -0.05385530740022659, 0.07266493886709213, -0.008318907581269741, 0.02677222527563572, 0.048616282641887665, 0.025043509900569916, -0.037795230746269226, -0.06658920645713806, -0.05606298893690109, -0.0...
0.10692
This includes support for subcommands like `create role`. 1. `options` - Specify default values for options. If you explicitly specify an option when you run `kubectl`, the value you provide takes precedence over the default one defined in `kuberc`. 1. `appendArgs` - Specify explicit arguments that will be placed at the end of the command. Here, this will be translated to `kubectl run test-pod --namespace test-ns --image busybox -- custom-arg`. ## defaults Within a `kuberc` configuration, `defaults` section lets you specify default values for command line arguments. This next example makes the interactive removal the default mode for invoking `kubectl delete`: ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference defaults: - command: delete options: - name: interactive default: "true" ``` In this example, the following settings were used: 1. `command` - Built-in command, this includes support for subcommands like `create role`. 1. `options` - Specify default values for options. If you explicitly specify an option when you run `kubectl`, the value you provide takes precedence over the default one defined in `kuberc`. With this setting, running `kubectl delete pod/test-pod` will default to prompting for confirmation. However, `kubectl delete pod/test-pod --interactive=false` will bypass the confirmation. ## Credential plugin policy {{< feature-state for\_k8s\_version="v1.35" state="beta" >}} Editors of a `kubeconfig` can specify an executable plugin that will be used to acquire credentials to authenticate the client to the cluster. Within a `kuberc` confguration, you can set the execution policy for such plugins by the use of two top-level fields. Both fields are optional. ### credentialPluginPolicy You can configure a policy for credentials plugins, using the optional `credentialPluginPolicy` field. There are three valid values for this field: 1. `"AllowAll"` When the policy is set to `"AllowAll"`, there will be no restrictions on which plugins may run. This behavior is identical to that of Kubernetes versions prior to 1.35. 2. `"DenyAll"` When the policy is set to `"DenyAll"`, no exec plugins will be permitted to run. 3. `"Allowlist"` When the policy is set to `"Allowlist"`, the user can selectively allow execution of credential plugins. When the policy is `"Allowlist"`, you \*\*must\*\* also provide the `credentialPluginAllowlist` field (also in the top-level). That field is described below. {{< note >}} In order to maintain backward compatibility, an unspecified or empty `credentialPluginPolicy` is identical to explicitly setting the policy to `"AllowAll"`. {{< /note >}} ### credentialPluginAllowlist {{< note >}} Setting this field when `credentialPluginPolicy` is not `Allowlist` (including when that field is missing or empty) is considered a configuration error. {{< /note >}} The `credentialPluginAllowlist` field specifies a list of criteria-sets (sets of \*requirements\*) for permission to execute credential plugins. Each set of requirements will be attempted in turn; once the plugin meets all requirements in at least one set, the plugin will be permitted to execute. That is, the overall result of an application of the allowlist to plugin `my-binary-plugin` is the \_logical OR\_ of the decisions rendered by each item in the list. As an example, consider the following allowlist configuration: ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference credentialPluginPolicy: Allowlist credentialPluginAllowlist: - name: foo - name: bar - name: baz ``` In the above example, the allowlist will allow plugins that have the name "foo", "bar", \_OR\_ "baz". {{< note >}} For a set of requirements to be valid it \*\*must\*\* have at least one field that is nonempty and explicitly specified. If all fields are empty or unspecified, it is considered a configuration error and the plugin will not be allowed to execute. Likewise if the `credentialPluginAllowlist` field is unspecified, or if it is specified explicitly as the empty list. This is in order to prevent scenarios where the user
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kuberc.md
main
kubernetes
[ 0.02608920820057392, -0.020095575600862503, 0.019349049776792526, 0.0490778312087059, -0.06503234803676605, -0.03499095141887665, 0.0029094619676470757, -0.015513129532337189, 0.06638234853744507, 0.030144663527607918, 0.008740796707570553, -0.08200515806674957, -0.021092412993311882, 0.01...
0.113461
specified. If all fields are empty or unspecified, it is considered a configuration error and the plugin will not be allowed to execute. Likewise if the `credentialPluginAllowlist` field is unspecified, or if it is specified explicitly as the empty list. This is in order to prevent scenarios where the user misspells the `credentialPluginAllowlist` key -- thinking they have specified an allowlist when they actually haven't. For example, the following is invalid: ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference credentialPluginPolicy: Allowlist credentialPluginAllowlist: - name: "" ``` {{< /note >}} ##### name `name` names a credential plugin which may be executed. It can be specified as either the basename of the desired plugin, or the full path. If specified as a basename, the decision rendered by this field is "allow" if one of the following two conditions is met: 1. The `name` field is exactly equal to the plugin's `command` field. 1. Full path resolution is performed on both the `name` and the `command`, and the results are equal. If specified as a full path, the decision rendered by this field is "allow" if one of the following conditions is met: 1. The `name` field is exactly equal to the plugin's `command` field (i.e. the `command` is also a full path). 1. Full path resolution is performed on the `command` and the `name` field is an exact match. With regard to \_full path resolution\_ mentioned earlier in this page, neither symlinks nor shell globs are resolved. For example, consider an allowlist entry with the `name` `/usr/local/bin/my-binary`, where `/usr/local/bin/my-binary` is a symlink to `/this/is/a/target`. If `command` specified in the kubeconfig is `/this/is/a/target`, it will not be allowed. In order to make that work, you would need to add `/this/is/a/target` to the allowlist explicitly. On the other hand, if the kubeconfig has the `command` as `/usr/local/bin/my-binary`, then the allowlist would permit it to run. ### Example {#credential-plugin-policy-example} The following example shows an `"Allowlist"` policy with its allowlist: {{< tabs name="tab\_with\_code" >}} {{< tab name="POSIX" codelang="yaml" >}} apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference credentialPluginPolicy: Allowlist credentialPluginAllowlist: - name: my-trusted-binary - name: /usr/local/bin/my-other-trusted-binary {{< /tab >}} {{< tab name="Windows" codelang="yaml" >}} apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference credentialPluginPolicy: Allowlist credentialPluginAllowlist: - name: my-trusted-binary - name: "C:\my-other-trusted-binary" {{< /tab >}} {{< /tabs >}} ## Suggested defaults The kubectl maintainers encourage you to adopt kuberc with the following defaults: {{< caution >}} If you are using a managed Kubernetes provider, check your provider's documentation about what exec plugins are needed in your environment, and use the ["Allowlist"](#credentialPluginPolicy) policy instead. If you encounter problems after setting the ["DenyAll"](#credentialPluginPolicy) policy as illustrated below, observe `kubectl`'s error messages to discover which plugins have been prevented from running and cross-reference them with your provider's documentation. Finally, change the policy to "Allowlist" and add the necessary plugins in the [credentialPluginAllowlist](#credentialPluginAllowlist) field. {{< /caution >}} ```yaml apiVersion: kubectl.config.k8s.io/v1beta1 kind: Preference defaults: # (1) default server-side apply - command: apply options: - name: server-side default: "true" # (2) default interactive deletion - command: delete options: - name: interactive default: "true" # See the above note about managed providers before selecting DenyAll credentialPluginPolicy: DenyAll ``` In this example, the following settings are enforced: 1. Defaults to using [Server-Side Apply](/docs/reference/using-api/server-side-apply/). 1. Defaults to interactive removal whenever invoking `kubectl delete` to prevent accidental removal of resources from the cluster. 1. No executable credential plugins will be permitted to execute. ## Disable kuberc To temporarily disable the `kuberc` functionality, set (and export) the environment variable `KUBERC` with the value `off`: ```shell export KUBERC=off ``` or disable the feature gate: ```shell export KUBECTL\_KUBERC=false ``` This might be useful for troubleshooting whether your `kuberc` is causing a
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kuberc.md
main
kubernetes
[ -0.03325594216585159, 0.016383539885282516, 0.004153387621045113, -0.05863528326153755, -0.06711476296186447, 0.02158464305102825, -0.024488268420100212, -0.0025776131078600883, 0.07599985599517822, 0.02660294622182846, 0.019467445090413094, -0.06026684120297432, 0.03043532371520996, 0.013...
0.067915
will be permitted to execute. ## Disable kuberc To temporarily disable the `kuberc` functionality, set (and export) the environment variable `KUBERC` with the value `off`: ```shell export KUBERC=off ``` or disable the feature gate: ```shell export KUBECTL\_KUBERC=false ``` This might be useful for troubleshooting whether your `kuberc` is causing a problem.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/kuberc.md
main
kubernetes
[ 0.07445444166660309, -0.00007242476567626, -0.01574246771633625, -0.0004095439799129963, 0.01586199179291725, 0.002745945705100894, -0.08776935189962387, -0.04123577103018761, 0.029508918523788452, 0.06643550843000412, -0.004407091531902552, -0.09279534965753555, -0.0693313404917717, -0.01...
0.024131
You can use the Kubernetes command line tool `kubectl` to interact with the API Server. Using kubectl is straightforward if you are familiar with the Docker command line tool. However, there are a few differences between the Docker commands and the kubectl commands. The following sections show a Docker sub-command and describe the equivalent `kubectl` command. ## docker run To run an nginx Deployment and expose the Deployment, see [kubectl create deployment](/docs/reference/generated/kubectl/kubectl-commands#-em-deployment-em-). docker: ```shell docker run -d --restart=always -e DOMAIN=cluster --name nginx-app -p 80:80 nginx ``` ``` 55c103fa129692154a7652490236fee9be47d70a8dd562281ae7d2f9a339a6db ``` ```shell docker ps ``` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 55c103fa1296 nginx "nginx -g 'daemon of…" 9 seconds ago Up 9 seconds 0.0.0.0:80->80/tcp nginx-app ``` kubectl: ```shell # start the pod running nginx kubectl create deployment --image=nginx nginx-app ``` ``` deployment.apps/nginx-app created ``` ```shell # add env to nginx-app kubectl set env deployment/nginx-app DOMAIN=cluster ``` ``` deployment.apps/nginx-app env updated ``` {{< note >}} `kubectl` commands print the type and name of the resource created or mutated, which can then be used in subsequent commands. You can expose a new Service after a Deployment is created. {{< /note >}} ```shell # expose a port through with a service kubectl expose deployment nginx-app --port=80 --name=nginx-http ``` ``` service "nginx-http" exposed ``` By using kubectl, you can create a [Deployment](/docs/concepts/workloads/controllers/deployment/) to ensure that N pods are running nginx, where N is the number of replicas stated in the spec and defaults to 1. You can also create a [service](/docs/concepts/services-networking/service/) with a selector that matches the pod labels. For more information, see [Use a Service to Access an Application in a Cluster](/docs/tasks/access-application-cluster/service-access-application-cluster). By default images run in the background, similar to `docker run -d ...`. To run things in the foreground, use [`kubectl run`](/docs/reference/generated/kubectl/kubectl-commands/#run) to create pod: ```shell kubectl run [-i] [--tty] --attach --image= ``` Unlike `docker run ...`, if you specify `--attach`, then you attach `stdin`, `stdout` and `stderr`. You cannot control which streams are attached (`docker -a ...`). To detach from the container, you can type the escape sequence Ctrl+P followed by Ctrl+Q. ## docker ps To list what is currently running, see [kubectl get](/docs/reference/generated/kubectl/kubectl-commands/#get). docker: ```shell docker ps -a ``` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 14636241935f ubuntu:16.04 "echo test" 5 seconds ago Exited (0) 5 seconds ago cocky\_fermi 55c103fa1296 nginx "nginx -g 'daemon of…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp nginx-app ``` kubectl: ```shell kubectl get po ``` ``` NAME READY STATUS RESTARTS AGE nginx-app-8df569cb7-4gd89 1/1 Running 0 3m ubuntu 0/1 Completed 0 20s ``` ## docker attach To attach a process that is already running in a container, see [kubectl attach](/docs/reference/generated/kubectl/kubectl-commands/#attach). docker: ```shell docker ps ``` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 55c103fa1296 nginx "nginx -g 'daemon of…" 5 minutes ago Up 5 minutes 0.0.0.0:80->80/tcp nginx-app ``` ```shell docker attach 55c103fa1296 ... ``` kubectl: ```shell kubectl get pods ``` ``` NAME READY STATUS RESTARTS AGE nginx-app-5jyvm 1/1 Running 0 10m ``` ```shell kubectl attach -it nginx-app-5jyvm ... ``` To detach from the container, you can type the escape sequence Ctrl+P followed by Ctrl+Q. ## docker exec To execute a command in a container, see [kubectl exec](/docs/reference/generated/kubectl/kubectl-commands/#exec). docker: ```shell docker ps ``` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 55c103fa1296 nginx "nginx -g 'daemon of…" 6 minutes ago Up 6 minutes 0.0.0.0:80->80/tcp nginx-app ``` ```shell docker exec 55c103fa1296 cat /etc/hostname ``` ``` 55c103fa1296 ``` kubectl: ```shell kubectl get po ``` ``` NAME READY STATUS RESTARTS AGE nginx-app-5jyvm 1/1 Running 0 10m ``` ```shell kubectl exec nginx-app-5jyvm -- cat /etc/hostname ``` ``` nginx-app-5jyvm ``` To use interactive commands.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/docker-cli-to-kubectl.md
main
kubernetes
[ -0.036190591752529144, 0.010127713903784752, -0.019681451842188835, 0.015582037158310413, -0.06269143521785736, -0.012449058704078197, -0.07271448522806168, -0.021536415442824364, 0.048362813889980316, 0.050904810428619385, -0.0964670330286026, -0.0779973492026329, 0.02415291592478752, -0....
0.127724
ago Up 6 minutes 0.0.0.0:80->80/tcp nginx-app ``` ```shell docker exec 55c103fa1296 cat /etc/hostname ``` ``` 55c103fa1296 ``` kubectl: ```shell kubectl get po ``` ``` NAME READY STATUS RESTARTS AGE nginx-app-5jyvm 1/1 Running 0 10m ``` ```shell kubectl exec nginx-app-5jyvm -- cat /etc/hostname ``` ``` nginx-app-5jyvm ``` To use interactive commands. docker: ```shell docker exec -ti 55c103fa1296 /bin/sh # exit ``` kubectl: ```shell kubectl exec -ti nginx-app-5jyvm -- /bin/sh # exit ``` For more information, see [Get a Shell to a Running Container](/docs/tasks/debug/debug-application/get-shell-running-container/). ## docker logs To follow stdout/stderr of a process that is running, see [kubectl logs](/docs/reference/generated/kubectl/kubectl-commands/#logs). docker: ```shell docker logs -f a9e ``` ``` 192.168.9.1 - - [14/Jul/2015:01:04:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-" 192.168.9.1 - - [14/Jul/2015:01:04:03 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-" ``` kubectl: ```shell kubectl logs -f nginx-app-zibvs ``` ``` 10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" 10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" ``` There is a slight difference between pods and containers; by default pods do not terminate if their processes exit. Instead the pods restart the process. This is similar to the docker run option `--restart=always` with one major difference. In docker, the output for each invocation of the process is concatenated, but for Kubernetes, each invocation is separate. To see the output from a previous run in Kubernetes, do this: ```shell kubectl logs --previous nginx-app-zibvs ``` ``` 10.240.63.110 - - [14/Jul/2015:01:09:01 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" 10.240.63.110 - - [14/Jul/2015:01:09:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.26.0" "-" ``` For more information, see [Logging Architecture](/docs/concepts/cluster-administration/logging/). ## docker stop and docker rm To stop and delete a running process, see [kubectl delete](/docs/reference/generated/kubectl/kubectl-commands/#delete). docker: ```shell docker ps ``` ``` CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a9ec34d98787 nginx "nginx -g 'daemon of" 22 hours ago Up 22 hours 0.0.0.0:80->80/tcp, 443/tcp nginx-app ``` ```shell docker stop a9ec34d98787 ``` ``` a9ec34d98787 ``` ```shell docker rm a9ec34d98787 ``` ``` a9ec34d98787 ``` kubectl: ```shell kubectl get deployment nginx-app ``` ``` NAME READY UP-TO-DATE AVAILABLE AGE nginx-app 1/1 1 1 2m ``` ```shell kubectl get po -l app=nginx-app ``` ``` NAME READY STATUS RESTARTS AGE nginx-app-2883164633-aklf7 1/1 Running 0 2m ``` ```shell kubectl delete deployment nginx-app ``` ``` deployment "nginx-app" deleted ``` ```shell kubectl get po -l app=nginx-app # Return nothing ``` {{< note >}} When you use kubectl, you don't delete the pod directly. You have to first delete the Deployment that owns the pod. If you delete the pod directly, the Deployment recreates the pod. {{< /note >}} ## docker login There is no direct analog of `docker login` in kubectl. If you are interested in using Kubernetes with a private registry, see [Using a Private Registry](/docs/concepts/containers/images/#using-a-private-registry). ## docker version To get the version of client and server, see [kubectl version](/docs/reference/generated/kubectl/kubectl-commands/#version). docker: ```shell docker version ``` ``` Client version: 1.7.0 Client API version: 1.19 Go version (client): go1.4.2 Git commit (client): 0baf609 OS/Arch (client): linux/amd64 Server version: 1.7.0 Server API version: 1.19 Go version (server): go1.4.2 Git commit (server): 0baf609 OS/Arch (server): linux/amd64 ``` kubectl: ```shell kubectl version ``` ``` Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.9+a3d1dfa6f4335", GitCommit:"9b77fed11a9843ce3780f70dd251e92901c43072", GitTreeState:"dirty", BuildDate:"2017-08-29T20:32:58Z", OpenPaasKubernetesVersion:"v1.03.02", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"} Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.9+a3d1dfa6f4335", GitCommit:"9b77fed11a9843ce3780f70dd251e92901c43072", GitTreeState:"dirty", BuildDate:"2017-08-29T20:32:58Z", OpenPaasKubernetesVersion:"v1.03.02", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"} ``` ## docker info To get miscellaneous information about the environment and configuration, see [kubectl cluster-info](/docs/reference/generated/kubectl/kubectl-commands/#cluster-info). docker: ```shell docker info ``` ``` Containers: 40 Images: 168 Storage Driver: aufs Root Dir: /usr/local/google/docker/aufs Backing Filesystem: extfs Dirs: 248 Dirperm1 Supported: false Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 3.13.0-53-generic
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/docker-cli-to-kubectl.md
main
kubernetes
[ 0.011013622395694256, 0.08769000321626663, 0.013901300728321075, -0.03509688004851341, -0.03322969004511833, -0.0451110303401947, -0.03238479048013687, 0.0024689752608537674, 0.06571286171674728, 0.057496145367622375, -0.06367817521095276, -0.09548252820968628, -0.04349720478057861, 0.0281...
0.05882
Platform:"linux/amd64"} ``` ## docker info To get miscellaneous information about the environment and configuration, see [kubectl cluster-info](/docs/reference/generated/kubectl/kubectl-commands/#cluster-info). docker: ```shell docker info ``` ``` Containers: 40 Images: 168 Storage Driver: aufs Root Dir: /usr/local/google/docker/aufs Backing Filesystem: extfs Dirs: 248 Dirperm1 Supported: false Execution Driver: native-0.2 Logging Driver: json-file Kernel Version: 3.13.0-53-generic Operating System: Ubuntu 14.04.2 LTS CPUs: 12 Total Memory: 31.32 GiB Name: k8s-is-fun.mtv.corp.google.com ID: ADUV:GCYR:B3VJ:HMPO:LNPQ:KD5S:YKFQ:76VN:IANZ:7TFV:ZBF4:BYJO WARNING: No swap limit support ``` kubectl: ```shell kubectl cluster-info ``` ``` Kubernetes master is running at https://203.0.113.141 KubeDNS is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/kube-dns/proxy kubernetes-dashboard is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy Grafana is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy Heapster is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/monitoring-heapster/proxy InfluxDB is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/monitoring-influxdb/proxy ```
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/docker-cli-to-kubectl.md
main
kubernetes
[ 0.03015228733420372, 0.008003408089280128, -0.01703535206615925, -0.035052407532930374, 0.006976623088121414, -0.027052704244852066, -0.04459143802523613, -0.01100235991179943, 0.01878204569220543, 0.04677252098917961, 0.004690270870923996, -0.08175598829984665, -0.016099222004413605, -0.0...
0.095209
{{< glossary\_definition prepend="Kubernetes provides a" term\_id="kubectl" length="short" >}} This tool is named `kubectl`. For configuration, `kubectl` looks for a file named `config` in the `$HOME/.kube` directory. You can specify other [kubeconfig](/docs/concepts/configuration/organize-cluster-access-kubeconfig/) files by setting the `KUBECONFIG` environment variable or by setting the [`--kubeconfig`](/docs/concepts/configuration/organize-cluster-access-kubeconfig/) flag. This overview covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/reference/kubectl/generated/kubectl/) reference documentation. For installation instructions, see [Installing kubectl](/docs/tasks/tools/#kubectl); for a quick guide, see the [cheat sheet](/docs/reference/kubectl/quick-reference/). If you're used to using the `docker` command-line tool, [`kubectl` for Docker Users](/docs/reference/kubectl/docker-cli-to-kubectl/) explains some equivalent commands for Kubernetes. ## Syntax Use the following syntax to run `kubectl` commands from your terminal window: ```shell kubectl [command] [TYPE] [NAME] [flags] ``` where `command`, `TYPE`, `NAME`, and `flags` are: \* `command`: Specifies the operation that you want to perform on one or more resources, for example `create`, `get`, `describe`, `delete`. \* `TYPE`: Specifies the [resource type](#resource-types). Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms. For example, the following commands produce the same output: ```shell kubectl get pod pod1 kubectl get pods pod1 kubectl get po pod1 ``` \* `NAME`: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed, for example `kubectl get pods`. When performing an operation on multiple resources, you can specify each resource by type and name or specify one or more files: \* To specify resources by type and name: \* To group resources if they are all the same type: `TYPE1 name1 name2 name<#>`. Example: `kubectl get pod example-pod1 example-pod2` \* To specify multiple resource types individually: `TYPE1/name1 TYPE1/name2 TYPE2/name3 TYPE<#>/name<#>`. Example: `kubectl get pod/example-pod1 replicationcontroller/example-rc1` \* To specify resources with one or more files: `-f file1 -f file2 -f file<#>` \* Use YAML rather than JSON since YAML tends to be more user-friendly, especially for configuration files. Example: `kubectl get -f ./pod.yaml` \* `flags`: Specifies optional flags. For example, you can use the `-s` or `--server` flags to specify the address and port of the Kubernetes API server. {{< caution >}} Flags that you specify from the command line override default values and any corresponding environment variables. {{< /caution >}} If you need help, run `kubectl help` from the terminal window. ## In-cluster authentication and namespace overrides By default `kubectl` will first determine if it is running within a pod, and thus in a cluster. It starts by checking for the `KUBERNETES\_SERVICE\_HOST` and `KUBERNETES\_SERVICE\_PORT` environment variables and the existence of a service account token file at `/var/run/secrets/kubernetes.io/serviceaccount/token`. If all three are found in-cluster authentication is assumed. To maintain backwards compatibility, if the `POD\_NAMESPACE` environment variable is set during in-cluster authentication it will override the default namespace from the service account token. Any manifests or tools relying on namespace defaulting will be affected by this. \*\*`POD\_NAMESPACE` environment variable\*\* If the `POD\_NAMESPACE` environment variable is set, cli operations on namespaced resources will default to the variable value. For example, if the variable is set to `seattle`, `kubectl get pods` would return pods in the `seattle` namespace. This is because pods are a namespaced resource, and no namespace was provided in the command. Review the output of `kubectl api-resources` to determine if a resource is namespaced. Explicit use of `--namespace ` overrides this behavior. \*\*How kubectl handles ServiceAccount tokens\*\* If: \* there is Kubernetes service account token file mounted at `/var/run/secrets/kubernetes.io/serviceaccount/token`, and \* the `KUBERNETES\_SERVICE\_HOST` environment variable is set, and \* the `KUBERNETES\_SERVICE\_PORT` environment variable is set, and \* you don't explicitly specify a namespace
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ 0.0045798602513968945, -0.011256381869316101, -0.0021696032490581274, 0.007711171172559261, -0.04752273112535477, 0.009625229984521866, -0.0013156043132767081, -0.0342702753841877, 0.021755319088697433, 0.003186620306223631, 0.012228650972247124, -0.09758631139993668, -0.02674148976802826, ...
0.145263
namespaced. Explicit use of `--namespace ` overrides this behavior. \*\*How kubectl handles ServiceAccount tokens\*\* If: \* there is Kubernetes service account token file mounted at `/var/run/secrets/kubernetes.io/serviceaccount/token`, and \* the `KUBERNETES\_SERVICE\_HOST` environment variable is set, and \* the `KUBERNETES\_SERVICE\_PORT` environment variable is set, and \* you don't explicitly specify a namespace on the kubectl command line then kubectl assumes it is running in your cluster. The kubectl tool looks up the namespace of that ServiceAccount (this is the same as the namespace of the Pod) and acts against that namespace. This is different from what happens outside of a cluster; when kubectl runs outside a cluster and you don't specify a namespace, the kubectl command acts against the namespace set for the current context in your client configuration. To change the default namespace for your kubectl you can use the following command: ```shell kubectl config set-context --current --namespace= ``` ## Operations The following table includes short descriptions and the general syntax for all of the `kubectl` operations: Operation | Syntax | Description -------------------- | -------------------- | -------------------- `alpha` | `kubectl alpha SUBCOMMAND [flags]` | List the available commands that correspond to alpha features, which are not enabled in Kubernetes clusters by default. `annotate` | `kubectl annotate (-f FILENAME | TYPE NAME | TYPE/NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--overwrite] [--all] [--resource-version=version] [flags]` | Add or update the annotations of one or more resources. `api-resources` | `kubectl api-resources [flags]` | List the API resources that are available. `api-versions` | `kubectl api-versions [flags]` | List the API versions that are available. `apply` | `kubectl apply -f FILENAME [flags]`| Apply a configuration change to a resource from a file or stdin. `attach` | `kubectl attach POD -c CONTAINER [-i] [-t] [flags]` | Attach to a running container either to view the output stream or interact with the container (stdin). `auth` | `kubectl auth [flags] [options]` | Inspect authorization. `autoscale` | `kubectl autoscale (-f FILENAME | TYPE NAME | TYPE/NAME) [--min=MINPODS] --max=MAXPODS [--cpu-percent=CPU] [flags]` | Automatically scale the set of pods that are managed by a replication controller. `certificate` | `kubectl certificate SUBCOMMAND [options]` | Modify certificate resources. `cluster-info` | `kubectl cluster-info [flags]` | Display endpoint information about the master and services in the cluster. `completion` | `kubectl completion SHELL [options]` | Output shell completion code for the specified shell (bash or zsh). `config` | `kubectl config SUBCOMMAND [flags]` | Modifies kubeconfig files. See the individual subcommands for details. `convert` | `kubectl convert -f FILENAME [options]` | Convert config files between different API versions. Both YAML and JSON formats are accepted. Note - requires `kubectl-convert` plugin to be installed. `cordon` | `kubectl cordon NODE [options]` | Mark node as unschedulable. `cp` | `kubectl cp [options]` | Copy files and directories to and from containers. `create` | `kubectl create -f FILENAME [flags]` | Create one or more resources from a file or stdin. `delete` | `kubectl delete (-f FILENAME | TYPE [NAME | /NAME | -l label | --all]) [flags]` | Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources. `describe` | `kubectl describe (-f FILENAME | TYPE [NAME_PREFIX | /NAME | -l label]) [flags]` | Display the detailed state of one or more resources. `diff` | `kubectl diff -f FILENAME [flags]`| Diff file or stdin against live configuration. `drain` | `kubectl drain NODE [options]` | Drain node in preparation for maintenance. `edit` | `kubectl edit (-f FILENAME | TYPE NAME | TYPE/NAME) [flags]` | Edit and update the definition of one or more resources on the server by using the default editor. `events` | `kubectl events` | List events `exec`
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ -0.006567018106579781, -0.050985999405384064, 0.026705216616392136, 0.010421895422041416, -0.07995756715536118, -0.022684477269649506, 0.037043001502752304, -0.032341763377189636, 0.1372925490140915, 0.038647107779979706, -0.02836655266582966, -0.07768069952726364, 0.022413332015275955, -0...
0.128342
`kubectl drain NODE [options]` | Drain node in preparation for maintenance. `edit` | `kubectl edit (-f FILENAME | TYPE NAME | TYPE/NAME) [flags]` | Edit and update the definition of one or more resources on the server by using the default editor. `events` | `kubectl events` | List events `exec` | `kubectl exec POD [-c CONTAINER] [-i] [-t] [flags] [-- COMMAND [args...]]` | Execute a command against a container in a pod. `explain` | `kubectl explain TYPE [--recursive=false] [flags]` | Get documentation of various resources. For instance pods, nodes, services, etc. `expose` | `kubectl expose (-f FILENAME | TYPE NAME | TYPE/NAME) [--port=port] [--protocol=TCP|UDP] [--target-port=number-or-name] [--name=name] [--external-ip=external-ip-of-service] [--type=type] [flags]` | Expose a replication controller, service, or pod as a new Kubernetes service. `get` | `kubectl get (-f FILENAME | TYPE [NAME | /NAME | -l label]) [--watch] [--sort-by=FIELD] [[-o | --output]=OUTPUT_FORMAT] [flags]` | List one or more resources. `kustomize` | `kubectl kustomize [flags] [options]` | List a set of API resources generated from instructions in a kustomization.yaml file. The argument must be the path to the directory containing the file, or a git repository URL with a path suffix specifying same with respect to the repository root. `label` | `kubectl label (-f FILENAME | TYPE NAME | TYPE/NAME) KEY_1=VAL_1 ... KEY_N=VAL_N [--overwrite] [--all] [--resource-version=version] [flags]` | Add or update the labels of one or more resources. `logs` | `kubectl logs POD [-c CONTAINER] [--follow] [flags]` | Print the logs for a container in a pod. `options` | `kubectl options` | List of global command-line options, which apply to all commands. `patch` | `kubectl patch (-f FILENAME | TYPE NAME | TYPE/NAME) --patch PATCH [flags]` | Update one or more fields of a resource by using the strategic merge patch process. `plugin` | `kubectl plugin [flags] [options]` | Provides utilities for interacting with plugins. `port-forward` | `kubectl port-forward POD [LOCAL\_PORT:]REMOTE\_PORT [...[LOCAL\_PORT\_N:]REMOTE\_PORT\_N] [flags]` | Forward one or more local ports to a pod. `proxy` | `kubectl proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix] [flags]` | Run a proxy to the Kubernetes API server. `replace` | `kubectl replace -f FILENAME` | Replace a resource from a file or stdin. `rollout` | `kubectl rollout SUBCOMMAND [options]` | Manage the rollout of a resource. Valid resource types include: deployments, daemonsets and statefulsets. `run` | `kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client|none] [--overrides=inline-json] [flags]` | Run a specified image on the cluster. `scale` | `kubectl scale (-f FILENAME | TYPE NAME | TYPE/NAME) --replicas=COUNT [--resource-version=version] [--current-replicas=count] [flags]` | Update the size of the specified replication controller. `set` | `kubectl set SUBCOMMAND [options]` | Configure application resources. `taint` | `kubectl taint NODE NAME KEY\_1=VAL\_1:TAINT\_EFFECT\_1 ... KEY\_N=VAL\_N:TAINT\_EFFECT\_N [options]` | Update the taints on one or more nodes. `top` | `kubectl top (POD | NODE) [flags] [options]` | Display Resource (CPU/Memory/Storage) usage of pod or node. `uncordon` | `kubectl uncordon NODE [options]` | Mark node as schedulable. `version` | `kubectl version [--client] [flags]` | Display the Kubernetes version running on the client and server. `wait` | `kubectl wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available] [options]` | Experimental: Wait for a specific condition on one or many resources. To learn more about command operations, see the [kubectl](/docs/reference/kubectl/kubectl/) reference documentation. ## Resource types The following table includes a list of all the supported resource types and their abbreviated aliases. (This output can be retrieved from `kubectl api-resources`, and was accurate as of Kubernetes 1.25.0) | NAME | SHORTNAMES | APIVERSION | NAMESPACED | KIND | |---|---|---|---|---| | `bindings` | | v1 | true | Binding | | `componentstatuses` | `cs` | v1 | false | ComponentStatus |
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ -0.010114108212292194, 0.07393103837966919, 0.04525664448738098, 0.02630283683538437, 0.01714939996600151, -0.07141487300395966, 0.01025463081896305, -0.0018775443313643336, 0.06850184500217438, 0.05619172751903534, -0.04291943833231926, -0.06820159405469894, -0.06500081717967987, -0.06550...
0.214435
abbreviated aliases. (This output can be retrieved from `kubectl api-resources`, and was accurate as of Kubernetes 1.25.0) | NAME | SHORTNAMES | APIVERSION | NAMESPACED | KIND | |---|---|---|---|---| | `bindings` | | v1 | true | Binding | | `componentstatuses` | `cs` | v1 | false | ComponentStatus | | `configmaps` | `cm` | v1 | true | ConfigMap | | `endpoints` | `ep` | v1 | true | Endpoints | | `events` | `ev` | v1 | true | Event | | `limitranges` | `limits` | v1 | true | LimitRange | | `namespaces` | `ns` | v1 | false | Namespace | | `nodes` | `no` | v1 | false | Node | | `persistentvolumeclaims` | `pvc` | v1 | true | PersistentVolumeClaim | | `persistentvolumes` | `pv` | v1 | false | PersistentVolume | | `pods` | `po` | v1 | true | Pod | | `podtemplates` | | v1 | true | PodTemplate | | `replicationcontrollers` | `rc` | v1 | true | ReplicationController | | `resourcequotas` | `quota` | v1 | true | ResourceQuota | | `secrets` | | v1 | true | Secret | | `serviceaccounts` | `sa` | v1 | true | ServiceAccount | | `services` | `svc` | v1 | true | Service | | `mutatingwebhookconfigurations` | | admissionregistration.k8s.io/v1 | false | MutatingWebhookConfiguration | | `validatingwebhookconfigurations` | | admissionregistration.k8s.io/v1 | false | ValidatingWebhookConfiguration | | `customresourcedefinitions` | `crd,crds` | apiextensions.k8s.io/v1 | false | CustomResourceDefinition | | `apiservices` | | apiregistration.k8s.io/v1 | false | APIService | | `controllerrevisions` | | apps/v1 | true | ControllerRevision | | `daemonsets` | `ds` | apps/v1 | true | DaemonSet | | `deployments` | `deploy` | apps/v1 | true | Deployment | | `replicasets` | `rs` | apps/v1 | true | ReplicaSet | | `statefulsets` | `sts` | apps/v1 | true | StatefulSet | | `tokenreviews` | | authentication.k8s.io/v1 | false | TokenReview | | `localsubjectaccessreviews` | | authorization.k8s.io/v1 | true | LocalSubjectAccessReview | | `selfsubjectaccessreviews` | | authorization.k8s.io/v1 | false | SelfSubjectAccessReview | | `selfsubjectrulesreviews` | | authorization.k8s.io/v1 | false | SelfSubjectRulesReview | | `subjectaccessreviews` | | authorization.k8s.io/v1 | false | SubjectAccessReview | | `horizontalpodautoscalers` | `hpa` | autoscaling/v2 | true | HorizontalPodAutoscaler | | `cronjobs` | `cj` | batch/v1 | true | CronJob | | `jobs` | | batch/v1 | true | Job | | `certificatesigningrequests` | `csr` | certificates.k8s.io/v1 | false | CertificateSigningRequest | | `leases` | | coordination.k8s.io/v1 | true | Lease | | `endpointslices` | | discovery.k8s.io/v1 | true | EndpointSlice | | `events` | `ev` | events.k8s.io/v1 | true | Event | | `flowschemas` | | flowcontrol.apiserver.k8s.io/v1beta2 | false | FlowSchema | | `prioritylevelconfigurations` | | flowcontrol.apiserver.k8s.io/v1beta2 | false | PriorityLevelConfiguration | | `ingressclasses` | | networking.k8s.io/v1 | false | IngressClass | | `ingresses` | `ing` | networking.k8s.io/v1 | true | Ingress | | `networkpolicies` | `netpol` | networking.k8s.io/v1 | true | NetworkPolicy | | `runtimeclasses` | | node.k8s.io/v1 | false | RuntimeClass | | `poddisruptionbudgets` | `pdb` | policy/v1 | true | PodDisruptionBudget | | `podsecuritypolicies` | `psp` | policy/v1beta1 | false | PodSecurityPolicy | | `clusterrolebindings` | | rbac.authorization.k8s.io/v1 | false | ClusterRoleBinding | | `clusterroles` | | rbac.authorization.k8s.io/v1 | false | ClusterRole | | `rolebindings` | | rbac.authorization.k8s.io/v1 | true | RoleBinding | | `roles` | | rbac.authorization.k8s.io/v1 | true | Role | | `priorityclasses` | `pc` | scheduling.k8s.io/v1 | false | PriorityClass | | `csidrivers` | | storage.k8s.io/v1 | false | CSIDriver | | `csinodes` | | storage.k8s.io/v1 | false | CSINode | | `csistoragecapacities` | | storage.k8s.io/v1 | true | CSIStorageCapacity | | `storageclasses` |
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ 0.034878991544246674, -0.026538684964179993, -0.004279989283531904, 0.0032648106571286917, -0.013575257733464241, 0.02235431596636772, 0.006353968288749456, 0.015375234186649323, 0.10215763747692108, 0.012907703407108784, -0.013738678768277168, -0.14592568576335907, 0.03530934453010559, -0...
0.126083
rbac.authorization.k8s.io/v1 | true | Role | | `priorityclasses` | `pc` | scheduling.k8s.io/v1 | false | PriorityClass | | `csidrivers` | | storage.k8s.io/v1 | false | CSIDriver | | `csinodes` | | storage.k8s.io/v1 | false | CSINode | | `csistoragecapacities` | | storage.k8s.io/v1 | true | CSIStorageCapacity | | `storageclasses` | `sc` | storage.k8s.io/v1 | false | StorageClass | | `volumeattachments` | | storage.k8s.io/v1 | false | VolumeAttachment | ## Output options Use the following sections for information about how you can format or sort the output of certain commands. For details about which commands support the various output options, see the [kubectl](/docs/reference/kubectl/kubectl/) reference documentation. ### Formatting output The default output format for all `kubectl` commands is the human readable plain-text format. To output details to your terminal window in a specific format, you can add either the `-o` or `--output` flags to a supported `kubectl` command. #### Syntax ```shell kubectl [command] [TYPE] [NAME] -o ``` Depending on the `kubectl` operation, the following output formats are supported: Output format | Description --------------| ----------- `-o custom-columns=` | Print a table using a comma separated list of [custom columns](#custom-columns). `-o custom-columns-file=` | Print a table using the [custom columns](#custom-columns) template in the `` file. `-o json` | Output a JSON formatted API object. `-o jsonpath=` | Print the fields defined in a [jsonpath](/docs/reference/kubectl/jsonpath/) expression. `-o jsonpath-file=` | Print the fields defined by the [jsonpath](/docs/reference/kubectl/jsonpath/) expression in the `` file. `-o kyaml` | Output a [KYAML](/docs/reference/encodings/kyaml/) formatted API object (beta). `-o name` | Print only the resource name and nothing else. `-o wide` | Output in the plain-text format with any additional information. For pods, the node name is included. `-o yaml` | Output a YAML formatted API object. KYAML is an experimental Kubernetes-specific dialect of YAML, and can be parsed as YAML. ##### Example In this example, the following command outputs the details for a single pod as a YAML formatted object: ```shell kubectl get pod web-pod-13je7 -o yaml ``` Remember: See the [kubectl](/docs/reference/kubectl/kubectl/) reference documentation for details about which output format is supported by each command. #### Custom columns To define custom columns and output only the details that you want into a table, you can use the `custom-columns` option. You can choose to define the custom columns inline or use a template file: `-o custom-columns=` or `-o custom-columns-file=`. ##### Examples Inline: ```shell kubectl get pods -o custom-columns=NAME:.metadata.name,RSRC:.metadata.resourceVersion ``` Template file: ```shell kubectl get pods -o custom-columns-file=template.txt ``` where the `template.txt` file contains: ``` NAME RSRC metadata.name metadata.resourceVersion ``` The result of running either command is similar to: ``` NAME RSRC submit-queue 610995 ``` #### Server-side columns `kubectl` supports receiving specific column information from the server about objects. This means that for any given resource, the server will return columns and rows relevant to that resource, for the client to print. This allows for consistent human-readable output across clients used against the same cluster, by having the server encapsulate the details of printing. This feature is enabled by default. To disable it, add the `--server-print=false` flag to the `kubectl get` command. ##### Examples To print information about the status of a pod, use a command like the following: ```shell kubectl get pods --server-print=false ``` The output is similar to: ``` NAME AGE pod-name 1m ``` ### Sorting list objects To output objects to a sorted list in your terminal window, you can add the `--sort-by` flag to a supported `kubectl` command. Sort your objects by specifying any numeric or string field with the `--sort-by` flag. To specify a field, use a [jsonpath](/docs/reference/kubectl/jsonpath/) expression. #### Syntax ```shell kubectl [command] [TYPE] [NAME] --sort-by= ```
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ -0.0041754720732569695, -0.001795379095710814, -0.06343429535627365, 0.02821272425353527, -0.03761376067996025, 0.027266627177596092, -0.012038201093673706, -0.01297931931912899, -0.01564023643732071, 0.026358598843216896, 0.026396621018648148, -0.040221892297267914, 0.03969443589448929, -...
0.146396
to a sorted list in your terminal window, you can add the `--sort-by` flag to a supported `kubectl` command. Sort your objects by specifying any numeric or string field with the `--sort-by` flag. To specify a field, use a [jsonpath](/docs/reference/kubectl/jsonpath/) expression. #### Syntax ```shell kubectl [command] [TYPE] [NAME] --sort-by= ``` ##### Example To print a list of pods sorted by name, you run: ```shell kubectl get pods --sort-by=.metadata.name ``` ## Examples: Common operations Use the following set of examples to help you familiarize yourself with running the commonly used `kubectl` operations: `kubectl apply` - Apply or Update a resource from a file or stdin. ```shell # Create a service using the definition in example-service.yaml. kubectl apply -f example-service.yaml # Create a replication controller using the definition in example-controller.yaml. kubectl apply -f example-controller.yaml # Create the objects that are defined in any .yaml, .yml, or .json file within the directory. kubectl apply -f ``` `kubectl get` - List one or more resources. ```shell # List all pods in plain-text output format. kubectl get pods # List all pods in plain-text output format and include additional information (such as node name). kubectl get pods -o wide # List the replication controller with the specified name in plain-text output format. Tip: You can shorten and replace the 'replicationcontroller' resource type with the alias 'rc'. kubectl get replicationcontroller # List all replication controllers and services together in plain-text output format. kubectl get rc,services # List all daemon sets in plain-text output format. kubectl get ds # List all pods running on node server01 kubectl get pods --field-selector=spec.nodeName=server01 ``` `kubectl describe` - Display detailed state of one or more resources, including the uninitialized ones by default. ```shell # Display the details of the node with name . kubectl describe nodes # Display the details of the pod with name . kubectl describe pods/ # Display the details of all the pods that are managed by the replication controller named . # Remember: Any pods that are created by the replication controller get prefixed with the name of the replication controller. kubectl describe pods # Describe all pods kubectl describe pods ``` {{< note >}} The `kubectl get` command is usually used for retrieving one or more resources of the same resource type. It features a rich set of flags that allows you to customize the output format using the `-o` or `--output` flag, for example. You can specify the `-w` or `--watch` flag to start watching updates to a particular object. The `kubectl describe` command is more focused on describing the many related aspects of a specified resource. It may invoke several API calls to the API server to build a view for the user. For example, the `kubectl describe node` command retrieves not only the information about the node, but also a summary of the pods running on it, the events generated for the node etc. {{< /note >}} `kubectl delete` - Delete resources either from a file, stdin, or specifying label selectors, names, resource selectors, or resources. ```shell # Delete a pod using the type and name specified in the pod.yaml file. kubectl delete -f pod.yaml # Delete all the pods and services that have the label '='. kubectl delete pods,services -l = # Delete all pods, including uninitialized ones. kubectl delete pods --all ``` `kubectl exec` - Execute a command against a container in a pod. ```shell # Get output from running 'date' from pod . By default, output is from the first container. kubectl exec -- date # Get output from running 'date' in container of pod . kubectl exec -c
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ 0.04029340669512749, 0.008944866247475147, 0.017287230119109154, -0.003985468298196793, -0.06786792725324631, 0.008786756545305252, -0.009361151605844498, 0.04424072802066803, 0.056154463440179825, 0.09488456696271896, 0.02636994980275631, 0.00736223952844739, -0.0058156028389930725, -0.01...
0.05568
--all ``` `kubectl exec` - Execute a command against a container in a pod. ```shell # Get output from running 'date' from pod . By default, output is from the first container. kubectl exec -- date # Get output from running 'date' in container of pod . kubectl exec -c -- date # Get an interactive TTY and run /bin/bash from pod . By default, output is from the first container. kubectl exec -ti -- /bin/bash ``` `kubectl logs` - Print the logs for a container in a pod. ```shell # Return a snapshot of the logs from pod . kubectl logs # Start streaming the logs from pod . This is similar to the 'tail -f' Linux command. kubectl logs -f ``` `kubectl diff` - View a diff of the proposed updates to a cluster. ```shell # Diff resources included in "pod.json". kubectl diff -f pod.json # Diff file read from stdin. cat service.yaml | kubectl diff -f - ``` ## Examples: Creating and using plugins Use the following set of examples to help you familiarize yourself with writing and using `kubectl` plugins: ```shell # create a simple plugin in any language and name the resulting executable file # so that it begins with the prefix "kubectl-" cat ./kubectl-hello ``` ```shell #!/bin/sh # this plugin prints the words "hello world" echo "hello world" ``` With a plugin written, let's make it executable: ```bash chmod a+x ./kubectl-hello # and move it to a location in our PATH sudo mv ./kubectl-hello /usr/local/bin sudo chown root:root /usr/local/bin # You have now created and "installed" a kubectl plugin. # You can begin using this plugin by invoking it from kubectl as if it were a regular command kubectl hello ``` ``` hello world ``` ```shell # You can "uninstall" a plugin, by removing it from the folder in your # $PATH where you placed it sudo rm /usr/local/bin/kubectl-hello ``` In order to view all of the plugins that are available to `kubectl`, use the `kubectl plugin list` subcommand: ```shell kubectl plugin list ``` The output is similar to: ``` The following kubectl-compatible plugins are available: /usr/local/bin/kubectl-hello /usr/local/bin/kubectl-foo /usr/local/bin/kubectl-bar ``` `kubectl plugin list` also warns you about plugins that are not executable, or that are shadowed by other plugins; for example: ```shell sudo chmod -x /usr/local/bin/kubectl-foo # remove execute permission kubectl plugin list ``` ``` The following kubectl-compatible plugins are available: /usr/local/bin/kubectl-hello /usr/local/bin/kubectl-foo - warning: /usr/local/bin/kubectl-foo identified as a plugin, but it is not executable /usr/local/bin/kubectl-bar error: one plugin warning was found ``` You can think of plugins as a means to build more complex functionality on top of the existing kubectl commands: ```shell cat ./kubectl-whoami ``` The next few examples assume that you already made `kubectl-whoami` have the following contents: ```shell #!/bin/bash # this plugin makes use of the `kubectl config` command in order to output # information about the current user, based on the currently selected context kubectl config view --template='{{ range .contexts }}{{ if eq .name "'$(kubectl config current-context)'" }}Current user: {{ printf "%s\n" .context.user }}{{ end }}{{ end }}' ``` Running the above command gives you an output containing the user for the current context in your KUBECONFIG file: ```shell # make the file executable sudo chmod +x ./kubectl-whoami # and move it into your PATH sudo mv ./kubectl-whoami /usr/local/bin kubectl whoami Current user: plugins-user ``` ## {{% heading "whatsnext" %}} \* Read the `kubectl` reference documentation: \* the kubectl [command reference](/docs/reference/kubectl/kubectl/) \* the [command line arguments](/docs/reference/kubectl/generated/kubectl/) reference \* Learn about [`kubectl` usage conventions](/docs/reference/kubectl/conventions/) \* Read about [JSONPath support](/docs/reference/kubectl/jsonpath/) in kubectl \* Read about how to [extend kubectl with plugins](/docs/tasks/extend-kubectl/kubectl-plugins)
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ 0.047259677201509476, 0.030277933925390244, 0.008393905125558376, 0.018240462988615036, 0.03436415642499924, -0.051302846521139145, -0.031974561512470245, 0.005685168784111738, 0.06572485715150833, 0.03411589190363884, 0.011537899263203144, -0.08151576668024063, -0.05415709689259529, -0.06...
0.179112
kubectl whoami Current user: plugins-user ``` ## {{% heading "whatsnext" %}} \* Read the `kubectl` reference documentation: \* the kubectl [command reference](/docs/reference/kubectl/kubectl/) \* the [command line arguments](/docs/reference/kubectl/generated/kubectl/) reference \* Learn about [`kubectl` usage conventions](/docs/reference/kubectl/conventions/) \* Read about [JSONPath support](/docs/reference/kubectl/jsonpath/) in kubectl \* Read about how to [extend kubectl with plugins](/docs/tasks/extend-kubectl/kubectl-plugins) \* To find out more about plugins, take a look at the [example CLI plugin](https://github.com/kubernetes/sample-cli-plugin).
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/_index.md
main
kubernetes
[ -0.04883803799748421, -0.012823039665818214, 0.004718956537544727, -0.04751479625701904, -0.10600706189870834, -0.010707637295126915, -0.015721075236797333, 0.03599688410758972, -0.004730589687824249, -0.04715723544359207, 0.03473018482327461, -0.11314157396554947, -0.002431809902191162, 0...
0.15712
## {{% heading "synopsis" %}} kubectl controls the Kubernetes cluster manager. Find more information at: https://kubernetes.io/docs/reference/kubectl/ ``` kubectl [flags] ``` ## {{% heading "options" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | -h, --help | | | | help for kubectl | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl.md
main
kubernetes
[ 0.016525758430361748, 0.03153316304087639, -0.023357300087809563, 0.021835194900631905, -0.07585863023996353, -0.01851823180913925, 0.10681113600730896, -0.03679424896836281, 0.022379567846655846, 0.028363553807139397, 0.00732339546084404, -0.08289091289043427, -0.01019449345767498, -0.023...
0.126028
string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl alpha](../kubectl\_alpha/) - Commands for features in alpha \* [kubectl annotate](../kubectl\_annotate/) - Update the annotations on a resource \* [kubectl api-resources](../kubectl\_api-resources/) - Print the supported API resources on the server \* [kubectl api-versions](../kubectl\_api-versions/) - Print the supported API versions on the server, in the form of "group/version" \* [kubectl apply](../kubectl\_apply/) - Apply a configuration to a resource by file name or stdin \* [kubectl attach](../kubectl\_attach/) - Attach to a running container \* [kubectl auth](../kubectl\_auth/) - Inspect authorization \* [kubectl autoscale](../kubectl\_autoscale/) - Auto-scale a deployment, replica set, stateful set, or replication controller \* [kubectl certificate](../kubectl\_certificate/) - Modify certificate resources \* [kubectl cluster-info](../kubectl\_cluster-info/) - Display cluster information \* [kubectl completion](../kubectl\_completion/) - Output shell completion code for the specified shell (bash, zsh, fish, or powershell) \* [kubectl config](../kubectl\_config/) - Modify kubeconfig files \* [kubectl cordon](../kubectl\_cordon/) - Mark node as unschedulable \* [kubectl cp](../kubectl\_cp/) - Copy files and directories to and from containers \* [kubectl create](../kubectl\_create/) - Create a resource from a file or from stdin \* [kubectl debug](../kubectl\_debug/) - Create debugging sessions for troubleshooting workloads and nodes \* [kubectl delete](../kubectl\_delete/) - Delete resources by file names, stdin, resources and names, or by resources and label selector \* [kubectl describe](../kubectl\_describe/) - Show details of a specific resource or group of resources \* [kubectl diff](../kubectl\_diff/) - Diff the live version against a would-be applied version \* [kubectl drain](../kubectl\_drain/) - Drain node in preparation for maintenance \* [kubectl edit](../kubectl\_edit/) - Edit a resource on the server \* [kubectl events](../kubectl\_events/) - List events \* [kubectl exec](../kubectl\_exec/) - Execute a command in a container \* [kubectl explain](../kubectl\_explain/) - Get documentation for a resource \* [kubectl expose](../kubectl\_expose/) - Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service \* [kubectl get](../kubectl\_get/) - Display one or many resources \* [kubectl kustomize](../kubectl\_kustomize/) - Build a kustomization target from a directory or URL \* [kubectl label](../kubectl\_label/) - Update the labels on a resource \* [kubectl logs](../kubectl\_logs/) - Print the logs for a container in a pod \* [kubectl options](../kubectl\_options/) - Print the list of flags inherited by all commands \* [kubectl patch](../kubectl\_patch/) - Update fields of a resource \* [kubectl plugin](../kubectl\_plugin/) - Provides utilities for interacting with plugins \* [kubectl port-forward](../kubectl\_port-forward/) - Forward one or more local ports to a pod \* [kubectl proxy](../kubectl\_proxy/) - Run a proxy to the Kubernetes API server \* [kubectl replace](../kubectl\_replace/) - Replace a resource by file name or stdin \* [kubectl rollout](../kubectl\_rollout/) - Manage the rollout of a resource \* [kubectl run](../kubectl\_run/) - Run a particular image on the cluster \* [kubectl scale](../kubectl\_scale/) - Set a new size for a deployment, replica set, or replication controller \* [kubectl set](../kubectl\_set/) - Set specific features on objects \* [kubectl taint](../kubectl\_taint/) - Update the taints
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl.md
main
kubernetes
[ 0.03168373927474022, 0.0630301758646965, -0.036871202290058136, -0.0036349580623209476, -0.06043926998972893, -0.0073141357861459255, 0.01263851672410965, 0.018036236986517906, 0.03353218361735344, -0.024400152266025543, -0.030768005177378654, -0.15345285832881927, 0.060591135174036026, -0...
0.096023
- Manage the rollout of a resource \* [kubectl run](../kubectl\_run/) - Run a particular image on the cluster \* [kubectl scale](../kubectl\_scale/) - Set a new size for a deployment, replica set, or replication controller \* [kubectl set](../kubectl\_set/) - Set specific features on objects \* [kubectl taint](../kubectl\_taint/) - Update the taints on one or more nodes \* [kubectl top](../kubectl\_top/) - Display resource (CPU/memory) usage \* [kubectl uncordon](../kubectl\_uncordon/) - Mark node as schedulable \* [kubectl version](../kubectl\_version/) - Print the client and server version information \* [kubectl wait](../kubectl\_wait/) - Wait for a specific condition on one or many resources
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl.md
main
kubernetes
[ 0.022921385243535042, 0.04506707191467285, -0.009325683116912842, 0.018093908205628395, -0.008995135314762592, -0.03689003735780716, -0.036470890045166016, -0.019613653421401978, 0.013774244114756584, 0.04268635809421539, -0.010665095411241055, -0.07232458889484406, 0.015993276610970497, -...
0.193002
## {{% heading "synopsis" %}} Set values in the kuberc configuration file. Use --section to specify whether to set defaults or aliases. For defaults: Sets default flag values for kubectl commands. The --command flag should specify only the command (e.g., "get", "create", "set env"), not resources. For aliases: Creates command aliases with optional default flag values and arguments. Use --prependarg and --appendarg to include resources or other arguments. ``` kubectl alpha kuberc set --section (defaults|aliases) --command COMMAND ``` ## {{% heading "examples" %}} ``` # Set default output format for 'get' command kubectl alpha kuberc set --section defaults --command get --option output=wide # Set default output format for a subcommand kubectl alpha kuberc set --section defaults --command "set env" --option output=yaml # Create an alias 'getn' for 'get' command with prepended 'nodes' resource kubectl alpha kuberc set --section aliases --name getn --command get --prependarg nodes --option output=wide # Create an alias 'runx' for 'run' command with appended arguments kubectl alpha kuberc set --section aliases --name runx --command run --option image=nginx --appendarg "--" --appendarg custom-arg1 # Overwrite an existing default kubectl alpha kuberc set --section defaults --command get --option output=json --overwrite ``` ## {{% heading "options" %}} | --appendarg strings | | | --- | --- | | | Argument to append to the command (can be specified multiple times, for aliases only) | | --command string | | | | Command to configure (e.g., 'get', 'create', 'set env') | | -h, --help | | | | help for set | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --name string | | | | Alias name (required for --section=aliases) | | --option strings | | | | Flag option in the form flag=value (can be specified multiple times) | | --overwrite | | | | Allow overwriting existing entries | | --prependarg strings | | | | Argument to prepend to the command (can be specified multiple times, for aliases only) | | --section string | | | | Section to modify: 'defaults' or 'aliases' | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc_set.md
main
kubernetes
[ 0.0448588989675045, 0.011732328683137894, 0.016974342986941338, 0.027177968993782997, -0.07712975144386292, 0.04892124980688095, 0.021424878388643265, 0.038865234702825546, 0.027369549497961998, 0.010314498096704483, -0.06138857081532478, -0.09711786359548569, -0.04809810593724251, 0.00421...
0.020096
of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl alpha kuberc](../) - Manage kuberc configuration files
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc_set.md
main
kubernetes
[ -0.03437153249979019, 0.06823557615280151, -0.007333781570196152, -0.034392427653074265, -0.06088905781507492, -0.029408209025859833, -0.013309475965797901, -0.024331193417310715, 0.05661069601774216, -0.03195255994796753, -0.029940061271190643, -0.10893150418996811, 0.06616044789552689, -...
0.056279
## {{% heading "synopsis" %}} Manage user preferences (kuberc) file. The kuberc file allows you to customize your kubectl experience. ``` kubectl alpha kuberc SUBCOMMAND ``` ## {{% heading "examples" %}} ``` # View the current kuberc configuration kubectl alpha kuberc view # Set a default value for a command flag kubectl alpha kuberc set --section defaults --command get --option output=wide # Create an alias for a command kubectl alpha kuberc set --section aliases --name getn --command get --prependarg nodes --option output=wide ``` ## {{% heading "options" %}} | -h, --help | | | --- | --- | | | help for kuberc | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc.md
main
kubernetes
[ 0.007544784341007471, 0.044119298458099365, 0.03119918517768383, 0.042335204780101776, -0.05844685435295105, 0.005604445468634367, 0.03426070138812065, 0.07070430368185043, -0.022222192957997322, 0.007426036521792412, -0.042036108672618866, -0.10879290848970413, -0.03915685415267944, 0.016...
0.065463
Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl alpha](../) - Commands for features in alpha \* [kubectl alpha kuberc set](../kubectl\_alpha\_kuberc\_set/) - Set values in the kuberc configuration \* [kubectl alpha kuberc view](../kubectl\_alpha\_kuberc\_view/) - Display the current kuberc configuration
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc.md
main
kubernetes
[ 0.046189360320568085, 0.015242842957377434, -0.09272093325853348, 0.039898086339235306, -0.09882786870002747, -0.037760864943265915, -0.002066381275653839, 0.023394491523504257, 0.06635520607233047, 0.012981430627405643, 0.0027229173574596643, -0.07392732799053192, 0.0932922288775444, -0.0...
0.108872
## {{% heading "synopsis" %}} Display the contents of the kuberc file in the specified output format. ``` kubectl alpha kuberc view ``` ## {{% heading "examples" %}} ``` # View kuberc configuration in YAML format (default) kubectl alpha kuberc view # View kuberc configuration in JSON format kubectl alpha kuberc view --output json # View a specific kuberc file kubectl alpha kuberc view --kuberc /path/to/kuberc ``` ## {{% heading "options" %}} | --allow-missing-template-keys Default: true | | | --- | --- | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | -h, --help | | | | help for view | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | -o, --output string Default: "yaml" | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc_view.md
main
kubernetes
[ 0.0495263934135437, 0.0596529096364975, 0.007970328442752361, 0.0065103378146886826, 0.018347248435020447, 0.07690045982599258, -0.051011499017477036, 0.01799803040921688, 0.029232092201709747, -0.015742314979434013, 0.021030543372035027, -0.07981354743242264, -0.08687539398670197, -0.0067...
0.035295
(none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl alpha kuberc](../) - Manage kuberc configuration files
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/kubectl_alpha_kuberc_view.md
main
kubernetes
[ 0.051650598645210266, 0.027725959196686745, -0.07940535247325897, 0.033659059554338455, -0.0762205645442009, -0.0035025691613554955, -0.006195873487740755, 0.04319596663117409, 0.104925736784935, 0.034734707325696945, 0.021419452503323555, -0.047398265451192856, 0.004737084731459618, -0.08...
0.09102
## {{% heading "synopsis" %}} These commands correspond to alpha features that are not enabled in Kubernetes clusters by default. ## {{% heading "options" %}} | -h, --help | | | --- | --- | | | help for alpha | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/_index.md
main
kubernetes
[ 0.015876654535531998, 0.02086600288748741, -0.002661454025655985, 0.015093564987182617, -0.048369430005550385, -0.0017789221601560712, 0.1127801463007927, -0.017867816612124443, 0.01806255802512169, 0.02921619825065136, 0.008847879245877266, -0.08299542963504791, -0.037504974752664566, -0....
0.135231
| | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl](../kubectl/) - kubectl controls the Kubernetes cluster manager \* [kubectl alpha kuberc](kubectl\_alpha\_kuberc/) - Manage kuberc configuration files
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_alpha/_index.md
main
kubernetes
[ 0.009584134444594383, 0.05893579125404358, -0.0451614074409008, 0.016210177913308144, -0.0752422884106636, -0.004130548797547817, -0.0006646831752732396, 0.0204621534794569, 0.026123693212866783, -0.01146279089152813, -0.03863850235939026, -0.14664940536022186, 0.10551679879426956, -0.0064...
0.075742
## {{% heading "synopsis" %}} Attach to a process that is already running inside an existing container. ``` kubectl attach (POD | TYPE/NAME) -c CONTAINER ``` ## {{% heading "examples" %}} ``` # Get output from running pod mypod; use the 'kubectl.kubernetes.io/default-container' annotation # for selecting the container to be attached or the first container in the pod will be chosen kubectl attach mypod # Get output from ruby-container from pod mypod kubectl attach mypod -c ruby-container # Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client kubectl attach mypod -c ruby-container -i -t # Get output from the first pod of a replica set named nginx kubectl attach rs/nginx ``` ## {{% heading "options" %}} | -c, --container string | | | --- | --- | | | Container name. If omitted, use the kubectl.kubernetes.io/default-container annotation for selecting the container to be attached or the first container in the pod will be chosen | | -h, --help | | | | help for attach | | --pod-running-timeout duration Default: 1m0s | | | | The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running | | -q, --quiet | | | | Only print output from the remote session | | -i, --stdin | | | | Pass stdin to the container | | -t, --tty | | | | Stdin is a TTY | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_attach/_index.md
main
kubernetes
[ 0.0007940467912703753, 0.010648448951542377, 0.027381667867302895, 0.028100429102778435, -0.013926396146416664, 0.009593278169631958, 0.02164849452674389, 0.03612997755408287, 0.04727081581950188, 0.003273292677477002, -0.04651655629277229, -0.039721887558698654, -0.012631542049348354, 0.0...
0.096265
version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl](../kubectl/) - kubectl controls the Kubernetes cluster manager
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_attach/_index.md
main
kubernetes
[ -0.005788404028862715, 0.050656240433454514, -0.0457872599363327, -0.035500239580869675, -0.03771479055285454, -0.0038752099499106407, -0.010343235917389393, 0.05306752026081085, 0.047009874135255814, 0.006549444515258074, -0.0035247483756393194, -0.08366888016462326, 0.021895546466112137, ...
0.034284
## {{% heading "synopsis" %}} Update the user, group, or service account in a role binding or cluster role binding. ``` kubectl set subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none] ``` ## {{% heading "examples" %}} ``` # Update a cluster role binding for serviceaccount1 kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1 # Update a role binding for user1, user2, and group1 kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1 # Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | Select all resources, in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | Filename, directory, or URL to files the resource to update the subjects | | --group strings | | | | Groups to bind to the role | | -h, --help | | | | help for subject | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --local | | | | If true, set subject will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | -l, --selector string | | | | Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints. | | --serviceaccount strings | | | | Service accounts to bind to the role | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | | --user strings | | | | Usernames to bind to the role | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_subject.md
main
kubernetes
[ 0.005831613205373287, -0.0282781682908535, 0.017516333609819412, 0.007654497399926186, -0.0834212452173233, 0.0005710934055969119, 0.0491098091006279, -0.02657099813222885, -0.013705655932426453, 0.037883054465055466, 0.02501593716442585, -0.08524230867624283, 0.0476812981069088, -0.059617...
0.094907
UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_subject.md
main
kubernetes
[ -0.027950869873166084, 0.07020315527915955, -0.031159313395619392, 0.007974156178534031, -0.08190281689167023, -0.043915074318647385, 0.06654953956604004, -0.046956099569797516, 0.05773641914129257, -0.008207186125218868, 0.008768106810748577, -0.07830660045146942, 0.06719989329576492, -0....
0.122388
--version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_subject.md
main
kubernetes
[ 0.09184904396533966, 0.0930451825261116, 0.035301096737384796, 0.03388136625289917, 0.03885997086763382, 0.046556539833545685, -0.005656425841152668, -0.033391378819942474, -0.003075476735830307, -0.02105879783630371, -0.03818550333380699, -0.09917426109313965, -0.026806723326444626, -0.06...
0.086274
## {{% heading "synopsis" %}} Set the selector on a resource. Note that the new selector will overwrite the old selector if the resource had one prior to the invocation of 'set selector'. A selector must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters. If --resource-version is specified, then updates will use this resource version, otherwise the existing resource-version will be used. Note: currently selectors can only be set on Service objects. ``` kubectl set selector (-f FILENAME | TYPE NAME) EXPRESSIONS [--resource-version=version] ``` ## {{% heading "examples" %}} ``` # Set the labels and selector before creating a deployment/service pair kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f - kubectl create deployment my-dep --image=nginx -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f - ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | Select all resources in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | identifying the resource. | | -h, --help | | | | help for selector | | --local | | | | If true, annotation will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | -R, --recursive Default: true | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | --resource-version string | | | | If non-empty, the selectors update will only succeed if this is the current resource-version for the object. Only valid when specifying a single resource. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_selector.md
main
kubernetes
[ 0.0035618282854557037, 0.021574057638645172, 0.03604981303215027, 0.027536779642105103, 0.0020338809117674828, 0.060262445360422134, 0.04693332314491272, -0.049178797751665115, 0.048106398433446884, -0.0008024517446756363, -0.010734712705016136, -0.07384587079286575, -0.00693882443010807, ...
0.102019
multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_selector.md
main
kubernetes
[ -0.006623632274568081, 0.07749499380588531, -0.033167943358421326, -0.017366886138916016, -0.07581727206707001, -0.035028837621212006, 0.011660944670438766, -0.061435308307409286, 0.08950185775756836, -0.04240267723798752, 0.0068459706380963326, -0.08825704455375671, 0.06587448716163635, -...
0.04929
Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_selector.md
main
kubernetes
[ 0.08310151845216751, 0.10721972584724426, 0.03006727434694767, 0.08349555730819702, 0.020893733948469162, 0.03197191283106804, 0.03684517741203308, -0.026757216081023216, 0.0200607068836689, -0.02632865309715271, -0.05248437821865082, -0.14339596033096313, 0.02510879747569561, -0.063405506...
0.105004
## {{% heading "synopsis" %}} Update environment variables on a pod template. List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod templates (within replication controllers or deployment configurations). View or modify the environment variable definitions on all containers in the specified pods or pod templates, or just those that match a wildcard. If "--env -" is passed, environment variables can be read from STDIN using the standard env syntax. Possible resources include (case insensitive): pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs) ``` kubectl set env RESOURCE/NAME KEY\_1=VAL\_1 ... KEY\_N=VAL\_N ``` ## {{% heading "examples" %}} ``` # Update deployment 'registry' with a new environment variable kubectl set env deployment/registry STORAGE\_DIR=/local # List the environment variables defined on a deployments 'sample-build' kubectl set env deployment/sample-build --list # List the environment variables defined on all pods 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 STORAGE\_DIR=/data -o yaml # Update all containers in all replication controllers in the project to have ENV=prod kubectl set env rc --all ENV=prod # Import environment from a secret kubectl set env --from=secret/mysecret deployment/myapp # Import environment from a config map with a prefix kubectl set env --from=configmap/myconfigmap --prefix=MYSQL\_ deployment/myapp # Import specific keys from a config map kubectl set env --keys=my-example-key --from=configmap/myconfigmap deployment/myapp # Remove the environment variable ENV from container 'c1' in all deployment configs kubectl set env deployments --all --containers="c1" ENV- # Remove the environment variable ENV from a deployment definition on disk and # update the deployment config on the server kubectl set env -f deploy.json ENV- # Set some of the local shell environment into a deployment config on the server env | grep RAILS\_ | kubectl set env -e - deployment/registry ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | If true, select all resources in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | -c, --containers string Default: "\*" | | | | The names of containers in the selected pod templates to change - may use wildcards | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | -e, --env strings | | | | Specify a key-value pair for an environment variable to set into each container. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | Filename, directory, or URL to files the resource to update the env | | --from string | | | | The name of a resource from which to inject environment variables | | -h, --help | | | | help for env | | --keys strings | | | | Comma-separated list of keys to import from specified resource | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --list | | | | If true, display the environment and any changes in the standard format.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_env.md
main
kubernetes
[ 0.07443615794181824, -0.006293175742030144, 0.02995879389345646, -0.02231787145137787, -0.020632635802030563, 0.018969519063830376, -0.001032817061059177, 0.004355205222964287, -0.004306082148104906, 0.018949195742607117, -0.03698521852493286, -0.07579194754362106, 0.026165597140789032, -0...
0.101002
list of keys to import from specified resource | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --list | | | | If true, display the environment and any changes in the standard format. this flag will removed when we have kubectl view env. | | --local | | | | If true, set env will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | --overwrite Default: true | | | | If true, allow environment to be overwritten, otherwise reject updates that overwrite existing environment. | | --prefix string | | | | Prefix to append to variable names | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | --resolve | | | | If true, show secret or configmap references when listing variables | | -l, --selector string | | | | Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_env.md
main
kubernetes
[ 0.00029990889015607536, 0.025680620223283768, -0.02956542558968067, -0.07092979550361633, -0.035364195704460144, 0.022781265899538994, -0.02979826182126999, 0.0031608976423740387, 0.042120613157749176, -0.006266744341701269, 0.04656091704964638, -0.0729685127735138, -0.019692352041602135, ...
0.060688
gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_env.md
main
kubernetes
[ 0.008409831672906876, 0.03599579632282257, -0.04083748906850815, -0.01827988028526306, -0.03259401023387909, -0.004107408691197634, -0.030260156840085983, 0.017877375707030296, 0.05375130474567413, 0.018666550517082214, -0.0043438333086669445, -0.0775780975818634, -0.0033844471909105778, -...
0.019031
## {{% heading "synopsis" %}} Update the service account of pod template resources. Possible resources (case insensitive) can be: replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset ``` kubectl set serviceaccount (-f FILENAME | TYPE NAME) SERVICE\_ACCOUNT ``` ## {{% heading "examples" %}} ``` # Set deployment nginx-deployment's service account to serviceaccount1 kubectl set serviceaccount deployment nginx-deployment serviceaccount1 # Print the result (in YAML format) of updated nginx deployment with the service account from local file, without hitting the API server kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run=client -o yaml ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | Select all resources, in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | Filename, directory, or URL to files identifying the resource to get from a server. | | -h, --help | | | | help for serviceaccount | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --local | | | | If true, set serviceaccount will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_serviceaccount.md
main
kubernetes
[ -0.016532527282834053, -0.015184707939624786, 0.04069260135293007, -0.011603993363678455, -0.03252333402633667, -0.026578253135085106, 0.009805947542190552, -0.0381377749145031, 0.03666820377111435, 0.0740336924791336, -0.027160372585058212, -0.036227207630872726, 0.028881322592496872, -0....
0.089044
key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_serviceaccount.md
main
kubernetes
[ -0.007192269433289766, 0.045994505286216736, -0.009877822361886501, -0.010465309955179691, -0.07785813510417938, -0.010921267792582512, -0.027034664526581764, -0.0624106302857399, 0.07074820250272751, -0.025081468746066093, -0.03293460234999657, -0.10249360650777817, 0.03689102083444595, 0...
0.056877
## {{% heading "synopsis" %}} Specify compute resource requirements (CPU, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits. For each compute resource, if a limit is specified and a request is omitted, the request will default to the limit. Possible resources include (case insensitive): Use "kubectl api-resources" for a complete list of supported resources.. ``` kubectl set resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS] ``` ## {{% heading "examples" %}} ``` # Set a deployments nginx container cpu limits to "200m" and memory to "512Mi" kubectl set resources deployment nginx -c=nginx --limits=cpu=200m,memory=512Mi # Set the resource request and limits for all containers in nginx kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi # Remove the resource requests for resources on containers in nginx kubectl set resources deployment nginx --limits=cpu=0,memory=0 --requests=cpu=0,memory=0 # Print the result (in yaml format) of updating nginx container limits from a local, without hitting the server kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | Select all resources, in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | -c, --containers string Default: "\*" | | | | The names of containers in the selected pod templates to change, all containers are selected by default - may use wildcards | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | Filename, directory, or URL to files identifying the resource to get from a server. | | -h, --help | | | | help for resources | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --limits string | | | | The resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges. | | --local | | | | If true, set resources will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | --requests string | | | | The resource requirement requests for this container. For example, 'cpu=100m,memory=256Mi'. Note that server side components may assign requests depending on the server configuration, such as limit ranges. | | -l, --selector string | | | | Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_resources.md
main
kubernetes
[ 0.0015456436667591333, 0.09069506078958511, 0.033755432814359665, 0.02141818031668663, -0.06685079634189606, -0.02437000349164009, -0.025343356654047966, -0.0009701630915515125, 0.029894106090068817, 0.012081284075975418, -0.09725646674633026, -0.060191310942173004, -0.010736015625298023, ...
0.131119
'=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default:
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_resources.md
main
kubernetes
[ -0.004651756025850773, 0.1265418529510498, -0.02300233393907547, -0.012350451201200485, -0.030574988573789597, 0.039683956652879715, 0.06921277195215225, 0.005206710193306208, -0.041899923235177994, -0.06325065344572067, 0.0709170401096344, -0.07402363419532776, 0.03270678594708443, 0.0744...
0.008815
string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_resources.md
main
kubernetes
[ 0.0063154445961117744, 0.03393913060426712, -0.05750105902552605, -0.00902461912482977, -0.08417695015668869, -0.013254825957119465, -0.01512392982840538, 0.02813120186328888, 0.055049195885658264, -0.014622217044234276, -0.020045997574925423, -0.1338915079832077, 0.0871610939502716, -0.00...
0.087696
## {{% heading "synopsis" %}} Update existing container image(s) of resources. Possible resources include (case insensitive): pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs) ``` kubectl set image (-f FILENAME | TYPE NAME) CONTAINER\_NAME\_1=CONTAINER\_IMAGE\_1 ... CONTAINER\_NAME\_N=CONTAINER\_IMAGE\_N ``` ## {{% heading "examples" %}} ``` # Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox' kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1 # Update all deployments' and rc's nginx container's image to 'nginx:1.9.1' kubectl set image deployments,rc nginx=nginx:1.9.1 --all # Update image of all containers of daemonset abc to 'nginx:1.9.1' kubectl set image daemonset abc \*=nginx:1.9.1 # Print result (in yaml format) of updating nginx container image from local file, without hitting the server kubectl set image -f path/to/file.yaml nginx=nginx:1.9.1 --local -o yaml ``` ## {{% heading "options" %}} | --all | | | --- | --- | | | Select all resources, in the namespace of the specified resource types | | --allow-missing-template-keys Default: true | | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --field-manager string Default: "kubectl-set" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | Filename, directory, or URL to files identifying the resource to get from a server. | | -h, --help | | | | help for image | | -k, --kustomize string | | | | Process the kustomization directory. This flag can't be used together with -f or -R. | | --local | | | | If true, set image will NOT contact api-server but run locally. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | -l, --selector string | | | | Selector (label query) to filter on, supports '=', '==', '!=', 'in', 'notin'.(e.g. -l key1=value1,key2=value2,key3 in (value3)). Matching objects must satisfy all of the specified label constraints. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_image.md
main
kubernetes
[ -0.014163718558847904, 0.03508194908499718, 0.044626928865909576, -0.0029127774760127068, 0.008388474583625793, -0.03209076449275017, -0.00323055824264884, -0.023555386811494827, -0.013820753432810307, 0.039041224867105484, 0.00016525250975973904, -0.054409533739089966, 0.03688625618815422, ...
0.101406
for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_image.md
main
kubernetes
[ -0.006217104382812977, 0.06708744913339615, -0.042513374239206314, -0.006986198015511036, -0.078700490295887, -0.03318772837519646, 0.03506223484873772, -0.06233501434326172, 0.07908393442630768, -0.025834374129772186, 0.010642703622579575, -0.08386275172233582, 0.06841949373483658, -0.024...
0.055742
the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl set](../) - Set specific features on objects
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/kubectl_set_image.md
main
kubernetes
[ 0.06694894284009933, 0.08036544919013977, 0.03234875947237015, 0.07167654484510422, 0.04181043431162834, 0.03971438482403755, 0.005158836487680674, -0.012778732925653458, -0.002773682354018092, -0.0077356984838843346, -0.022789375856518745, -0.11457554250955582, 0.0015836064703762531, -0.0...
0.117607
## {{% heading "synopsis" %}} Configure application resources. These commands help you make changes to existing application resources. ``` kubectl set SUBCOMMAND ``` ## {{% heading "options" %}} | -h, --help | | | --- | --- | | | help for set | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/_index.md
main
kubernetes
[ -0.026027599349617958, 0.03138425201177597, 0.003801696002483368, -0.017819952219724655, -0.1126963421702385, -0.028942756354808807, 0.10785795003175735, 0.01096662413328886, 0.022066090255975723, 0.005237046163529158, -0.008518656715750694, -0.10543300211429596, -0.002860467880964279, -0....
0.085137
--storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl](../kubectl/) - kubectl controls the Kubernetes cluster manager \* [kubectl set env](kubectl\_set\_env/) - Update environment variables on a pod template \* [kubectl set image](kubectl\_set\_image/) - Update the image of a pod template \* [kubectl set resources](kubectl\_set\_resources/) - Update resource requests/limits on objects with pod templates \* [kubectl set selector](kubectl\_set\_selector/) - Set the selector on a resource \* [kubectl set serviceaccount](kubectl\_set\_serviceaccount/) - Update the service account of a resource \* [kubectl set subject](kubectl\_set\_subject/) - Update the user, group, or service account in a role binding or cluster role binding
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_set/_index.md
main
kubernetes
[ 0.0236787348985672, 0.05804344639182091, -0.0428994782269001, 0.02204752340912819, -0.05707494542002678, -0.006649624090641737, 0.01641649194061756, 0.03363355994224548, 0.023281216621398926, -0.009429195895791054, -0.027241995558142662, -0.14248378574848175, 0.09320332854986191, -0.004433...
0.092591
## {{% heading "synopsis" %}} Create and run a particular image in a pod. ``` kubectl run NAME --image=image [--env="key=value"] [--port=port] [--dry-run=server|client] [--overrides=inline-json] [--command] -- [COMMAND] [args...] ``` ## {{% heading "examples" %}} ``` # Start a nginx pod kubectl run nginx --image=nginx # Start a hazelcast pod and let the container expose port 5701 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 # Start a hazelcast pod and set environment variables "DNS\_DOMAIN=cluster" and "POD\_NAMESPACE=default" in the container kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS\_DOMAIN=cluster" --env="POD\_NAMESPACE=default" # Start a hazelcast pod and set labels "app=hazelcast" and "env=prod" in the container kubectl run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod" # Dry run; print the corresponding API objects without creating them kubectl run nginx --image=nginx --dry-run=client # Start a nginx pod, but overload the spec with a partial set of values parsed from JSON kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }' # Start a busybox pod and keep it in the foreground, don't restart it if it exits kubectl run -i -t busybox --image=busybox --restart=Never # Start the nginx pod using the default command, but use custom arguments (arg1 .. argN) for that command kubectl run nginx --image=nginx -- ... # Start the nginx pod using a different command and custom arguments kubectl run nginx --image=nginx --command -- ... ``` ## {{% heading "options" %}} | --allow-missing-template-keys Default: true | | | --- | --- | | | If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. | | --annotations strings | | | | Annotations to apply to the pod. | | --attach | | | | If true, wait for the Pod to start running, and then attach to the Pod as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. With '--restart=Never' the exit code of the container process is returned. | | --cascade string[="background"] Default: "background" | | | | Must be "background", "orphan", or "foreground". Selects the deletion cascading strategy for the dependents (e.g. Pods created by a ReplicationController). Defaults to background. | | --command | | | | If true and extra arguments are present, use them as the 'command' field in the container, rather than the 'args' field which is the default. | | --dry-run string[="unchanged"] Default: "none" | | | | Must be "none", "server", or "client". If client strategy, only print the object that would be sent, without sending it. If server strategy, submit server-side request without persisting the resource. | | --env strings | | | | Environment variables to set in the container. | | --expose --port | | | | If true, create a ClusterIP service associated with the pod. Requires --port. | | --field-manager string Default: "kubectl-run" | | | | Name of the manager used to track field ownership. | | -f, --filename strings | | | | to use to replace the resource. | | --force | | | | If true, immediately remove resources from API and bypass graceful deletion. Note that immediate deletion of some resources may result in inconsistency or data loss and requires confirmation. | | --grace-period int Default: -1 | | | | Period of time in seconds given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). | | -h, --help | | | | help for run | | --image string | | | | The image for
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_run/_index.md
main
kubernetes
[ 0.009208757430315018, 0.00749154994264245, 0.06312921643257141, 0.0009410834172740579, 0.009573196060955524, -0.0029583019204437733, -0.024033963680267334, -0.020115511491894722, 0.005941407755017281, 0.027858803048729897, -0.06253685057163239, -0.04585890844464302, -0.006549220997840166, ...
0.095281
given to the resource to terminate gracefully. Ignored if negative. Set to 1 for immediate shutdown. Can only be set to 0 when --force is true (force deletion). | | -h, --help | | | | help for run | | --image string | | | | The image for the container to run. | | --image-pull-policy string | | | | The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server. | | -k, --kustomize string | | | | Process a kustomization directory. This flag can't be used together with -f or -R. | | -l, --labels string | | | | Comma separated labels to apply to the pod. Will override previous values. | | --leave-stdin-open | | | | If the pod is started in interactive mode or with stdin, leave stdin open after the first attach completes. By default, stdin will be closed after the first attach completes. | | -o, --output string | | | | Output format. One of: (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file). | | --override-type string Default: "merge" | | | | The method used to override the generated object: json, merge, or strategic. | | --overrides string | | | | An inline JSON override for the generated object. If this is non-empty, it is used to override the generated object. Requires that the object supply a valid apiVersion field. | | --pod-running-timeout duration Default: 1m0s | | | | The length of time (like 5s, 2m, or 3h, higher than zero) to wait until at least one pod is running | | --port string | | | | The port that this container exposes. | | --privileged | | | | If true, run the container in privileged mode. | | -q, --quiet | | | | If true, suppress prompt messages. | | -R, --recursive | | | | Process the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory. | | --restart string Default: "Always" | | | | The restart policy for this Pod. Legal values [Always, OnFailure, Never]. | | --rm | | | | If true, delete the pod after it exits. Only valid when attaching to the container, e.g. with '--attach' or with '-i/--stdin'. | | --save-config | | | | If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future. | | --show-managed-fields | | | | If true, keep the managedFields when printing objects in JSON or YAML format. | | -i, --stdin | | | | Keep stdin open on the container in the pod, even if nothing is attached. | | --template string | | | | Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | | --timeout duration | | | | The length of time to wait before giving up on a delete, zero means determine a timeout from the size of the object | | -t, --tty | | | | Allocate a TTY for the container in the pod. | | --wait | | | | If true, wait for resources to be gone before returning. This waits for finalizers. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | |
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_run/_index.md
main
kubernetes
[ 0.020973950624465942, 0.07540198415517807, 0.014796195551753044, -0.014038294553756714, 0.002233605133369565, -0.010459141805768013, 0.03504857420921326, 0.0029146794695407152, 0.05044635385274887, 0.00789745431393385, 0.0026725733187049627, 0.008837570436298847, -0.04279620945453644, 0.01...
0.168598
| | Allocate a TTY for the container in the pod. | | --wait | | | | If true, wait for resources to be gone before returning. This waits for finalizers. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile string Default: "none" | | | | Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_run/_index.md
main
kubernetes
[ 0.022284774109721184, 0.06183194741606712, -0.003565968479961157, 0.002307473449036479, -0.03787445276975632, -0.05824054777622223, 0.08242938667535782, -0.016773240640759468, 0.017049476504325867, 0.021390199661254883, 0.03392072021961212, -0.045363880693912506, -0.03796253725886345, -0.0...
0.105209
| --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl](../kubectl/) - kubectl controls the Kubernetes cluster manager
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_run/_index.md
main
kubernetes
[ 0.02365819364786148, 0.07470757514238358, -0.025043269619345665, 0.017253169789910316, -0.0462014302611351, -0.024011678993701935, -0.0009415118838660419, 0.02196679078042507, 0.033910419791936874, -0.016501393169164658, -0.03083488903939724, -0.1537303477525711, 0.09546376764774323, -0.00...
0.071521
## {{% heading "synopsis" %}} Debug cluster resources using interactive debugging containers. 'debug' provides automation for common debugging tasks for cluster objects identified by resource and name. Pods will be used by default if no resource is specified. The action taken by 'debug' varies depending on what resource is specified. Supported actions include: \* Workload: Create a copy of an existing pod with certain attributes changed, for example changing the image tag to a new version. \* Workload: Add an ephemeral container to an already running pod, for example to add debugging utilities without restarting the pod. \* Node: Create a new pod that runs in the node's host namespaces and can access the node's filesystem. Note: When a non-root user is configured for the entire target Pod, some capabilities granted by debug profile may not work. ``` kubectl debug (POD | TYPE[[.VERSION].GROUP]/NAME) [ -- COMMAND [args...] ] ``` ## {{% heading "examples" %}} ``` # Create an interactive debugging session in pod mypod and immediately attach to it. kubectl debug mypod -it --image=busybox # Create an interactive debugging session for the pod in the file pod.yaml and immediately attach to it. # (requires the EphemeralContainers feature to be enabled in the cluster) kubectl debug -f pod.yaml -it --image=busybox # Create a debug container named debugger using a custom automated debugging image. kubectl debug --image=myproj/debug-tools -c debugger mypod # Create a copy of mypod adding a debug container and attach to it kubectl debug mypod -it --image=busybox --copy-to=my-debugger # Create a copy of mypod changing the command of mycontainer kubectl debug mypod -it --copy-to=my-debugger --container=mycontainer -- sh # Create a copy of mypod changing all container images to busybox kubectl debug mypod --copy-to=my-debugger --set-image=\*=busybox # Create a copy of mypod adding a debug container and changing container images kubectl debug mypod -it --copy-to=my-debugger --image=debian --set-image=app=app:debug,sidecar=sidecar:debug # Create an interactive debugging session on a node and immediately attach to it. # The container will run in the host namespaces and the host's filesystem will be mounted at /host kubectl debug node/mynode -it --image=busybox ``` ## {{% heading "options" %}} | --arguments-only | | | --- | --- | | | If specified, everything after -- will be passed to the new container as Args instead of Command. | | --attach | | | | If true, wait for the container to start running, and then attach as if 'kubectl attach ...' were called. Default false, unless '-i/--stdin' is set, in which case the default is true. | | -c, --container string | | | | Container name to use for debug container. | | --copy-to string | | | | Create a copy of the target Pod with this name. | | --custom string | | | | Path to a JSON or YAML file containing a partial container spec to customize built-in debug profiles. | | --env stringToString Default: [] | | | | Environment variables to set in the container. | | -f, --filename strings | | | | identifying the resource to debug | | -h, --help | | | | help for debug | | --image string | | | | Container image to use for debug container. | | --image-pull-policy string | | | | The image pull policy for the container. If left empty, this value will not be specified by the client and defaulted by the server. | | --keep-annotations | | | | If true, keep the original pod annotations.(This flag only works when used with '--copy-to') | | --keep-init-containers Default: true | | | | Run the init containers for the pod.
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_debug/_index.md
main
kubernetes
[ 0.05226361006498337, 0.012917999178171158, 0.06565951555967331, 0.07054957747459412, 0.06453857570886612, -0.06621953099966049, -0.05190586298704147, 0.004230550955981016, 0.008271463215351105, 0.048332709819078445, -0.016419006511569023, -0.10025586932897568, -0.025501392781734467, -0.058...
0.164423
value will not be specified by the client and defaulted by the server. | | --keep-annotations | | | | If true, keep the original pod annotations.(This flag only works when used with '--copy-to') | | --keep-init-containers Default: true | | | | Run the init containers for the pod. Defaults to true.(This flag only works when used with '--copy-to') | | --keep-labels | | | | If true, keep the original pod labels.(This flag only works when used with '--copy-to') | | --keep-liveness | | | | If true, keep the original pod liveness probes.(This flag only works when used with '--copy-to') | | --keep-readiness | | | | If true, keep the original pod readiness probes.(This flag only works when used with '--copy-to') | | --keep-startup | | | | If true, keep the original startup probes.(This flag only works when used with '--copy-to') | | --profile string Default: "legacy" | | | | Options are "legacy", "general", "baseline", "netadmin", "restricted" or "sysadmin". | | -q, --quiet | | | | If true, suppress informational messages. | | --replace | | | | When used with '--copy-to', delete the original Pod. | | --same-node | | | | When used with '--copy-to', schedule the copy of target Pod on the same node. | | --set-image stringToString Default: [] | | | | When used with '--copy-to', a list of name=image pairs for changing container images, similar to how 'kubectl set image' works. | | --share-processes Default: true | | | | When used with '--copy-to', enable process namespace sharing in the copy. | | -i, --stdin | | | | Keep stdin open on the container(s) in the pod, even if nothing is attached. | | --target string | | | | When using an ephemeral container, target processes in this container name. | | -t, --tty | | | | Allocate a TTY for the debugging container. | ## {{% heading "parentoptions" %}} | --as string | | | --- | --- | | | Username to impersonate for the operation. User could be a regular user or a service account in a namespace. | | --as-group strings | | | | Group to impersonate for the operation, this flag can be repeated to specify multiple groups. | | --as-uid string | | | | UID to impersonate for the operation. | | --as-user-extra strings | | | | User extras to impersonate for the operation, this flag can be repeated to specify multiple values for the same key. | | --cache-dir string Default: "$HOME/.kube/cache" | | | | Default cache directory | | --certificate-authority string | | | | Path to a cert file for the certificate authority | | --client-certificate string | | | | Path to a client certificate file for TLS | | --client-key string | | | | Path to a client key file for TLS | | --cluster string | | | | The name of the kubeconfig cluster to use | | --context string | | | | The name of the kubeconfig context to use | | --disable-compression | | | | If true, opt-out of response compression for all requests to the server | | --insecure-skip-tls-verify | | | | If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_debug/_index.md
main
kubernetes
[ 0.021483995020389557, 0.0047651370987296104, -0.008206593804061413, 0.013336051255464554, 0.0553789958357811, 0.01582304947078228, 0.047292560338974, -0.0295103769749403, 0.022761555388569832, 0.012096384540200233, 0.04090031981468201, -0.046609461307525635, -0.053612254559993744, 0.007005...
0.128025
checked for validity. This will make your HTTPS connections insecure | | --kubeconfig string | | | | Path to the kubeconfig file to use for CLI requests. | | --kuberc string | | | | Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL\_KUBERC=false feature gate or turning off the feature KUBERC=off. | | --match-server-version | | | | Require server version to match client version | | -n, --namespace string | | | | If present, the namespace scope for this CLI request | | --password string | | | | Password for basic authentication to the API server | | --profile-output string Default: "profile.pprof" | | | | Name of the file to write the profile to | | --request-timeout string Default: "0" | | | | The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. | | -s, --server string | | | | The address and port of the Kubernetes API server | | --storage-driver-buffer-duration duration Default: 1m0s | | | | Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction | | --storage-driver-db string Default: "cadvisor" | | | | database name | | --storage-driver-host string Default: "localhost:8086" | | | | database host:port | | --storage-driver-password string Default: "root" | | | | database password | | --storage-driver-secure | | | | use secure connection with database | | --storage-driver-table string Default: "stats" | | | | table name | | --storage-driver-user string Default: "root" | | | | database username | | --tls-server-name string | | | | Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used | | --token string | | | | Bearer token for authentication to the API server | | --user string | | | | The name of the kubeconfig user to use | | --username string | | | | Username for basic authentication to the API server | | --version version[=true] | | | | --version, --version=raw prints version information and quits; --version=vX.Y.Z... sets the reported version | | --warnings-as-errors | | | | Treat warnings received from the server as errors and exit with a non-zero exit code | ## {{% heading "seealso" %}} \* [kubectl](../kubectl/) - kubectl controls the Kubernetes cluster manager
https://github.com/kubernetes/website/blob/main//content/en/docs/reference/kubectl/generated/kubectl_debug/_index.md
main
kubernetes
[ -0.015058333054184914, 0.012317892163991928, -0.008506353944540024, -0.03959343209862709, -0.08391214162111282, -0.02113095112144947, -0.043360233306884766, -0.031085051596164703, 0.08433618396520615, -0.010729335248470306, -0.03176087141036987, -0.09902624040842056, 0.02752179652452469, 0...
-0.003528