当前位置:网站首页>kubernetes comfig subpath
kubernetes comfig subpath
2022-06-23 12:37:00 【Matthew__ M】
docker Medium volume Sure mount Files to a specific directory , At the same time, keep the original directory unchanged ; alike mount Put it in Kubernetes But it became : Just put mount Several files of are directly put into the root directory , The files in the original directory disappear . In many scenarios , We would like to just mount a file to Containers An internal directory , Without affecting the original directory .
apiVersion: v1
kind: ConfigMap
metadata:
name: special-config
namespace: default
data:
special.level: very
special.type: |-
property.1=value-1
property.2=value-2
property.3=value-3
---
apiVersion: v1
kind: Pod
metadata:
name: test-pod
spec:
containers:
- name: test-container
image: busybox:latest
imagePullPolicy: IfNotPresent
command: [ "/bin/sh", "-c", "ls /etc/", "-c", "ls /usr" ]
volumeMounts:
- name: config-volume
mountPath: /etc/special.level
subPath: special.level
- name: config-volume
mountPath: /usr/special.type
subPath: special.type
volumes:
- name: config-volume
configMap:
# Provide the name of the ConfigMap containing the files you want
# to add to the container
name: special-config
restartPolicy: Never
边栏推荐
猜你喜欢

首次曝光!唯一全域最高等级背后的阿里云云原生安全全景图
![Halcon principle: one dimensional function_ 1D type [2]](/img/54/570c6e739be1ab9caa9df805965b57.png)
Halcon principle: one dimensional function_ 1D type [2]

利用XtraDiagram.DiagramControl进行流程图形的绘制和控制

运行时应用自我保护(RASP):应用安全的自我修养

Go zero micro Service Practice Series (VI. cache consistency assurance)

CRMEB知识付费如何二开阿里云短信功能

Ros2 knowledge (1): start practicing robots

群晖万兆网络配置与测试

ROS2知识(6):坐标对象TF原理和实践

mysql中innodb下的redo log什么时候开始执行check point落盘的?
随机推荐
UI框架
Halcon原理:auto_threshold算子
DevEco Device Tool 助力OpenHarmony设备开发
[no title] 2022 pressure pipeline patrol inspection and maintenance test questions and online simulation test
Transformers are RNNs (linear transformer)论文阅读
Go zero micro Service Practice Series (VI. cache consistency assurance)
全新项目,如何保证测试的覆盖率?
Meta 称英国安全法将“扫描所有私人信息”,有侵犯用户隐私风险
利用XtraDiagram.DiagramControl进行流程图形的绘制和控制
CSS magic nugget mug; Optimization of CK, ES and redisearch schemes in ten million level data query; Why does module circular dependency not lead to dead loop Sauced afternoon tea issue 13
How should enterprises conduct efficient IT operation and maintenance management?
C# 文件下载方式
C#学习(高级课程)Day15——异常处理和命名空间
Halcon principle: one dimensional function_ 1D type [2]
2022工具钳工(初级)考试练习题模拟考试平台操作
Huawei cloud gaussdb heavily released HTAP for commercial use, defining a new paradigm of cloud native database 2.0
一个 BUG 开发表示用户不会这样操作,无需修复,测试人员如何应对?
这两所985大学,共享同一位校长!校方:属实
09 -- palindrome pair
生态 | 万里数据库与卫士通完成兼容认证 共筑网络安全生态体系