zoukankan      html  css  js  c++  java
  • kubernetes中的常用存储类型

    这里介绍hostPath

    利用hostPath的挂载卷

    假如容器希望使用主机目录下的/opt/etcd/ssl/下的认证文件,可以像如下这样定义:

    apiVersion: v1
    kind: Pod
    metadata:
      name: test-pd
    spec:
      containers:
      - image: k8s.gcr.io/test-webserver
        name: test-container
        env:
        - name: ETCD_KEY_FILE
          value: "/opt/etcd/ssl/server-key.pem"
        volumeMounts:
        - mountPath: /opt/etcd/ssl/  #容器中文件所在位置
          name: etcd-ssl             #卷名称,要和volumes中的一致
      volumes:
      - name: etcd-ssl
        hostPath:
          # directory location on host
          path: /opt/etcd/ssl        #主机文件所在的位置
          # this field is optional
          type: Directory
          readOnly: true
    
  • 相关阅读:
    ring0 ShadowSSDTHook
    ring0 恢复SSDTHook
    Go的CSP并发模型
    [转]An overview of Openvswitch implementation
    堆排序
    集群 分布式
    云介绍
    云分层
    happens-before
    Java异常
  • 原文地址:https://www.cnblogs.com/janeysj/p/13850792.html
Copyright © 2011-2022 走看看