-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
base: main
Are you sure you want to change the base?
More shortcuts #151
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ kubernetes.io > Documentation > Tasks > Access Applications in a Cluster > [Use | |
|
||
```bash | ||
kubectl create namespace mynamespace | ||
kubectl create ns mynamespace | ||
kubectl run nginx --image=nginx --restart=Never -n mynamespace | ||
``` | ||
|
||
|
@@ -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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you mean, "version 1.19 and later"? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
``` | ||
|
@@ -60,6 +66,7 @@ status: {} | |
|
||
```bash | ||
kubectl create -f pod.yaml -n mynamespace | ||
kubectl apply if pod.yaml -n mynamespace | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean |
||
``` | ||
|
||
Alternatively, you can run in one line | ||
|
@@ -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> | ||
|
||
|
There was a problem hiding this comment.
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?