Kubernetes Podマニフェスト

参考文献: Kubernetesマイクロサービス開発の実践 (早川博 著)


kubectl explain pod
kubectl api-resources


cat <<-'EOF' > pod.yaml

apiVersion: v1
kind: Pod
metadata:
  name: pod01
spec:
  containers:
  - name: con01
    image: nginx:1.23.4
    ports:
    - containerPort: 80
  - name: con02
    image: busybox
    command: ["/bin/sh"] 
    args: ["-c", "while true; do date >> ~/app.log; sleep 1; done"] 


EOF


kubectl apply -f pod.yaml
kubectl get pod

kubectl describe pod pod01
kubectl logs pod01
kubectl logs pod01 -c con01
kubectl logs pod01 -c con02
kubectl get events


kubectl delete -f pod.yaml