[WIP] Attempt to consolidate YAML files (#8965)

This is an attempt to consolidate YAML files so that:

- They can remain untouched when we moving the documents around;
- Contributors do not have to change the test cases each time a
  documentation is moved;
- We can encourage referencing the existing YAMLs from different
  concept or task pages when possible.
This commit is contained in:
Qiming
2018-06-26 03:25:21 +08:00
committed by k8s-ci-robot
parent 10cd398d67
commit 99c4c54cb5
4 changed files with 43 additions and 3 deletions
@@ -1,21 +0,0 @@
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
# unlike pod-nginx.yaml, the name is not included in the meta data as a unique name is
# generated from the deployment name
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.7.9
ports:
- containerPort: 80
@@ -36,12 +36,12 @@ You can run an application by creating a Kubernetes Deployment object, and you
can describe a Deployment in a YAML file. For example, this YAML file describes
a Deployment that runs the nginx:1.7.9 Docker image:
{{< code file="deployment.yaml" >}}
{{< codenew file="application/deployment.yaml" >}}
1. Create a Deployment based on the YAML file:
kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment.yaml
kubectl apply -f https://k8s.io/docs/artifacts/application/deployment.yaml
1. Display information about the Deployment: