Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed old trick to create pods with kubectl run #167

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions a.core_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

</p>
Expand All @@ -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
Expand Down Expand Up @@ -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 -
```

</p>
Expand Down Expand Up @@ -174,7 +174,7 @@ kubectl get po -A
<p>

```bash
kubectl run nginx --image=nginx --restart=Never --port=80
kubectl run nginx --image=nginx --port=80
```

</p>
Expand Down Expand Up @@ -345,15 +345,15 @@ kubectl get po # nowhere to be found :)
<p>

```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
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
```

</p>
Expand Down
2 changes: 1 addition & 1 deletion b.multi_container_pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions c.pod_design.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ kubernetes.io > Documentation > Concepts > Overview > [Labels and Selectors](htt
<p>

```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
```

</p>
Expand Down
20 changes: 10 additions & 10 deletions d.configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -232,7 +232,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Configu
<p>

```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
```

Expand Down Expand Up @@ -267,7 +267,7 @@ status: {}
<p>

```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
```

Expand Down Expand Up @@ -306,7 +306,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Assign
<p>

```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'
```

</p>
Expand Down Expand Up @@ -373,7 +373,7 @@ kubectl get secret mysecret2 -o jsonpath='{.data.username}{"\n"}' | base64 -d #
<p>

```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
```

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -515,14 +515,14 @@ kubectl create -f sa.yaml
<p>

```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
```

Expand Down
4 changes: 2 additions & 2 deletions e.observability.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ kubernetes.io > Documentation > Tasks > Configure Pods and Containers > [Configu
<p>

```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
```

Expand Down Expand Up @@ -96,7 +96,7 @@ kubectl delete -f pod.yaml
<p>

```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
```

Expand Down
2 changes: 1 addition & 1 deletion f.services.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p>

```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
```

Expand Down