2017-07-18 46 views
0

是否有人使用服務帳戶來掛載ssl證書以便在正在運行的作業中訪問aws集羣?我們如何做到這一點?我創建了這個作業,這是來自導致Pod處於錯誤狀態的失敗容器的輸出。使用服務帳號或其他方式安裝client.crt,client.key,ca.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" 
相關問題