mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-04 09:49:50 +00:00
change to list syntax
This commit is contained in:
parent
aeff05ae68
commit
cf077b2970
168
docs/secrets.md
168
docs/secrets.md
@ -179,99 +179,109 @@ credentials.
|
|||||||
The secrets:
|
The secrets:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[{
|
|
||||||
"kind": "Secret",
|
|
||||||
"apiVersion": "v1beta3",
|
|
||||||
"metadata": {
|
|
||||||
"name": "prod-db-secret"
|
|
||||||
},
|
|
||||||
"data": {
|
|
||||||
"password": "dmFsdWUtMg0KDQo=",
|
|
||||||
"username": "dmFsdWUtMQ0K"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "Secret",
|
|
||||||
"apiVersion": "v1beta3",
|
"apiVersion": "v1beta3",
|
||||||
"metadata": {
|
"kind": "List",
|
||||||
"name": "test-db-secret"
|
"items":
|
||||||
|
[{
|
||||||
|
"kind": "Secret",
|
||||||
|
"apiVersion": "v1beta3",
|
||||||
|
"metadata": {
|
||||||
|
"name": "prod-db-secret"
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"password": "dmFsdWUtMg0KDQo=",
|
||||||
|
"username": "dmFsdWUtMQ0K"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"data": {
|
{
|
||||||
"password": "dmFsdWUtMg0KDQo=",
|
"kind": "Secret",
|
||||||
"username": "dmFsdWUtMQ0K"
|
"apiVersion": "v1beta3",
|
||||||
}
|
"metadata": {
|
||||||
}]
|
"name": "test-db-secret"
|
||||||
|
},
|
||||||
|
"data": {
|
||||||
|
"password": "dmFsdWUtMg0KDQo=",
|
||||||
|
"username": "dmFsdWUtMQ0K"
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The pods:
|
The pods:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
[{
|
|
||||||
"kind": "Pod",
|
|
||||||
"apiVersion": "v1beta3",
|
|
||||||
"metadata": {
|
|
||||||
"name": "prod-db-client-pod",
|
|
||||||
"labels": {
|
|
||||||
"name": "prod-db-client"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"spec": {
|
|
||||||
"volumes": [
|
|
||||||
{
|
|
||||||
"name": "secret-volume",
|
|
||||||
"secret": {
|
|
||||||
"secretName": "prod-db-secret"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"containers": [
|
|
||||||
{
|
|
||||||
"name": "db-client-container",
|
|
||||||
"image": "myClientImage",
|
|
||||||
"volumeMounts": [
|
|
||||||
{
|
|
||||||
"name": "secret-volume",
|
|
||||||
"readOnly": true,
|
|
||||||
"mountPath": "/etc/secret-volume"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"kind": "Pod",
|
|
||||||
"apiVersion": "v1beta3",
|
"apiVersion": "v1beta3",
|
||||||
"metadata": {
|
"kind": "List",
|
||||||
"name": "test-db-client-pod",
|
"items":
|
||||||
"labels": {
|
[{
|
||||||
"name": "test-db-client"
|
"kind": "Pod",
|
||||||
|
"apiVersion": "v1beta3",
|
||||||
|
"metadata": {
|
||||||
|
"name": "prod-db-client-pod",
|
||||||
|
"labels": {
|
||||||
|
"name": "prod-db-client"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"spec": {
|
||||||
|
"volumes": [
|
||||||
|
{
|
||||||
|
"name": "secret-volume",
|
||||||
|
"secret": {
|
||||||
|
"secretName": "prod-db-secret"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"containers": [
|
||||||
|
{
|
||||||
|
"name": "db-client-container",
|
||||||
|
"image": "myClientImage",
|
||||||
|
"volumeMounts": [
|
||||||
|
{
|
||||||
|
"name": "secret-volume",
|
||||||
|
"readOnly": true,
|
||||||
|
"mountPath": "/etc/secret-volume"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"spec": {
|
{
|
||||||
"volumes": [
|
"kind": "Pod",
|
||||||
{
|
"apiVersion": "v1beta3",
|
||||||
"name": "secret-volume",
|
"metadata": {
|
||||||
"secret": {
|
"name": "test-db-client-pod",
|
||||||
"secretName": "test-db-secret"
|
"labels": {
|
||||||
}
|
"name": "test-db-client"
|
||||||
}
|
}
|
||||||
],
|
},
|
||||||
"containers": [
|
"spec": {
|
||||||
{
|
"volumes": [
|
||||||
"name": "db-client-container",
|
{
|
||||||
"image": "myClientImage",
|
"name": "secret-volume",
|
||||||
"volumeMounts": [
|
"secret": {
|
||||||
{
|
"secretName": "test-db-secret"
|
||||||
"name": "secret-volume",
|
|
||||||
"readOnly": true,
|
|
||||||
"mountPath": "/etc/secret-volume"
|
|
||||||
}
|
}
|
||||||
]
|
}
|
||||||
}
|
],
|
||||||
]
|
"containers": [
|
||||||
}
|
{
|
||||||
}]
|
"name": "db-client-container",
|
||||||
|
"image": "myClientImage",
|
||||||
|
"volumeMounts": [
|
||||||
|
{
|
||||||
|
"name": "secret-volume",
|
||||||
|
"readOnly": true,
|
||||||
|
"mountPath": "/etc/secret-volume"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Both containers will have the following files present on their filesystems:
|
Both containers will have the following files present on their filesystems:
|
||||||
|
Loading…
Reference in New Issue
Block a user