diff --git a/a.core_concepts.md b/a.core_concepts.md index b25b5941..ae22cd39 100644 --- a/a.core_concepts.md +++ b/a.core_concepts.md @@ -18,7 +18,7 @@ kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > [Use ```bash kubectl create namespace mynamespace -kubectl run nginx --image=nginx --restart=Never -n mynamespace +kubectl run nginx --image=nginx -n mynamespace ```
@@ -32,7 +32,7 @@ kubectl run nginx --image=nginx --restart=Never -n mynamespace Easily generate YAML with: ```bash -kubectl run nginx --image=nginx --restart=Never --dry-run=client -n mynamespace -o yaml > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -n mynamespace -o yaml > pod.yaml ``` ```bash @@ -65,7 +65,7 @@ kubectl create -f pod.yaml -n mynamespace Alternatively, you can run in one line ```bash -kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml | kubectl create -n mynamespace -f - +kubectl run nginx --image=nginx --dry-run=client -o yaml | kubectl create -n mynamespace -f - ``` @@ -174,7 +174,7 @@ kubectl get po -A```bash -kubectl run nginx --image=nginx --restart=Never --port=80 +kubectl run nginx --image=nginx --port=80 ```
@@ -345,7 +345,7 @@ kubectl get po # nowhere to be found :)```bash -kubectl run nginx --image=nginx --restart=Never --env=var1=val1 +kubectl run nginx --image=nginx --env=var1=val1 # then kubectl exec -it nginx -- env # or @@ -353,7 +353,7 @@ kubectl exec -it nginx -- sh -c 'echo $var1' # or kubectl describe po nginx | grep val1 # or -kubectl run nginx --restart=Never --image=nginx --env=var1=val1 -it --rm -- env +kubectl run nginx --image=nginx --env=var1=val1 -it --rm -- env ```
diff --git a/b.multi_container_pods.md b/b.multi_container_pods.md index 0ba26653..fd6bf18b 100644 --- a/b.multi_container_pods.md +++ b/b.multi_container_pods.md @@ -58,7 +58,7 @@ kubectl delete po busybox Easiest way to do it is create a pod with a single container and save its definition in a YAML file: ```bash -kubectl run web --image=nginx --restart=Never --port=80 --dry-run=client -o yaml > pod-init.yaml +kubectl run web --image=nginx --port=80 --dry-run=client -o yaml > pod-init.yaml ``` Copy/paste the container related values, so your final YAML should contain the volume and the initContainer: diff --git a/c.pod_design.md b/c.pod_design.md index fe61b7fa..2b9b6281 100644 --- a/c.pod_design.md +++ b/c.pod_design.md @@ -10,9 +10,9 @@ kubernetes.io > Documentation > Concepts > Overview > [Labels and Selectors](htt```bash -kubectl run nginx1 --image=nginx --restart=Never --labels=app=v1 -kubectl run nginx2 --image=nginx --restart=Never --labels=app=v1 -kubectl run nginx3 --image=nginx --restart=Never --labels=app=v1 +kubectl run nginx1 --image=nginx --labels=app=v1 +kubectl run nginx2 --image=nginx --labels=app=v1 +kubectl run nginx3 --image=nginx --labels=app=v1 ```
diff --git a/d.configuration.md b/d.configuration.md index ccd5e917..9cb27144 100644 --- a/d.configuration.md +++ b/d.configuration.md @@ -96,7 +96,7 @@ kubectl get cm configmap4 -o yaml ```bash kubectl create cm options --from-literal=var5=val5 -kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml vi pod.yaml ``` @@ -140,7 +140,7 @@ kubectl exec -it nginx -- env | grep option # will show 'option=val5' ```bash kubectl create configmap anotherone --from-literal=var6=val6 --from-literal=var7=val7 -kubectl run --restart=Never nginx --image=nginx -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx -o yaml --dry-run=client > pod.yaml vi pod.yaml ``` @@ -181,7 +181,7 @@ kubectl exec -it nginx -- env ```bash kubectl create configmap cmvolume --from-literal=var8=val8 --from-literal=var9=val9 -kubectl run nginx --image=nginx --restart=Never -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx -o yaml --dry-run=client > pod.yaml vi pod.yaml ``` @@ -232,7 +232,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Configu```bash -kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml vi pod.yaml ``` @@ -267,7 +267,7 @@ status: {}
```bash -kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml vi pod.yaml ``` @@ -306,7 +306,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Assign
```bash -kubectl run nginx --image=nginx --restart=Never --requests='cpu=100m,memory=256Mi' --limits='cpu=200m,memory=512Mi' +kubectl run nginx --image=nginx --requests='cpu=100m,memory=256Mi' --limits='cpu=200m,memory=512Mi' ```
@@ -373,7 +373,7 @@ kubectl get secret mysecret2 -o jsonpath='{.data.username}{"\n"}' | base64 -d #```bash -kubectl run nginx --image=nginx --restart=Never -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx -o yaml --dry-run=client > pod.yaml vi pod.yaml ``` @@ -420,7 +420,7 @@ cat /etc/foo/username # shows admin ```bash kubectl delete po nginx -kubectl run nginx --image=nginx --restart=Never -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx -o yaml --dry-run=client > pod.yaml vi pod.yaml ``` @@ -515,14 +515,14 @@ kubectl create -f sa.yaml
```bash -kubectl run nginx --image=nginx --restart=Never --serviceaccount=myuser -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx --serviceaccount=myuser -o yaml --dry-run=client > pod.yaml kubectl apply -f pod.yaml ``` or you can add manually: ```bash -kubectl run nginx --image=nginx --restart=Never -o yaml --dry-run=client > pod.yaml +kubectl run nginx --image=nginx -o yaml --dry-run=client > pod.yaml vi pod.yaml ``` diff --git a/e.observability.md b/e.observability.md index f7ad8bef..85007c98 100644 --- a/e.observability.md +++ b/e.observability.md @@ -11,7 +11,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Configu
```bash -kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml vi pod.yaml ``` @@ -96,7 +96,7 @@ kubectl delete -f pod.yaml
```bash -kubectl run nginx --image=nginx --dry-run=client -o yaml --restart=Never --port=80 > pod.yaml +kubectl run nginx --image=nginx --dry-run=client -o yaml --port=80 > pod.yaml vi pod.yaml ``` diff --git a/f.services.md b/f.services.md index 1ebc85fd..aabb1d25 100644 --- a/f.services.md +++ b/f.services.md @@ -7,7 +7,7 @@
```bash -kubectl run nginx --image=nginx --restart=Never --port=80 --expose +kubectl run nginx --image=nginx --port=80 --expose # observe that a pod as well as a service are created ```