Consolidate YAML files [part-2] (#9236)

Changes that will help upcoming consolidation work:

- Add variable `githubWebsiteRaw` to config.toml to facilitate building
  links to raw YAML files
- Revise `codenew` shortcode to generate links to raw YAML files instead
  of github.com file view;
- Rename `artifacts` directory to `examples` to better reflect its usage;

Accompanied changes as show cases:

- Moved `deployment.yaml`, `deployment-update.yaml` and
  `deployment-scale.yaml` to the new `examples/application` subdirectory;
- Removed duplicate instances of the above YAML files in other
  directories;
- Update example_test.go to test the relocated YAML files and removed
  testing for files that no longer needed.
This commit is contained in:
Qiming
2018-06-27 00:34:52 +08:00
committed by k8s-ci-robot
parent 767bd9371e
commit a3415f6228
12 changed files with 16 additions and 81 deletions
@@ -1,19 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.8 # Update the version of nginx from 1.7.9 to 1.8
ports:
- containerPort: 80
-21
View File
@@ -1,21 +0,0 @@
apiVersion: apps/v1
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
+4 -4
View File
@@ -65,7 +65,7 @@ A Deployment object defines a Pod creation template (a "cookie-cutter" if you wi
Here is a Deployment that instantiates two nginx Pods:
{{< code file="deployment.yaml" >}}
{{< codenew file="application/deployment.yaml" >}}
### Deployment Management
@@ -73,7 +73,7 @@ Here is a Deployment that instantiates two nginx Pods:
Create an nginx Deployment:
```shell
kubectl create -f https://k8s.io/docs/tutorials/deployment.yaml
kubectl create -f https://k8s.io/examples/application/deployment.yaml
```
List all Deployments:
@@ -91,10 +91,10 @@ kubectl get pods -l app=nginx
Upgrade the nginx container from 1.7.9 to 1.8 by changing the Deployment and calling `apply`. The following config
contains the desired changes:
{{< code file="deployment-update.yaml" >}}
{{< codenew file="application/deployment-update.yaml" >}}
```shell
kubectl apply -f https://k8s.io/docs/tutorials/deployment-update.yaml
kubectl apply -f https://k8s.io/examples/application/deployment-update.yaml
```
Watch the Deployment create Pods with new names and delete the old Pods:
@@ -1,21 +0,0 @@
apiVersion: apps/v1
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