2017-07-18 3 views
0

サービスアカウントを使用して、実行中のジョブの中からawsクラスタにアクセスするためにssl証明書をマウントする人はいますか?これをどうやってやるの?私はジョブを作成しました。これは失敗したコンテナの出力から、Podがエラー状態になっています。service.calltまたはそれ以外の方法でclient.crt、client.key、c​​a.crtをマウントしていますか?

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 

答えて

0

解決策は、証明書を含む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" 
関連する問題