mirror of
https://github.com/jpetazzo/container.training.git
synced 2026-07-29 01:31:11 +00:00
Show an easier way to create namespaces
We were using 'kubectl apply' with a YAML snppet. It's valid, but it's quite convoluted. Instead, let's use 'kubectl create namespace'. We can still mention the other method of course.
This commit is contained in:
@@ -40,7 +40,12 @@
|
||||
|
||||
## Creating namespaces
|
||||
|
||||
- We can create namespaces with a very minimal YAML, e.g.:
|
||||
- Creating a namespace is done with the `kubectl create namespace` command:
|
||||
```bash
|
||||
kubectl create namespace blue
|
||||
```
|
||||
|
||||
- We can also get fancy and use a very minimal YAML snippet, e.g.:
|
||||
```bash
|
||||
kubectl apply -f- <<EOF
|
||||
apiVersion: v1
|
||||
@@ -50,6 +55,8 @@
|
||||
EOF
|
||||
```
|
||||
|
||||
- The two methods above are identical
|
||||
|
||||
- If we are using a tool like Helm, it will create namespaces automatically
|
||||
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user