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

Update k8s201.md #7777

Merged
merged 2 commits into from
Mar 20, 2018
Merged
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
26 changes: 18 additions & 8 deletions docs/user-guide/walkthrough/k8s201.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ For example, here is the nginx Pod definition with labels ([pod-nginx-with-label
Create the labeled Pod ([pod-nginx-with-label.yaml](/docs/user-guide/walkthrough/pod-nginx-with-label.yaml)):

```shell
kubectl create -f docs/user-guide/walkthrough/pod-nginx-with-label.yaml
kubectl create -f https://k8s.io/docs/user-guide/walkthrough/pod-nginx-with-label.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use a relative link rather than a hard one. Instead of:
https://k8s.io/docs/user-guide/walkthrough/pod-nginx-with-label.yaml
Use:
docs/user-guide/walkthrough/pod-nginx-with-label.yaml

```

List all Pods with the label `app=nginx`:
Expand All @@ -46,6 +46,12 @@ List all Pods with the label `app=nginx`:
kubectl get pods -l app=nginx
```

Delete the Pod by label:

```shell
kubectl delete pod -l app=nginx
```

For more information, see [Labels](/docs/concepts/overview/working-with-objects/labels/).
They are a core concept used by two additional Kubernetes building blocks: Deployments and Services.

Expand All @@ -67,10 +73,8 @@ Here is a Deployment that instantiates two nginx Pods:

Create an nginx Deployment:

Download the `deployment.yaml` above by clicking on the file name and copy to your local directory.

```shell
kubectl create -f ./deployment.yaml
kubectl create -f https://k8s.io/docs/user-guide/walkthrough/deployment.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use this path instead:
/docs/user-guide/walkthrough/deployment.yaml

```

List all Deployments:
Expand All @@ -90,10 +94,8 @@ contains the desired changes:

{% include code.html language="yaml" file="deployment-update.yaml" ghlink="/docs/user-guide/walkthrough/deployment-update.yaml" %}

Download ./deployment-update.yaml and copy to your local directory.

```shell
kubectl apply -f ./deployment-update.yaml
kubectl apply -f https://k8s.io/docs/user-guide/walkthrough//deployment-update.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use this path instead:
/docs/user-guide/walkthrough//deployment-update.yaml

```

Watch the Deployment create Pods with new names and delete the old Pods:
Expand Down Expand Up @@ -125,7 +127,7 @@ For example, here is a service that balances across the Pods created in the prev
Create an nginx service ([service.yaml](/docs/user-guide/walkthrough/service.yaml)):

```shell
kubectl create -f docs/user-guide/walkthrough/service.yaml
kubectl create -f https://k8s.io/docs/user-guide/walkthrough/service.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use this path instead:
/docs/user-guide/walkthrough/service.yaml

```

List all services:
Expand All @@ -150,6 +152,14 @@ $ kubectl delete pod busybox # Clean up the pod we created with "kubectl run"
{% endraw %}
```

The service definition [exposed the Nginx Service](/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/) as port 8000 (`$SERVCE_PORT`). We can also access the service from a host running Kubernetes using that port:

```shell
wget -qO- http://$SERVICE_IP:$SERVICE_PORT # Run on a Kubernetes host
```

(This works on AWS with Weave.)

To delete the service by name:

```shell
Expand Down