Job failed from GitLab pipeline to Kubernetes pod

413 Views Asked by At

I have some GitLab pipelines which are using Kubernetes pods in EKS

I had some issues initially with token registration which was solved by resetting the token on GitLab and replacing it in gitlab-runner-secret

I do specify that I used for encoding

echo -n <key> | base 64

Now, I can see that the token registration is successfully, but I encounter the following error

ERROR: Job failed (system failure): prepare environment: Post https://xxx/api/v1/namespaces/kube-system/secrets: net/http: invalid header field value "Bearer \xbd\xxx" for key Authorization.

1

There are 1 best solutions below

6
VonC On

If possible, I would make a step which:

  • retrieve the secret value
  • display it (for testing; change it after debugging this issue)

You need to make sure the token does not contain any newlines or other special trailing characters (like an invisible stray Unicode character).

Check also if you can (or have) managed your Kubernetes secrets through a Sealed Secrets controller.