【问题标题】:Mounting client.crt, client.key, ca.crt with a service-account or otherwise?使用服务帐户或其他方式安装 client.crt、client.key、c​​a.crt?
【发布时间】:2017-12-23 11:34:33
【问题描述】:

以前是否有人使用服务帐户挂载 ssl 证书以从正在运行的作业中访问 aws 集群?我们如何做到这一点?我创建了作业,这是来自导致 Pod 处于错误状态的失败容器的输出。

Error in configuration:
* unable to read client-cert /client.crt for test-user due to open /client.crt: no such file or directory
* unable to read client-key /client.key for test-user due to open /client.key: no such file or directory
* unable to read certificate-authority /ca.crt for test-cluster due to open /ca.crt: no such file or director

【问题讨论】:

    标签: kubernetes e2e-testing kubernetes-security


    【解决方案1】:

    解决方案是创建一个包含证书的Secret,然后让作业引用它。

    第 1 步。 创建密钥:

    kubectl create secret generic job-certs --from-file=client.crt --from-file=client.key --from-file=ca.crt
    

    第 2 步。 作业清单中的参考密码。您必须在作业中插入volumesvolumeMounts

    spec:
      volumes:
      - name: ssl
        secret:
          secretName: job-certs
      containers:
        volumeMounts:
        - mountPath: "/etc/ssl"
          name: "ssl"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-07-13
      • 2018-11-30
      • 1970-01-01
      • 1970-01-01
      • 2020-05-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多