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

More shortcuts #151

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 12 additions & 0 deletions a.core_concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > [Use

```bash
kubectl create namespace mynamespace
kubectl create ns mynamespace
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since it's the same command as the one in the previous line, can you add it with an explanatory comment?

kubectl run nginx --image=nginx --restart=Never -n mynamespace
```

Expand All @@ -35,6 +36,11 @@ Easily generate YAML with:
kubectl run nginx --image=nginx --restart=Never --dry-run=client -n mynamespace -o yaml > pod.yaml
```

Above version 1.19, no need of --restart=Never. Use the following:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you mean, "version 1.19 and later"?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also explain why --restart=Never is not needed?

```bash
kubectl run nginx --image=nginx --dry-run=client -n mynamespace -o yaml > pod.yaml
```

```bash
cat pod.yaml
```
Expand All @@ -60,6 +66,7 @@ status: {}

```bash
kubectl create -f pod.yaml -n mynamespace
kubectl apply if pod.yaml -n mynamespace
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mean apply -f?

```

Alternatively, you can run in one line
Expand All @@ -68,6 +75,11 @@ Alternatively, you can run in one line
kubectl run nginx --image=nginx --restart=Never --dry-run=client -o yaml | kubectl create -n mynamespace -f -
```

Above version 1.19, remove --restart=Never
```bash
kubectl run nginx --image=nginx --dry-run=client -o yaml | kubectl create -n mynamespace -f -
```

</p>
</details>

Expand Down