Consolidate YAML files [part-14] (#9379)

This PR deals with the getting started guides (windows) and tutorials
sections. Since the YAML files in the windows directory currently are not
referenced at all, this PR refactored the markdown file to correct this
problem. When appropriate, we use the YAML content from the markdown in
the extracted version.
This commit is contained in:
Qiming
2018-07-04 14:58:20 +08:00
committed by k8s-ci-robot
parent ea6004bd4f
commit 3dd65e4e95
22 changed files with 180 additions and 294 deletions
+18 -16
View File
@@ -26,29 +26,29 @@ To add a label, add a labels section under metadata in the Pod definition:
```yaml
labels:
app: nginx
env: test
```
For example, here is the nginx Pod definition with labels ([pod-nginx-with-label.yaml](/docs/tutorials/pod-nginx-with-label.yaml)):
For example, here is the nginx Pod definition with labels ([pod-nginx.yaml](/examples/pods/pod-nginx.yaml)):
{{< code file="pod-nginx-with-label.yaml" >}}
{{< codenew file="pods/pod-nginx.yaml" >}}
Create the labeled Pod ([pod-nginx-with-label.yaml](/docs/tutorials/pod-nginx-with-label.yaml)):
Create the labeled Pod:
```shell
kubectl create -f https://k8s.io/docs/tutorials/pod-nginx-with-label.yaml
kubectl create -f https://k8s.io/examples/pods/pod-nginx.yaml
```
List all Pods with the label `app=nginx`:
List all Pods with the label `env=test`:
```shell
kubectl get pods -l app=nginx
kubectl get pods -l env=test
```
Delete the Pod by label:
```shell
kubectl delete pod -l app=nginx
kubectl delete pod -l env=test
```
For more information, see [Labels](/docs/concepts/overview/working-with-objects/labels/).
@@ -116,17 +116,17 @@ For more information, such as how to rollback Deployment changes to a previous v
Once you have a replicated set of Pods, you need an abstraction that enables connectivity between the layers of your application. For example, if you have a Deployment managing your backend jobs, you don't want to have to reconfigure your front-ends whenever you re-scale your backends. Likewise, if the Pods in your backends are scheduled (or rescheduled) onto different machines, you can't be required to re-configure your front-ends. In Kubernetes, the service abstraction achieves these goals. A service provides a way to refer to a set of Pods (selected by labels) with a single static IP address. It may also provide load balancing, if supported by the provider.
For example, here is a service that balances across the Pods created in the previous nginx Deployment example ([service.yaml](/docs/tutorials/service.yaml)):
For example, here is a service that balances across the Pods created in the previous nginx Deployment example ([service.yaml](/examples/service/nginx-service.yaml)):
{{< code file="service.yaml" >}}
{{< codenew file="service/nginx-service.yaml" >}}
### Service Management
Create an nginx service ([service.yaml](/docs/tutorials/service.yaml)):
Create an nginx Service:
```shell
kubectl create -f https://k8s.io/docs/tutorials/service.yaml
kubectl create -f https://k8s.io/examples/service/nginx-service.yaml
```
List all services:
@@ -221,13 +221,15 @@ In all cases, if the Kubelet discovers a failure the container is restarted.
The container health checks are configured in the `livenessProbe` section of your container config. There you can also specify an `initialDelaySeconds` that is a grace period from when the container is started to when health checks are performed, to enable your container to perform any necessary initialization.
Here is an example config for a Pod with an HTTP health check ([pod-with-http-healthcheck.yaml](/docs/tutorials/pod-with-http-healthcheck.yaml)):
Here is an example config for a Pod with an HTTP health check
([pod-with-http-healthcheck.yaml](/examples/pods/probe/pod-with-http-healthcheck.yaml)):
{{< code file="pod-with-http-healthcheck.yaml" >}}
{{< codenew file="pods/probe/pod-with-http-healthcheck.yaml" >}}
And here is an example config for a Pod with a TCP Socket health check ([pod-with-tcp-socket-healthcheck.yaml](/docs/tutorials/pod-with-tcp-socket-healthcheck.yaml)):
And here is an example config for a Pod with a TCP Socket health check
([pod-with-tcp-socket-healthcheck.yaml](/examples/pods/probe/pod-with-tcp-socket-healthcheck.yaml)):
{{< code file="pod-with-tcp-socket-healthcheck.yaml" >}}
{{< codenew file="pods/probe/pod-with-tcp-socket-healthcheck.yaml" >}}
For more information about health checking, see [Container Probes](/docs/user-guide/pod-states/#container-probes).