真题解析

题目

在 namespace monitoring 中获取名为 db1-test 的现有 secret 的内容

username 字段存储在名为 /home/candidate/user.txt 的文件中,并将 password 字段存储在名为 /home/candidate/old-password.txt 的文件中。

circle-info

您必须创建以上两个文件;它们还不存在。

circle-exclamation

monitoring namespace 中创建一个名为 dev-mark 的新 secret,内容如下:

username: production-instance

password: aV7HR7nU3JLx

最后,创建一个新的 Pod,它可以通过卷访问 secret dev-mark :

Pod 名: secret-pod

Namespace:monitoring

容器名: test-secret-container

镜像: redis

卷名: secret-volume

挂载路径: /etc/test-secret

解析

获取 secret 加密字符串

将加密字符串解密并写入文件

创建 secret

创建 Pod yaml

编辑 Pod yaml

创建 Pod

Last updated