简体   繁体   English

组合用户名和密码认证

[英]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.

相关问题 Kuberbetes:部署应用程序时出现错误 - Kuberbetes: Kompose up error while deploying application 如何启动(重启)kubernetes apiservice并添加用户名密码验证 - How to start (restart) kubernetes apiservice and adding username password authentication psycopg2.OperationalError: FATAL: Minikube 中用户“用户名”的密码验证失败 - psycopg2.OperationalError: FATAL: password authentication failed for user "username" in Minikube kubernetes组合起来不支持的env_file密钥 - kubernetes kompose up Unsupported env_file key Kompose没有为openzipkin和Elastic带来localhost - Kompose doesn't bring up localhost for openzipkin and Elastic 设置 AWS EKS - 不知道配置的用户名和密码 - Setting up AWS EKS - Don't know username and password for config Kube.netes Elasticsearch 8.5.3 Statefulset(非ECK)设置用户名/密码 - Kubernetes Elasticsearch 8.5.3 Statefulset (not ECK) set up username / password Kubernetes kompose - Kubernetes kompose Kubernetes掌握用户名和密码 - Kubernetes master username and password 错误无法将图像'library/web:latest'推送到注册表'docker.io'。 错误:被拒绝:请求的资源访问被拒绝 - Kompose up - ERROR Unable to push image 'library/web:latest' to registry 'docker.io'. Error: denied: requested access to the resource is denied - Kompose up
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM