Difference between revisions of "Pod (Kubernetes)"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
 
(43 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Kubernetes Pods<ref>https://kubernetes.io/docs/concepts/workloads/pods/pod/</ref><ref>https://en.wikipedia.org/wiki/Kubernetes#Pods</ref> are the smallest deployable units that allows to deploy one or multiple [[containers]] as a single atomic unit. Pods are defined using <code>[[kubectl apply]]</code> command.
+
Kubernetes Pods <ref>https://kubernetes.io/docs/concepts/workloads/pods/pod/</ref><ref>https://en.wikipedia.org/wiki/Kubernetes#Pods</ref> are the smallest deployable units that allows to deploy one or multiple [[containers]] as a single atomic unit. Pods are defined using <code>[[YAML]]</code> files and applied with <code>[[kubectl apply]]</code> command.
  
 
== Pod related commands ==
 
== Pod related commands ==
 
* <code>[[kubectl apply]]</code>
 
* <code>[[kubectl apply]]</code>
* <code>[[kubectl create]]</code>
+
* <code>[[kubectl create]] -f [[mypod.yml]]</code>
* Get a list of pods
+
* Get a list of pods:
 
::: <code>[[kubectl get pods]]</code>
 
::: <code>[[kubectl get pods]]</code>
*<code>[[kubectl get]] pod MY_POD_NAME</code>
+
* <code>[[kubectl get pod]] MY_POD_NAME</code>
 
* <code>[[kubectl delete]] pod MY_POD_NAME</code>
 
* <code>[[kubectl delete]] pod MY_POD_NAME</code>
 
* <code>[[kubectl top pod]] PODNAME</code>
 
* <code>[[kubectl top pod]] PODNAME</code>
 +
* Get more information about a pod:
 +
:::<code>[[kubectl describe]] pod MY_POD_NAME</code>
 +
* List all container by pod:
 +
::<code>[[kubectl get pods]] -o [[jsonpath]]='{range .items[*]}{"pod: "}{.metadata.name}{"\n"}{range .spec.containers[*]}{"\tname: "}{.name}{"\n\timage: "}{.image}{"\n"}{end}'</code>
 +
 +
 +
 +
See also <code>[[ReplicaSet]]</code><ref>https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/</ref> concept.
  
 
== Activities ==
 
== Activities ==
# [[CKAD]]: [[Create and configure a basic Pod]]: <code>[[kubectl apply]]</code>
+
# [[CKA v1.28]]: [[Understand connectivity between Pods]]
# Create a pod network: <code>[[kubeadm]] init --pod-network-cidr=10.244.0.0/16</code>
+
# [[CKA v1.15]]: [[Create and configure a basic Pod]]: <code>[[kubectl apply]]</code>
# [[CKAD]]: Understand how to use [[Labels]], [[Selector]] and [[Annotations]]  
+
# Create a [[pod network]]: <code>[[kubeadm init]] --pod-network-cidr=10.244.0.0/16</code>
# [[CKAD]]: Understand Deployments and how to perform [[rolling updates]]
+
# [[Mark a pod as critical]]: https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical
# [[CKAD]]: Understand Deployments and how to perform [[rollbacks]]
+
 
 +
== Related terms ==
 +
* <code>[[kind: Pod]]</code>
 +
* <code>[[podman pod stats]]</code>
 +
* <code>[[kubernetes.io]]/pod/volume/utilization</code>
 +
* [[List containers on a POD]]
 +
* <code>[[readinessProbe]], [[livenessProbe]]</code>
 +
* <code>[[kubectl exec --stdin --tty]]</code>
 +
* [[Kubernetes Container Lifecycle Events]]
 +
* [[Kubernetes pod affinity and anti affinity‎‎]]
 +
* [[Kubernetes, env:]]
 +
* [[Pod Security]]: [[Kyverno]]
 +
* <code>[[SecurityContext]]</code>
 +
* <code>[[Error creating: pods]]</code>
 +
* [[PodReadyToStartContainers]]
  
 
== See also ==
 
== See also ==
 
* {{Pods}}
 
* {{Pods}}
* {{kubectl}}
 
 
* {{CKAD}}
 
* {{CKAD}}
* {{K8s}}
 
  
 
[[Category:Cloud computing]]
 
[[Category:Cloud computing]]
 
[[Category:CKAD]]
 
[[Category:CKAD]]

Latest revision as of 16:10, 29 February 2024

Kubernetes Pods [1][2] are the smallest deployable units that allows to deploy one or multiple containers as a single atomic unit. Pods are defined using YAML files and applied with kubectl apply command.

Pod related commands[edit]

kubectl get pods
kubectl describe pod MY_POD_NAME
  • List all container by pod:
kubectl get pods -o jsonpath='{range .items[*]}{"pod: "}{.metadata.name}{"\n"}{range .spec.containers[*]}{"\tname: "}{.name}{"\n\timage: "}{.image}{"\n"}{end}'


See also ReplicaSet[3] concept.

Activities[edit]

  1. CKA v1.28: Understand connectivity between Pods
  2. CKA v1.15: Create and configure a basic Pod: kubectl apply
  3. Create a pod network: kubeadm init --pod-network-cidr=10.244.0.0/16
  4. Mark a pod as critical: https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical

Related terms[edit]

See also[edit]

  • https://kubernetes.io/docs/concepts/workloads/pods/pod/
  • https://en.wikipedia.org/wiki/Kubernetes#Pods
  • https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
  • Advertising: