[英]Kompose up username and password authentication
I'm experimenting with using kompose on k3s
to turn the compose file into a K8s file, but when I type kompose up
, it asks me to enter a username and password
, but I don't know what to write.我正在尝试在 k3s 上使用k3s
将 compose 文件转换为 K8s 文件,但是当我键入kompose up
,它要求我输入username and password
,但我不知道该写什么。
The specific output is as follows具体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
However, the kompose convert
command was successfully executed但是kompose convert
命令执行成功
I would appreciate it if you could tell me how to solve it?如果您能告诉我如何解决它,我将不胜感激?
The kompose version is
1.21.0 (992df58d8)
, and install it by 'curl and chmod' kompose 版本是1.21.0 (992df58d8)
,通过'curl and chmod'安装The k3s version is
v1.17.3+k3s1 (5b17a175)
, and install it by 'install.sh script' k3s 版本为v1.17.3+k3s1 (5b17a175)
,通过'install.sh script'安装OS is
Ubuntu18.04.3 TLS
操作系统是Ubuntu18.04.3 TLS
I seem to have found my problem, because I use k3s the install.sh scripts installed by default, it will k8s configuration file stored in the /etc/rancher/k3s/k3s.yaml
instead of k8s ~/.Kube/config
.我似乎发现了我的问题,因为我使用 k3s 默认安装的 install.sh 脚本,它会将 k8s 的配置文件存储在/etc/rancher/k3s/k3s.yaml
而不是 k8s ~/.Kube/config
。
This caused kompose up to fail to obtain certs.这导致 kompose up 无法获得证书。
You can use the /etc/rancher/k3s/k3s.yaml
copied to ~/.Kube/config
.您可以使用/etc/rancher/k3s/k3s.yaml
复制到~/.Kube/config
。
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
Then kompose up
executes successfully.然后kompose up
成功执行。
The answer that the OP gave is for a different issue than the certificate signed by unknown authority
that they posted. OP 给出的答案是针对与他们发布certificate signed by unknown authority
不同的问题。 The certificate issue is almost certainly caused by a self signed cert.证书问题几乎可以肯定是由自签名证书引起的。 For that, you have to get your workstation's OS to accept the cert.为此,您必须让工作站的操作系统接受证书。 For Linux, I use:对于 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.