Define environment variable container style (#8743)
* define-environment-variable-container format * run-stateless-application-deployment formatpull/8748/head
parent
4ef4e75516
commit
4cab117f42
|
@ -36,11 +36,11 @@ Pod:
|
|||
|
||||
1. Create a Pod based on the YAML configuration file:
|
||||
|
||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/envars.yaml
|
||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/envars.yaml
|
||||
|
||||
1. List the running Pods:
|
||||
|
||||
kubectl get pods -l purpose=demonstrate-envars
|
||||
kubectl get pods -l purpose=demonstrate-envars
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
|
@ -49,11 +49,11 @@ Pod:
|
|||
|
||||
1. Get a shell to the container running in your Pod:
|
||||
|
||||
kubectl exec -it envar-demo -- /bin/bash
|
||||
kubectl exec -it envar-demo -- /bin/bash
|
||||
|
||||
1. In your shell, run the `printenv` command to list the environment variables.
|
||||
|
||||
root@envar-demo:/# printenv
|
||||
root@envar-demo:/# printenv
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
|
|
|
@ -41,11 +41,11 @@ 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/tasks/run-application/deployment.yaml
|
||||
kubectl apply -f https://k8s.io/docs/tasks/run-application/deployment.yaml
|
||||
|
||||
1. Display information about the Deployment:
|
||||
|
||||
kubectl describe deployment nginx-deployment
|
||||
kubectl describe deployment nginx-deployment
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
|
@ -80,7 +80,7 @@ a Deployment that runs the nginx:1.7.9 Docker image:
|
|||
|
||||
1. List the pods created by the deployment:
|
||||
|
||||
kubectl get pods -l app=nginx
|
||||
kubectl get pods -l app=nginx
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
|
@ -90,7 +90,7 @@ a Deployment that runs the nginx:1.7.9 Docker image:
|
|||
|
||||
1. Display information about a pod:
|
||||
|
||||
kubectl describe pod <pod-name>
|
||||
kubectl describe pod <pod-name>
|
||||
|
||||
where `<pod-name>` is the name of one of your pods.
|
||||
|
||||
|
@ -103,11 +103,11 @@ specifies that the deployment should be updated to use nginx 1.8.
|
|||
|
||||
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/docs/tasks/run-application/deployment-update.yaml
|
||||
|
||||
1. Watch the deployment create pods with new names and delete the old pods:
|
||||
|
||||
kubectl get pods -l app=nginx
|
||||
kubectl get pods -l app=nginx
|
||||
|
||||
## Scaling the application by increasing the replica count
|
||||
|
||||
|
@ -119,11 +119,11 @@ should have four pods:
|
|||
|
||||
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/docs/tasks/run-application/deployment-scale.yaml
|
||||
|
||||
1. Verify that the Deployment has four pods:
|
||||
|
||||
kubectl get pods -l app=nginx
|
||||
kubectl get pods -l app=nginx
|
||||
|
||||
The output is similar to this:
|
||||
|
||||
|
|
Loading…
Reference in New Issue