[英]Kompose up username and password authentication
我正在嘗試在 k3s 上使用k3s
將 compose 文件轉換為 K8s 文件,但是當我鍵入kompose up
,它要求我輸入username and password
,但我不知道該寫什么。
具體output如下
# kompose up
INFO We are going to create Kubernetes Deployments, Services and PersistentVolumeClaims for your Dockerized application. If you need different kind of resources, use the 'kompose convert' and 'kubectl create -f' commands instead.
Please enter Username: test
Please enter Password: test
FATA Error while deploying application: Get https://127.0.0.1:6443/api: x509: certificate signed by unknown authority
但是kompose convert
命令執行成功
如果您能告訴我如何解決它,我將不勝感激?
kompose 版本是
1.21.0 (992df58d8)
,通過'curl and chmod'安裝k3s 版本為
v1.17.3+k3s1 (5b17a175)
,通過'install.sh script'安裝操作系統是
Ubuntu18.04.3 TLS
我似乎發現了我的問題,因為我使用 k3s 默認安裝的 install.sh 腳本,它會將 k8s 的配置文件存儲在/etc/rancher/k3s/k3s.yaml
而不是 k8s ~/.Kube/config
。
這導致 kompose up 無法獲得證書。
您可以使用/etc/rancher/k3s/k3s.yaml
復制到~/.Kube/config
。
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
然后kompose up
成功執行。
OP 給出的答案是針對與他們發布certificate signed by unknown authority
不同的問題。 證書問題幾乎可以肯定是由自簽名證書引起的。 為此,您必須讓工作站的操作系統接受證書。 對於 Linux,我使用:
openssl s_client -showcerts -connect 127.0.0.1:6443 2>/dev/null </dev/null | \
sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | \
sudo tee /usr/local/share/ca-certificates/k8s.crt
sudo update-ca-certificates
sudo systemctl restart docker
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.