Consolidate YAML files [part-9] (#9361)

This PR relocates the YAML files referenced by the data injection topic.
This commit is contained in:
Qiming
2018-07-04 02:50:19 +08:00
committed by k8s-ci-robot
parent 81bc804e9a
commit 1228689b1d
28 changed files with 71 additions and 84 deletions
@@ -35,18 +35,12 @@ and the base-64 representation of your password is `Mzk1MjgkdmRnN0pi`.
Here is a configuration file you can use to create a Secret that holds your
username and password:
{{< code file="secret.yaml" >}}
{{< codenew file="pods/inject/secret.yaml" >}}
1. Create the Secret
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
kubectl create -f https://k8s.io/examples/pods/inject/secret.yaml
{{< note >}}
**Note:** If you want to skip the Base64 encoding step, you can create a Secret
by using the `kubectl create secret` command:
{{< /note >}}
kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
1. View information about the Secret:
@@ -76,15 +70,25 @@ username and password:
password: 13 bytes
username: 7 bytes
{{< note >}}
**Note:** If you want to skip the Base64 encoding step, you can create a Secret
by using the `kubectl create secret` command:
{{< /note >}}
```shell
kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
```
## Create a Pod that has access to the secret data through a Volume
Here is a configuration file you can use to create a Pod:
{{< code file="secret-pod.yaml" >}}
{{< codenew file="pods/inject/secret-pod.yaml" >}}
1. Create the Pod:
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-pod.yaml
kubectl create -f https://k8s.io/examples/pods/inject/secret-pod.yaml
1. Verify that your Pod is running:
@@ -127,11 +131,11 @@ is exposed:
Here is a configuration file you can use to create a Pod:
{{< code file="secret-envars-pod.yaml" >}}
{{< codenew file="pods/inject/secret-envars-pod.yaml" >}}
1. Create the Pod:
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-envars-pod.yaml
kubectl create -f https://k8s.io/examples/pods/inject/secret-envars-pod.yaml
1. Verify that your Pod is running: