Move sample YAML files to the correct place (#12123)
This PR is also an attempt to fix #12117. Closes: #12117
This commit is contained in:
@@ -40,7 +40,7 @@ username and password:
|
|||||||
1. Create the Secret
|
1. Create the Secret
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
|
kubectl create -f https://k8s.io/examples/pods/inject/secret.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
1. View information about the Secret:
|
1. View information about the Secret:
|
||||||
@@ -90,7 +90,7 @@ Here is a configuration file you can use to create a Pod:
|
|||||||
1. Create the Pod:
|
1. Create the Pod:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
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:
|
1. Verify that your Pod is running:
|
||||||
@@ -145,7 +145,7 @@ Here is a configuration file you can use to create a Pod:
|
|||||||
1. Create the Pod:
|
1. Create the Pod:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
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:
|
1. Verify that your Pod is running:
|
||||||
|
|||||||
@@ -32,23 +32,20 @@ base-64 形式的密码为 `Mzk1MjgkdmRnN0pi`。
|
|||||||
|
|
||||||
这里是一个配置文件,可以用来创建存有用户名和密码的 Secret:
|
这里是一个配置文件,可以用来创建存有用户名和密码的 Secret:
|
||||||
|
|
||||||
{{< code file="secret.yaml" >}}
|
{{< codenew file="pods/inject/secret.yaml" >}}
|
||||||
|
|
||||||
<!--
|
|
||||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
|
|
||||||
-->
|
|
||||||
|
|
||||||
1. 创建 Secret
|
1. 创建 Secret
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
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 >}}
|
||||||
**注意:** 如果想要跳过 Base64 编码的步骤,可以使用 `kubectl create secret` 命令来创建 Secret:
|
**注意:** 如果想要跳过 Base64 编码的步骤,可以使用 `kubectl create secret` 命令来创建 Secret:
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
|
kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
|
||||||
```
|
```
|
||||||
|
|
||||||
1. 查看 Secret 相关信息:
|
1. 查看 Secret 相关信息:
|
||||||
@@ -58,11 +55,11 @@ kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
|
|||||||
输出:
|
输出:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
NAME TYPE DATA AGE
|
NAME TYPE DATA AGE
|
||||||
test-secret Opaque 2 1m
|
test-secret Opaque 2 1m
|
||||||
```
|
```
|
||||||
|
|
||||||
3. 查看 Secret 相关的更多详细信息:
|
1. 查看 Secret 相关的更多详细信息:
|
||||||
|
|
||||||
kubectl describe secret test-secret
|
kubectl describe secret test-secret
|
||||||
|
|
||||||
@@ -86,7 +83,7 @@ kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
|
|||||||
|
|
||||||
这里是一个可以用来创建 pod 的配置文件:
|
这里是一个可以用来创建 pod 的配置文件:
|
||||||
|
|
||||||
{{< code file="secret-pod.yaml" >}}
|
{{< codenew file="pods/inject/secret-pod.yaml" >}}
|
||||||
|
|
||||||
1. 创建 Pod:
|
1. 创建 Pod:
|
||||||
|
|
||||||
@@ -148,16 +145,12 @@ kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret.yaml
|
|||||||
|
|
||||||
这里是一个可以用来创建 pod 的配置文件:
|
这里是一个可以用来创建 pod 的配置文件:
|
||||||
|
|
||||||
{{< code file="secret-envars-pod.yaml" >}}
|
{{< codenew file="pods/inject/secret-envars-pod.yaml" >}}
|
||||||
|
|
||||||
<!--
|
|
||||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-pod.yaml
|
|
||||||
-->
|
|
||||||
|
|
||||||
1. 创建 Pod:
|
1. 创建 Pod:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl create -f https://k8s.io/docs/tasks/inject-data-application/secret-pod.yaml
|
kubectl create -f https://k8s.io/examples/pods/inject/secret-envars-pod.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
1. 确认 Pod 正在运行:
|
1. 确认 Pod 正在运行:
|
||||||
|
|||||||
Reference in New Issue
Block a user