Dataset Viewer
Auto-converted to Parquet Duplicate
text
stringlengths
1
1k
id
int64
0
8.58k
The Concepts section helps you learn about the parts of the Kubernetes system and the abstractions Kubernetes uses to represent your cluster , and helps you obtain a deeper understanding of how Kubernetes works. Overview Kubernetes is a portable, extensible, open source platform for managing containerized workloads and...
0
ces that Kubernetes provides for configuring Pods. Security Concepts for keeping your cloud-native workload secure. Policies Manage security and best-practices with policies. Scheduling, Preemption and Eviction In Kubernetes, scheduling refers to making sure that Pods are matched to Nodes so that the kubelet can run th...
1
Pods with higher Priority can schedule on Nodes. Eviction is the process of proactively terminating one or more Pods on resource-starved Nodes. Cluster Administration Lower-level detail relevant to creating or administering a Kubernetes cluster. Windows in Kubernetes Kubernetes supports nodes that run Microsoft Windows...
2
dely available. The name Kubernetes originates from Greek, meaning helmsman or pilot. K8s as an abbreviation results from counting the eight letters between the "K" and the "s". Google open- sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google's experience running production workloads at...
3
l server. But this did not scale as resources were underutilized, and it was expensive for organizations to maintain many physical servers. Virtualized deployment era: As a solution, virtualization was introduced. It allows you to run multiple Virtual Machines (VMs) on a single physical server's CPU. Virtualization al...
4
Virtualization allows better utilization of resources in a physical server and allows better scalability because an application can be added or updated easily, reduces hardware costs, and much more. With virtualization you can present a set of physical resources as a cluster of disposable virtual machines. Each VM is a...
5
iency of container image creation compared to VM image use. Continuous development, integration, and deployment: provides for reliable and frequent container image build and deployment with quick and efficient rollbacks (due to image immutability). Dev and Ops separation of concerns: create application container images...
6
cro-services: applications are broken into smaller, independent pieces and can be deployed and managed dynamically – not a monolithic stack running on one big single-purpose machine. Resource isolation: predictable application performance. Resource utilization: high efficiency and density. Why you need Kubernetes and w...
7
Kubernetes provides you with: Service discovery and load balancing Kubernetes can expose a container using the DNS name or using their own IP address. If traffic to a container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable. Storage orchestration Kubern...
8
rnetes can fit containers onto your nodes to make the best use of your resources. Self-healing Kubernetes restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check, and doesn't advertise them to clients until they are ready to serve. Secret and configurat...
9
Kubernetes cluster without changing upstream source code. What Kubernetes is not Kubernetes is not a traditional, all-inclusive PaaS (Platform as a Service) system. Since Kubernetes operates at the container level rather than at the hardware level, it provides some generally applicable features common to PaaS offerings...
10
r application. Continuous Integration, Delivery, and Deployment (CI/CD) workflows are determined by organization cultures and preferences as well as technical requirements. Does not provide application-level services, such as middleware (for example, message buses), data-processing frameworks (for example, Spark), data...
11
Such components can run on Kubernetes, and/or can be accessed by applications running on Kubernetes through portable mechanisms, such as the Open Service Broker . Does not dictate logging, monitoring, or alerting solutions. It provides some integrations as proof of concept, and mechanisms to collect and export metrics....
12
tate. It shouldn't matter how you get from A to C. Centralized control is also not required. This results in a system that is easier to use and more powerful, robust, resilient, and extensible. What's next Take a look at the Kubernetes Components Take a look at the The Kubernetes API Take a look at the Cluster Architec...
13
available to those applications The policies around how those applications behave, such as restart policies, upgrades, and fault-tolerance A Kubernetes object is a "record of intent"--once you create the object, the Kubernetes system will constantly work to ensure that object exists. By creating an object, you're effec...
14
makes the necessary Kubernetes API calls for you. You can also use the Kubernetes API directly in your own programs using one of the Client Libraries . Object spec and status Almost every Kubernetes object includes two nested object fields that govern the object's configuration: the object spec and the object status . ...
15
ng. The Kubernetes system reads the Deployment spec and starts three instances of your desired application--updating the status to match your spec. If any of those instances should fail (a status change), the Kubernetes system responds to the difference between spec and status by making a correction--in this case, star...
16
t the information from a manifest into JSON or another supported serialization format when making the API request over HTTP. Here's an example manifest that shows the required fields and object spec for a Kubernetes Deployment: application/deployment.yaml apiVersion : apps/v1 kind: Deployment metadata : name : ngin...
17
spec: containers : - name : nginx image : nginx:1.14.2 ports : - containerPort : 80 One way to create a Deployment using a manifest file like the one above is to use the kubectl apply command in the kubectl command-line interface, passing the .yaml file as an argument. Here's an ...
18
nested fields specific to that object. The Kubernetes API Reference can help you find the spec format for all of the objects you can create using Kubernetes. For example, see the spec field for the Pod API reference. For each Pod, the .spec field specifies the pod and its desired state (such as the container image n...
19
ation files. Server side field validation Starting with Kubernetes v1.25, the API server offers server side field validation that detects unrecognized or duplicate fields in an object. It provides all the functionality of kubectl -- validate on the server side. The kubectl tool uses the --validate flag to set the l...
20
Strict Strict field validation, errors on validation failure Warn Field validation is performed, but errors are exposed as warnings rather than failing the request Ignore No server side field validation is performed When kubectl cannot connect to an API server that supports field validation it will fall back to using ...
21
bjects in Kubernetes in more depth, read other pages in this section: Kubernetes Object Management Object Names and IDs Labels and Selectors Namespaces Annotations Field Selectors Finalizers Owners and Dependents Recommended Labels Kubernetes Object Management The kubectl command-line tool supports several different w...
22
Management techniqueOperates onRecommended environmentSupported writersLearning curve Imperative commands Live objects Development projects 1+ Lowest Imperative object configurationIndividual files Production projects 1 Moderate Declarative object configurationDirectories of filesProduction projects 1+ Highest Imperati...
23
ompared to object configuration: Commands do not integrate with change review processes. Commands do not provide an audit trail associated with changes. Commands do not provide a source of records except for what is live. Commands do not provide a template for creating new objects. Imperative object configuration In im...
24
rom the configuration by the cluster.• • • • •
25
Examples Create the objects defined in a configuration file: kubectl create -f nginx.yaml Delete the objects defined in two configuration files: kubectl delete -f nginx.yaml -f redis.yaml Update the objects defined in a configuration file by overwriting the live configuration: kubectl replace -f nginx.yaml Trade-offs A...
26
is more mature. Disadvantages compared to declarative object configuration: Imperative object configuration works best on files, not directories. Updates to live objects must be reflected in configuration files, or they will be lost during the next replacement. Declarative object configuration When using declarative o...
27
• • • • • •
28
Examples Process all object configuration files in the configs directory, and create or patch the live objects. You can first diff to see what changes are going to be made, and then apply: kubectl diff -f configs/ kubectl apply -f configs/ Recursively process directories: kubectl diff -R -f configs/ kubectl apply -R -...
29
rnetes Objects Using Configuration Files Declarative Management of Kubernetes Objects Using Configuration Files Declarative Management of Kubernetes Objects Using Kustomize Kubectl Command Reference Kubectl Book Kubernetes API Reference Object Names and IDs Each object in your cluster has a Name that is unique for th...
30
Names A client-provided string that refers to an object in a resource URL, such as /api/v1/pods/some- name . Only one object of a given kind can have a given name at a time. However, if you delete the object, you can make a new object with the same name. Names must be unique across all API versions of the same resourc...
31
ore than 253 characters contain only lowercase alphanumeric characters, '-' or '.' start with an alphanumeric character end with an alphanumeric character RFC 1123 Label Names Some resource types require their names to follow the DNS label standard as defined in RFC 1123. This means the name must: contain at most 63 ch...
32
Path Segment Names Some resource types require their names to be able to be safely encoded as a path segment. In other words, the name may not be "." or ".." and the name may not contain "/" or "%". Here's an example manifest for a Pod named nginx-demo . apiVersion : v1 kind: Pod metadata : name : nginx-demo spec: ...
33
electors Labels are key/value pairs that are attached to objects such as Pods. Labels are intended to be used to specify identifying attributes of objects that are meaningful and relevant to users, but do not directly imply semantics to the core system. Labels can be used to organize and to select subsets of objects....
34
Labels allow for efficient queries and watches and are ideal for use in UIs and CLIs. Non- identifying information should be recorded using annotations . Motivation Labels enable users to map their own organizational structures onto system objects in a loosely coupled fashion, without requiring clients to store these m...
35
: "daily" , "track" : "weekly" These are examples of commonly used labels ; you are free to develop your own conventions. Keep in mind that label Key must be unique for a given object. Syntax and character set Labels are key/value pairs. Valid label keys have two segments: an optional prefix and name, separated by a s...
36
The kubernetes.io/ and k8s.io/ prefixes are reserved for Kubernetes core components. Valid label value: must be 63 characters or less (can be empty), unless empty, must begin and end with an alphanumeric character ( [a-z0-9A-Z] ), could contain dashes ( -), underscores ( _), dots ( .), and alphanumerics between. Fo...
37
labels : environment : production app: nginx spec: containers : - name : nginx image : nginx:1.14.2 ports : - containerPort : 80 Label selectors Unlike names and UIDs , labels do not provide uniqueness. In general, we expect many objects to carry the same label(s). Via a label selector , the cli...
38
he controller can see that as conflicting instructions and fail to determine how many replicas should be present. Caution: For both equality-based and set-based conditions there is no logical OR (||) operator. Ensure your filter statements are structured accordingly. Equality-based requirement Equality- or inequalit...
39
d using the comma operator: environment=production,tier!=frontend One usage scenario for equality-based label requirement is for Pods to specify node selection criteria. For example, the sample Pod below selects nodes with the label " accelerator=nvidia- tesla-p100 ". apiVersion : v1 kind: Pod metadata
40
name : cuda-test spec: containers : - name : cuda-test image : "registry.k8s.io/cuda-vector-add:v0.1" resources : limits : nvidia.com/gpu : 1 nodeSelector : accelerator : nvidia-tesla-p100 Set-based requirement Set-based label requirements allow filtering keys according to a ...
41
ilarly the comma separator acts as an AND operator. So filtering resources with a partition key (no matter the value) and with environment different than qa can be achieved using partition,environment notin (qa) . The set-based label selector is a general form of equality since environment=production is equivalen...
42
Both label selector styles can be used to list or watch resources via a REST client. For example, targeting apiserver with kubectl and using equality-based one may write: kubectl get pods -l environment =production,tier =frontend or using set-based requirements: kubectl get pods -l 'environment in (production),tier...
43
also defined with a label selector. Label selectors for both objects are defined in json or yaml files using maps, and only equality- based requirement selectors are supported: "selector" : { "component" : "redis" , } or selector : component : redis This selector (respectively in json or yaml format) is equiv...
44
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions , whose key field is "key", the operator is "In", and the values array contains only "value". matchExpressions is a list of pod selector requirements. Valid operators include In,...
45
ions would use different values for the app label, but a multi-tier application, such as the guestbook example , would additionally need to distinguish each tier. The frontend could carry the following labels: labels : app: guestbook tier: frontend while the Redis master and replica would have different tier labels...
46
1/1 Running 0 1m guestbook frontend <none> guestbook-redis-master-5pg3b 1/1 Running 0 1m guestbook backend master guestbook-redis-replica-2q2yf 1/1 Running 0 1m guestbook backend replica guestbook-redis-replica-qgazl 1/1 Running 0 1m...
47
my-nginx-divi2 1/1 Running 0 29m nginx <none> <none> my-nginx-o0ef1 1/1 Running 0 29m nginx <none> <none> kubectl get pods -lapp =guestbook,role =replica NAME READY STATUS RESTARTS AGE guestbook-redis-repli...
48
READY STATUS RESTARTS AGE TIER my-nginx-2035384211-j5fhi 1/1 Running 0 23m fe my-nginx-2035384211-u2c7e 1/1 Running 0 23m fe my-nginx-2035384211-u3t6x 1/1 Running 0 23m fe This outputs all "app=nginx" pods, with an additional labe...
49
orageClass, Nodes, PersistentVolumes, etc) .• • • •
50
When to Use Multiple Namespaces Namespaces are intended for use in environments with many users spread across multiple teams, or projects. For clusters with a few to tens of users, you should not need to create or think about namespaces at all. Start using namespaces when you need the features they provide. Namespaces ...
51
ur initial namespaces: default Kubernetes includes this namespace so that you can start using your new cluster without first creating a namespace. kube-node-lease This namespace holds Lease objects associated with each node. Node leases allow the kubelet to send heartbeats so that the control plane can detect node fa...
52
mespaces in a cluster using: kubectl get namespac
53
NAME STATUS AGE default Active 1d kube-node-lease Active 1d kube-public Active 1d kube-system Active 1d Setting the namespace for a request To set the namespace for a current request, use the --namespace flag. For example: kubectl run nginx --image =nginx --namespace =<in...
54
tion across multiple namespaces such as Development, Staging and Production. If you want to reach across namespaces, you need to use the fully qualified domain name (FQDN). As a result, all namespace names must be valid RFC 1123 DNS labels . Warning: By creating namespaces with the same name as public top-level domains...
55
s in a namespace. And low-level resources, such as nodes and persistentVolumes , are not in any namespace. To see which Kubernetes resources are and aren't in a namespace
56
# In a namespace kubectl api-resources --namespaced =true # Not in a namespace kubectl api-resources --namespaced =false Automatic labelling FEATURE STATE: Kubernetes 1.22 [stable] The Kubernetes control plane sets an immutable label kubernetes.io/metadata.name on all namespaces. The value of the label is the namesp...
57
tted by labels. It is possible to use labels as well as annotations in the metadata of the same object. Annotations, like labels, are key/value maps: "metadata" : { "annotations" : { "key1" : "value1" , "key2" : "value2" } } Note: The keys and the values in the map must be strings. In other words, you ca...
58
Build, release, or image information like timestamps, release IDs, git branch, PR numbers, image hashes, and registry address. Pointers to logging, monitoring, analytics, or audit repositories. Client library or tool information that can be used for debugging purposes: for example, name, version, and build information....
59
x and character set Annotations are key/value pairs. Valid annotation keys have two segments: an optional prefix and name, separated by a slash ( /). The name segment is required and must be 63 characters or less, beginning and ending with an alphanumeric character ( [a-z0-9A-Z] ) with dashes ( -), underscores ( _), d...
60
tps:// hub.docker.com/ : apiVersion : v1 kind: Pod metadata : name : annotations-demo annotations : imageregistry : "https://hub.docker.com/" spec: containers : - name : nginx image : nginx:1.14.2 ports : - containerPort : 80• • • • • •
61
What's next Learn more about Labels and Selectors . Find Well-known labels, Annotations and Taints Field Selectors Field selectors let you select Kubernetes objects based on the value of one or more resource fields. Here are some examples of field selector queries: metadata.name=my-service metadata.namespace!=default...
62
et ingress --field-selector foo.bar =baz Error from server (BadRequest): Unable to find "ingresses" that match label selector "", field selector "foo.bar=baz": "foo.bar" is not a known field selector: only "metadata.name", "metadata.namespace" Supported operators You can use the =, ==, and != operators with field sel...
63
kubectl get pods --field-selector =status.phase! =Running,spec.restartPolicy =Always Multiple resource types You can use field selectors across multiple resource types. This kubectl command selects all Statefulsets and Services that are not in the default namespace: kubectl get statefulsets,services --all-namespaces ...
64
e, the controller removes the relevant finalizers from the target object. When the metadata.finalizers field is empty, Kubernetes considers the deletion complete and deletes the object. You can use finalizers to control garbage collection of resources. For example, you can define a finalizer to clean up related resou...
65
st notices the values in the finalizers field and does the following: Modifies the object to add a metadata.deletionTimestamp field with the time you started the deletion. Prevents the object from being removed until all items are removed from its metadata.finalizers field Returns a 202 status code (HTTP "Accepted"...
66
set is automatically deleted. You can also use finalizers to prevent deletion of unmanaged resources. A common example of a finalizer is kubernetes.io/pv-protection , which prevents accidental deletion of PersistentVolume objects. When a PersistentVolume object is in use by a Pod, Kubernetes adds the pv-protection f...
67
t once it is set. After the deletion is requested, you can not resurrect this object. The only way is to delete it and make a new similar object. Owner references, labels, and finalizers Like labels , owner references describe the relationships between objects in Kubernetes, but are used for a different purpose. When ...
68
he deletion of dependent objects, which can cause the targeted owner object to remain for longer than expected without being fully deleted. In these situations, you should check finalizers and owner references on the target owner and dependent objects to troubleshoot the cause. Note: In cases where objects are stuck i...
69
Owners and Dependents In Kubernetes, some objects are owners of other objects. For example, a ReplicaSet is the owner of a set of Pods. These owned objects are dependents of their owner. Ownership is different from the labels and selectors mechanism that some resources also use. For example, consider a Service tha...
70
ts that are dependents of other objects like ReplicaSets, DaemonSets, Deployments, Jobs and CronJobs, and ReplicationControllers. You can also configure these relationships manually by changing the value of this field. However, you usually don't need to and can allow Kubernetes to automatically manage the relationships...
71
rom delaying owner object deletion. Note: Cross-namespace owner references are disallowed by design. Namespaced dependents can specify cluster-scoped or namespaced owners. A namespaced owner must exist in the same namespace as the dependent. If it does not, the owner reference is treated as absent, and the dependent i...
72
lector=reason=OwnerRefInvalidNamespace
73
Ownership and finalizers When you tell Kubernetes to delete a resource, the API server allows the managing controller to process any finalizer rules for the resource. Finalizers prevent accidental deletion of resources your cluster may still need to function correctly. For example, if you try to delete a PersistentV...
74
olicy, Kubernetes adds the orphan finalizer so that the controller ignores dependent resources after it deletes the owner object. What's next Learn more about Kubernetes finalizers . Learn about garbage collection . Read the API reference for object metadata . Recommended Labels You can visualize and manage Kubernete...
75
en't required for any core tooling. Shared labels and annotations share a common prefix: app.kubernetes.io . Labels without a prefix are private to users. The shared prefix ensures that shared labels do not interfere with custom user labels. Labels In order to take full advantage of using these labels, they should be a...
76
Key Description Example Type app.kubernetes.io/name The name of the application mysql string app.kubernetes.io/ instanceA unique name identifying the instance of an applicationmysql- abcxzystring app.kubernetes.io/ versionThe current version of the application (e.g., a SemVer 1.0 , revision hash, etc.)5.7.21 string ap...
77
ed-by : helm Applications And Instances Of Applications An application can be installed one or more times into a Kubernetes cluster and, in some cases, the same namespace. For example, WordPress can be installed more than once where different websites are different installations of WordPress. The name of an application...
78
rm. The Deployment is used to oversee the pods running the application itself
79
apiVersion : apps/v1 kind: Deployment metadata : labels : app.kubernetes.io/name : myservice app.kubernetes.io/instance : myservice-abcxzy ... The Service is used to expose the application. apiVersion : v1 kind: Service metadata : labels : app.kubernetes.io/name : myservice app.kubernetes.io/instan...
80
se WordPress: apiVersion : v1 kind: Service metadata : labels : app.kubernetes.io/name : wordpress app.kubernetes.io/instance : wordpress-abcxzy app.kubernetes.io/version : "4.9.4" app.kubernetes.io/managed-by : helm app.kubernetes.io/component : server app.kubernetes.io/part-of : wordpress ..
81
MySQL is exposed as a StatefulSet with metadata for both it and the larger application it belongs to: apiVersion : apps/v1 kind: StatefulSet metadata : labels : app.kubernetes.io/name : mysql app.kubernetes.io/instance : mysql-abcxzy app.kubernetes.io/version : "5.7.21" app.kubernetes.io/managed-by :...
82
of the control plane and a set of machines called nodes. When you deploy Kubernetes, you get a cluster. A Kubernetes cluster consists of a set of worker machines, called nodes , that run containerized applications. Every cluster has at least one worker node. The worker node(s) host the Pods that are the components of...
83
Control Plane Components The control plane's components make global decisions about the cluster (for example, scheduling), as well as detecting and responding to cluster events (for example, starting up a new pod when a Deployment's replicas field is unsatisfied). Control plane components can be run on any machine in ...
84
er and balance traffic between those instances. etcd Consistent and highly-available key value store used as Kubernetes' backing store for all cluster data. If your Kubernetes cluster uses etcd as its backing store, make sure you have a back up plan for the data. You can find in-depth information about etcd in the off...
85
ollers. Some examples of them are: Node controller: Responsible for noticing and responding when nodes go down. Job controller: Watches for Job objects that represent one-off tasks, then creates Pods to run those tasks to completion.•
86
EndpointSlice controller: Populates EndpointSlice objects (to provide a link between Services and Pods). ServiceAccount controller: Create default ServiceAccounts for new namespaces. The above is not an exhaustive list. cloud-controller-manager A Kubernetes control plane component that embeds cloud-specific control lo...
87
han one copy) to improve performance or to help tolerate failures. The following controllers can have cloud provider dependencies: Node controller: For checking the cloud provider to determine if a node has been deleted in the cloud after it stops responding Route controller: For setting up routes in the underlying clo...
88
art of the Kubernetes Service concept. kube-proxy maintains network rules on nodes. These network rules allow network communication to your Pods from network sessions inside or outside of your cluster. kube-proxy uses the operating system packet filtering layer if there is one and it's available. Otherwise, kube-prox...
89
Container runtime A fundamental component that empowers Kubernetes to run containers effectively. It is responsible for managing the execution and lifecycle of containers within the Kubernetes environment. Kubernetes supports container runtimes such as containerd , CRI-O , and any other implementation of the Kubernetes...
90
lly include this DNS server in their DNS searches. Web UI (Dashboard) Dashboard is a general purpose, web-based UI for Kubernetes clusters. It allows users to manage and troubleshoot applications running in the cluster, as well as the cluster itself. Container Resource Monitoring Container Resource Monitoring records...
91
What's next Learn more about the following: Nodes and their communication with the control plane. Kubernetes controllers . kube-scheduler which is the default scheduler for Kubernetes. Etcd's official documentation . Several container runtimes in Kubernetes. Integrating with cloud providers using cloud-controller-m...
92
and Events). Most operations can be performed through the kubectl command-line interface or other command-line tools, such as kubeadm , which in turn use the API. However, you can also access the API directly using REST calls. Kubernetes provides a set of client libraries for those looking to write applications usin...
93
vailable resources and it does not detail specific schema for the resources. For reference about resource schemas, please refer to the OpenAPI document. The Kubernetes OpenAPI Document provides (full) OpenAPI v2.0 and 3.0 schemas for all Kubernetes API endpoints. The OpenAPI v3 is the preferred method for accessing O...
94
Discovery API Kubernetes publishes a list of all group versions and resources supported via the Discovery API. This includes the following for each resource: Name Cluster or namespaced scope Endpoint URL and supported verbs Alternative names Group, version, kind The API is available both aggregated and unaggregated for...
95
hout indicating the resource type using the Accept header, the default response for the /api and /apis endpoint is an unaggregated discovery document. The discovery document for the built-in resources can be found in the Kubernetes GitHub repository. This Github document can be used as a reference of the base set of...
96
} ], "preferredVersion": { "groupVersion": "apiregistration.k8s.io/v1", "version": "v1" } }, { "name": "apps", "versions": [ { "groupVersion": "apps/v1", "version": "v1" } ], "preferredVersion": { "groupVersion...
97
epresentation of Kubernetes resources. Due to limitations of OpenAPI version 2, certain fields are dropped from the published OpenAPI including but not limited to default , nullable , oneOf . OpenAPI V2 The Kubernetes API server serves an aggregated OpenAPI v2 spec via the /openapi/v2 endpoint. You can request the resp...
98
OpenAPI V3 FEATURE STATE: Kubernetes v1.27 [stable] Kubernetes supports publishing a description of its APIs as OpenAPI v3. A discovery endpoint /openapi/v3 is provided to see a list of all group/versions available. This endpoint only returns JSON. These group/versions are provided in the following format: { "pat...
99
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
6