Selected topic
Pod Management
Prefer practical output? Use related tools below while reading.
kubectl create or API calls to create a new pod.kubectl update or API calls.kubectl scale.kubectl delete or API calls.Here's an example YAML file (pod.yaml) for creating a pod:
yml
apiVersion: v1
kind: Pod
metadata:
name: web-app-pod
spec:
containers:
- name: web-server
image: nginx
- name: database
image: mysqlkubectl create or API calls:bash
kubectl create -f pod.yamlTo manage the life cycle of the pod, we can use various Kubernetes commands and APIs. For example:
kubectl get pod web-app-pod.kubectl update -f pod.yaml.kubectl scale deployment <deployment-name> --replicas=3.kubectl delete or API calls:bash
kubectl delete -f pod.yamlNote that in this example, we're using a YAML file to create and manage the pod. In real-world scenarios, you'd likely use Kubernetes' configuration management tools (e.g., Helm, Kustomize) to manage your applications.
This summary provides an overview of pod lifecycle management with examples of creating, updating, scaling, and deleting pods in Kubernetes.