Imperativ
Beschreibung
Einfaches Beispiel in Kubernetes
kubectl run testpod --image=busybox
Fortgeschrittenes Beispiel in Kubernetes
kubectl run my-pod --image=busybox --restart=Never --overrides='{ "spec": { "containers": [ { "name": "my-container", "command": [ "/bin/sh", "-c", "echo 'Hello, World!' && sleep 3600" ] } ] } }'
Was sind die Vorteile?
Wofür ist es am besten geeignet?
Deklarativ
Beschreibung
Einfaches Beispiel in Kubernetes
Kubectl apply -f testpod.yaml
Testpod.yaml
apiVersion: v1
kind: Pod
metadata:
name: testpod
spec:
containers:
- name: busybox
image: busybox
Fortgeschrittenes Beispiel in Kubernetes
apiVersion: v1
kind: Pod
metadata:
name: my-pod
spec:
restartPolicy: Never
containers:
- name: my-container
image: busybox
command: ["/bin/sh", "-c", "echo 'Hello, World!' && sleep 3600"]
What is it best for?