Kubernetes Cluster (Debian10) not able to connect GitLab while setup GitLab Kubernetes Agent Setup

Viewed 315

I need to deploy the docker images from Gitlab-Container repo to my kubernetes cluster but first we need to do GitLab Kubernetes Agent Setup as pre-requisite to deploy via gitlab-ci. So that cluster and gitlab could communicate.

But post creating agent in GitLab I ran the command ( to install gitlab-agent ) from Gitlab to existing kubernetes cluster it get success but I noticed in logs that cluster is not connected to GitLab code.example.com due to connection error ("mod_name":"reverse_tunnel", ailed to send handshake request: Get \"https://code.example.com/-/kubernetes-agent/\": dial tcp: lookup code.example.com: i/o timeout"")

Can anyone suggest the solution as it seems issue at the network level on the client side, as cluster is not able to reach code.example.com I have checked that kas-addres include a trailing slash but still same connection error.

Troubleshoot for gitlab agent :

https://aist.fh-hagenberg.at/git/help/user/clusters/agent/troubleshooting.md

**

  • Sample Command from Gitlab ro execute on Cluster for installation:

**

root@x12men12z:~$ helm repo add gitlab https://charts.gitlab.io helm repo update helm upgrade --install gitlab-agent gitlab/gitlab-agent
--namespace gitlab-agent
--create-namespace
--set config.token=abcxyzabcxyzabcxyzabcxyzabcxyzabcxyzabcxyz
--set config.kasAddress=ws://code.example.com/-/kubernetes-agent/

  • Error in logs:

root@x12men12z:~$ kubectl logs -f -l=app=gitlab-agent -n gitlab-agent {"level":"error","time":"2022-06-02T12:08:25.818Z","msg":"Error handling a connection","mod_name":"reverse_tunnel","error":"Connect(): rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing failed to WebSocket dial: failed to send handshake request: Get \"https://code.example.com/-/kubernetes-agent/\": dial tcp: lookup code.example.com: i/o timeout""} {"level":"warn","time":"2022-06-02T12:08:38.804Z","msg":"GetConfiguration failed","error":"rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing failed to WebSocket dial: failed to send handshake request: Get \"https://code.example.com/-/kubernetes-agent/\": dial tcp: lookup code.example.com: i/o timeout""}

1 Answers

@amit Thakur same error we got while setting up the agent in aws eks cluster. after that we have whitelisted NAT external IP's of VPC that the Kubernetes clusters lie in, with port 443 in gitlab server side. then we didn't any such errors.

Related