【问题标题】:Mount kubernetes' volume in development machine在开发机器上挂载 Kubernetes 的卷
【发布时间】:2016-09-21 20:21:32
【问题描述】:

我有一个在 Google Cloud Platform 上运行的 Kubernetes 集群。我有 3 个节点和几个在这些节点上运行的 pod。

其中一个 pod 运行 Ghost 博客平台并安装了一个 gcePersistentDisk 卷。用于创建 pod 的 manifest 文件:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    name: ghost
  name: ghost
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: ghost
    spec:
      containers:
      - image: ghost:0.7
        name: ghost
        env:
        - name: NODE_ENV
          value: production
        ports:
        - containerPort: 2368
          name: http-server
        volumeMounts:
            - name: ghost
              mountPath: /var/lib/ghost
      volumes:
        - name: ghost
          gcePersistentDisk:
            pdName: ghost
            fsType: ext4

我想通过我的开发机器访问这个卷。有没有办法在我的机器上挂载这个磁盘?

【问题讨论】:

    标签: google-cloud-platform kubernetes gcloud


    【解决方案1】:

    如果您的开发机器不是 GCE 集群的一部分(即 GCE 虚拟机),那么您将无法直接挂载它。在这种情况下,您最好的选择是通过安装它的机器(即您的 pod 计划到的节点)通过 SSH 连接到它。

    【讨论】:

      猜你喜欢
      • 2020-08-07
      • 1970-01-01
      • 1970-01-01
      • 2019-08-24
      • 2021-10-26
      • 2019-10-09
      • 1970-01-01
      • 2017-07-21
      • 2020-03-17
      相关资源
      最近更新 更多