最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

關(guān)于k8s中subpath的使用詳解

 更新時間:2022年02月25日 15:13:15   作者:fengjian1585  
這篇文章主要介紹了k8s中subpath的使用,文章介紹分為兩種情況給大家詳細講解,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下

有兩種情況:

1.做為volumes使用時,subPath代表存儲卷的子路徑:

apiVersion: v1
kind: Pod
metadata:
  name: testpod0
spec:
  containers:
  - name: testc
    image: busybox
    command: ["/bin/sleep","10000"]
    volumeMounts:
      - name: data
        mountPath: /opt/data    # 掛載的路徑
        subPath: data           # volume的子路徑
        mountPath: /opt/model
        subPath: model
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: test-data

2.作為configmap/secret使用時,subPath代表configmap/secret的子路徑:

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-test
data:
  config.ini: "hello"
  config.conf: "nihao"

單獨掛載一個key為文件

apiVersion: v1
kind: Pod
metadata:
  name: testpod
spec:
  containers:
  - name: testc
    image: busybox
    command: ["/bin/sleep","10000"]
    volumeMounts:
      - name: config-test
        mountPath: /etc/config.ini   # 最終在容器中的文件名
        subPath: config.ini  #要掛載的confmap中的key的名稱
  volumes:
    - name: config-test
      configMap:
        name: config-test

掛載多個key為文件:

apiVersion: v1
kind: Pod
metadata:
  name: testpod2
spec:
  containers:
  - name: testc
    image: busybox
    command: ["/bin/sleep","10000"]
    volumeMounts:
      - name: config-test
        mountPath: /etc/config.ini   # 最終在容器中的文件名
        subPath: config.ini  #要掛載的confmap中的key的名稱
        mountPath: /etc/config.conf   # 最終在容器中的文件名
        subPath: config.conf  #要掛載的confmap中的key的名稱
  volumes:
    - name: config-test
      configMap:
        name: config-test

多個container掛載不同的key:

apiVersion: v1
kind: Pod
metadata:
  name: testpod1
spec:
  containers:
  - name: testc
    imagePullPolicy: Never
    image: busybox
    command: ["/bin/sleep","10000"]
    volumeMounts:
      - name: config-test
        mountPath: /etc/config/config.ini
        subPath: config.ini
  - name: testc1
    imagePullPolicy: Never
    image: busybox
    command: ["/bin/sleep","10000"]
    volumeMounts:
      - name: config-test
        mountPath: /etc/config/config.conf
        subPath: config.conf
  volumes:
    - name: config-test
      configMap:
        name: config-test
        items:
        - key: config.ini
          path: config.ini
        - key: config.conf
          path: config.conf

摘自

https://soulchild.cn/1911.html

到此這篇關(guān)于關(guān)于k8s中subpath的使用詳解的文章就介紹到這了,更多相關(guān)k8s subpath使用內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:

相關(guān)文章

最新評論

阜城县| 上蔡县| 阳泉市| 太康县| 许昌县| 库伦旗| 彝良县| 鄂尔多斯市| 凤山县| 辽中县| 宝清县| 武宁县| 宿州市| 建阳市| 象山县| 淮南市| 凤阳县| 通道| 萝北县| 高安市| 介休市| 江源县| 南京市| 和顺县| 西丰县| 温宿县| 平罗县| 巨野县| 张掖市| 汕尾市| 施甸县| 贵定县| 桦甸市| 巴彦县| 丹阳市| 呼伦贝尔市| 遵义县| 申扎县| 唐山市| 铁力市| 乐亭县|