在kubernetes中将整个卷作为秘密装入
我正在本地运行一个容器,如下所示:在kubernetes中将整个卷作为秘密装入,kubernetes,kubernetes-secrets,Kubernetes,Kubernetes Secrets,我正在本地运行一个容器,如下所示: docker run --rm \ --name=my-container \ --net=host \ -v $(pwd)/producer.properties:/etc/replicator/producer.properties \ -v $(pwd)/consumer.properties:/etc/replicator/consumer.properties \ -v $(pwd)/service-keystore.jks:/e
docker run --rm \
--name=my-container \
--net=host \
-v $(pwd)/producer.properties:/etc/replicator/producer.properties \
-v $(pwd)/consumer.properties:/etc/replicator/consumer.properties \
-v $(pwd)/service-keystore.jks:/etc/replicator/destination.keystore.jks \
-v $(pwd)/service-truststore.jks:/etc/replicator/destination.truststore.jks \
repo/image
问题是作为卷装载的所有文件都包含敏感数据
我正试着将上面的内容移植到kubernetes
如何装载文件,并同时将其视为机密?使用secretname示例从创建一个资源,并直接将机密装载到容器中,如下所示
spec:
volumes:
- name: secret-volume
secret:
secretName: secretname
containers:
- name: containername
image: imagename
volumeMounts:
- name: secret-volume
readOnly: true
mountPath: "/etc/secret-volume"
我想这个秘密应该是从我包含敏感数据的文件中创建的,对吗?是的,请参考