To be sure things are right, let's list all of the namespaces in our cluster.
To be sure things are right, let's list all of the namespaces in our cluster.
```shell
```console
$ kubectl get namespaces
$ kubectl get namespaces
NAME LABELS STATUS
NAME LABELS STATUS
default <none> Active
default <none> Active
...
@@ -129,7 +129,7 @@ To demonstrate this, let's spin up a simple replication controller and pod in th
...
@@ -129,7 +129,7 @@ To demonstrate this, let's spin up a simple replication controller and pod in th
We first check what is the current context:
We first check what is the current context:
```shell
```yaml
apiVersion:v1
apiVersion:v1
clusters:
clusters:
-cluster:
-cluster:
...
@@ -158,7 +158,7 @@ users:
...
@@ -158,7 +158,7 @@ users:
The next step is to define a context for the kubectl client to work in each namespace. The value of "cluster" and "user" fields are copied from the current context.
The next step is to define a context for the kubectl client to work in each namespace. The value of "cluster" and "user" fields are copied from the current context.
```shell
```console
$ kubectl config set-context dev --namespace=development --cluster=lithe-cocoa-92103_kubernetes --user=lithe-cocoa-92103_kubernetes
$ kubectl config set-context dev --namespace=development --cluster=lithe-cocoa-92103_kubernetes --user=lithe-cocoa-92103_kubernetes
Let's switch to operate in the development namespace.
Let's switch to operate in the development namespace.
```shell
```console
$ kubectl config use-context dev
$ kubectl config use-context dev
```
```
You can verify your current context by doing the following:
You can verify your current context by doing the following:
```shell
```console
$ kubectl config view
$ kubectl config view
```
```yaml
apiVersion:v1
apiVersion:v1
clusters:
clusters:
-cluster:
-cluster:
...
@@ -216,13 +219,13 @@ At this point, all requests we make to the Kubernetes cluster from the command l
...
@@ -216,13 +219,13 @@ At this point, all requests we make to the Kubernetes cluster from the command l
Let's create some content.
Let's create some content.
```shell
```console
$ kubectl run snowflake --image=kubernetes/serve_hostname --replicas=2
$ kubectl run snowflake --image=kubernetes/serve_hostname --replicas=2
```
```
We have just created a replication controller whose replica size is 2 that is running the pod called snowflake with a basic container that just serves the hostname.
We have just created a replication controller whose replica size is 2 that is running the pod called snowflake with a basic container that just serves the hostname.