我很难将mountPath配置为相对路径。假设我从/user/app文件夹运行部署,并希望在/user/app/secret/secret-volume下创建秘密文件,如下所示:
apiVersion: v1
kind: Pod
metadata:
name: secret-test-pod
spec:
containers:
- name: test-container
image: nginx
volumeMounts:
# name must match the volume name below
- name: secret-volume
mountPath: secret/secret-volume
# The secret data is exposed to Containers in the Pod through a Volume.
volumes:
- name: secret-volume
secret:
secretName: test-secret由于某些原因,在根目录/secret/secret-volume中创建了文件secret-volume。
发布于 2019-02-17 23:51:05
这是因为让mountPath: secret/secret-volume将其更改为mountPath: /user/app/secret/secret-volume
https://stackoverflow.com/questions/54732961
复制相似问题