简体   繁体   English

带有 Helm 的 Gitlab 代理:错误:Kubernetes 集群无法访问:获取“http://localhost:8080/version”:拨号 tcp [::1]:8080:连接:连接被拒绝

[英]Gitlab-agent with Helm: Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version": dial tcp [::1]:8080: connect: connection refused

i installed the new gitlab agent for kubernetes cluster.我为 kubernetes 集群安装了新的 gitlab 代理。 This works when I use KUBECTL and gives this error when I try to deploy in Azure Cloud with Helm chart.这在我使用 KUBECTL 时有效,当我尝试使用 Helm 图表在 Azure Cloud 中部署时出现此错误。

my.gitlab-ci.yml我的.gitlab-ci.yml

 variables: #registry variable REGISTRY: registry.gitlab.com #docker-image tag DOCKER_IMAGE_TAG: ${CI_COMMIT_SHA} #target variable TARGET: metrix9/wysiwys-ic stages: - build - package - deploy #job to build gradle application and save the jar file in artifacts build docker image: image: gradle stage: build before_script: - chmod +x./gradlew script: -./gradlew jib -Djib.to.auth.username=$CI_REGISTRY_USER -Djib.to.auth.password=$CI_REGISTRY_PASSWORD -Djib.from.auth.username=$CI_REGISTRY_USER -Djib.from.auth.password=$CI_REGISTRY_PASSWORD # job to push file-server docker-imagedocker package wysiwys image: stage: package image: docker.io/library/docker #dependencies: # - build services: - name: docker:dind before_script: - IMAGE=${CI_REGISTRY}/${TARGET} - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker pull "${IMAGE}:latest" || true script: #- docker build --tag "${IMAGE}:latest". - docker push "${IMAGE}:latest" #job to package and push the file-server helm chart package wysiwys-ic helm: stage: package image: name: alpine/helm entrypoint: [""] before_script: - helm repo add --username $CI_REGISTRY_USER --password $CI_REGISTRY_PASSWORD wysiwys-ci-repo https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/packages/helm/stable - helm plugin install https://github.com/chartmuseum/helm-push script: - helm package wysiwys-helm - helm cm-push./wysiwys-helm-0.1.0.tgz wysiwys-ci-repo #job to install convert2pdf with helm chart install wysiwys-ic: stage: deploy image: name: alpine/helm entrypoint: [""] before_script: - helm repo add bitnami https://charts.bitnami.com/bitnami -n Convert2pdf-repo script: - helm upgrade --install wysiwys-ci./wysiwys-helm

gitlab agent: gitlab代理:

i tryed export the KUBECONFIG and to run helm repo update in the pipeline.. but the same error comes out...我尝试导出 KUBECONFIG 并在管道中运行 helm repo update ..但是出现了同样的错误......

I was struggling with the same issue.我正在为同样的问题而苦苦挣扎。 First use image with helm and kubectl(fe registry.gitlab.com/gitlab-org/cluster-integration/cluster-applications) and try adding the following changes in the deployment part:首先使用带有 helm 和 kubectl 的图像(fe registry.gitlab.com/gitlab-org/cluster-integration/cluster-applications)并尝试在部署部分添加以下更改:

deploy app:
 stage: deploy-app
 variables:
  KUBE_CONTEXT: -->gitlabproject<--:-->name of the installed agent<--
 before_script:
  - if [ -n "$KUBE_CONTEXT" ]; then kubectl config use-context "$KUBE_CONTEXT"; fi

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:Kubernetes 集群无法访问:Get "http://localhost:8080/version?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused - Error: Kubernetes cluster unreachable: Get "http://localhost:8080/version?timeout=32s": dial tcp 127.0.0.1:8080: connect: connection refused 错误:无法从服务器读取版本:获取 http://localhost:8080/api: dial tcp 127.0.0.1:8080: connection denied - Error: couldn't read version from server: Get http://localhost:8080/api: dial tcp 127.0.0.1:8080: connection refused kubernetes 仪表板显示 http: 代理错误: 拨号 tcp [::1]:8080: 连接: 连接被拒绝 - kubernetes dashboard showing http: proxy error: dial tcp [::1]:8080: connect: connection refused Kubernetes:拨号 tcp 127.0.0.1:8080:连接:连接被拒绝 - Kubernetes : dial tcp 127.0.0.1:8080: connect: connection refused 部署应用程序时出错:Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: - Error while deploying application: Get http://localhost:8080/api: dial tcp [::1]:8080: connectex: 拨打 tcp 127.0.0.1:8080:连接:连接被拒绝 AWS CodeBuild EKS - dial tcp 127.0.0.1:8080: connect: connection refused AWS CodeBuild EKS 无法连接到 http://localhost:8080/tcpSlaveAgentListener/:连接被拒绝(连接被拒绝) - Failed to connect to http://localhost:8080/tcpSlaveAgentListener/: Connection refused (Connection refused) Kubernetes 错误:无法连接到服务器:拨号 tcp 127.0.0.1:8080 - Kubernetes error: Unable to connect to the server: dial tcp 127.0.0.1:8080 AWS上的Kubernetes集群,到服务器localhost:8080的连接被拒绝 - Kubernetes cluster on AWS,The connection to the server localhost:8080 was refused kubectl get:与服务器localhost:8080的连接被拒绝-Kubernetes - kubectl get: The connection to the server localhost:8080 was refused -Kubernetes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM