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:
@@ -1,19 +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: 4 # Update the replicas from 2 to 4
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nginx
|
||||
spec:
|
||||
containers:
|
||||
- name: nginx
|
||||
image: nginx:1.8
|
||||
ports:
|
||||
- containerPort: 80
|
||||
@@ -1,19 +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
|
||||
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
|
||||
@@ -41,7 +41,7 @@ a Deployment that runs the nginx:1.7.9 Docker image:
|
||||
|
||||
1. Create a Deployment based on the YAML file:
|
||||
|
||||
kubectl apply -f https://k8s.io/docs/artifacts/application/deployment.yaml
|
||||
kubectl apply -f https://k8s.io/examples/application/deployment.yaml
|
||||
|
||||
1. Display information about the Deployment:
|
||||
|
||||
@@ -99,11 +99,11 @@ a Deployment that runs the nginx:1.7.9 Docker image:
|
||||
You can update the deployment by applying a new YAML file. This YAML file
|
||||
specifies that the deployment should be updated to use nginx 1.8.
|
||||
|
||||
{{< code file="deployment-update.yaml" >}}
|
||||
{{< codenew file="application/deployment-update.yaml" >}}
|
||||
|
||||
1. Apply the new YAML file:
|
||||
|
||||
kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment-update.yaml
|
||||
kubectl apply -f https://k8s.io/examples/application/deployment-update.yaml
|
||||
|
||||
1. Watch the deployment create pods with new names and delete the old pods:
|
||||
|
||||
@@ -115,11 +115,11 @@ You can increase the number of pods in your Deployment by applying a new YAML
|
||||
file. This YAML file sets `replicas` to 4, which specifies that the Deployment
|
||||
should have four pods:
|
||||
|
||||
{{< code file="deployment-scale.yaml" >}}
|
||||
{{< codenew file="application/deployment-scale.yaml" >}}
|
||||
|
||||
1. Apply the new YAML file:
|
||||
|
||||
kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment-scale.yaml
|
||||
kubectl apply -f https://k8s.io/examples/application/deployment-scale.yaml
|
||||
|
||||
1. Verify that the Deployment has four pods:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user