Kubernetes share a directory from your local system to kubernetes container

前端 未结 1 488
梦如初夏
梦如初夏 2020-12-31 09:12

Is there any way to share the directory/files to kubernetes container from your local system?

I have a deployment yaml file. I want to share the directory without us

1条回答
  •  执笔经年
    2020-12-31 09:45

    I found a way.

    We can specify the directory we want to add into container by using hostPath in volumes

          volumeMounts:
            - name: crypto-config
              mountPath: 
            - name: channel-artifacts
              mountPath: /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
            - name: chaincode
              mountPath: /opt/gopath/src/github.com/chaincode
      volumes:
        - name: crypto-config
          hostPath:
            path: 
        - name: channel-artifacts
          hostPath:
            path: /Users/akshaysood/Blockchain/Kubernetes/Fabric/network/channel-artifacts
        - name: chaincode
          hostPath:
            path: /Users/akshaysood/Blockchain/Kubernetes/Fabric/network/chaincode
    

    0 讨论(0)
提交回复
热议问题