K8s Pods - philipf/notebook GitHub Wiki
apiVersion: v1
kind: Pod
metadata:
name: my-pod
labels:
app: myapp
spec:
containers:
- name: myapp-container
image: busybox
command: ['sh', '-c', 'echo Hello Kubernetes! && sleep 3600']
kubectl create -f my-pod.yml
kubectl apply -f my-pod.yml
kubectl edit pod my-pod
kubectl delete pod my-pod
kubectl get namespaces
kubectl get pods -n default
kubectl create <namespace>
kubectl delete <namespace>
See namespace
section
metadata:
name: my-pod
namespace: my-namespace
labels:
app: myapp