Where/how to update cert to fix kubernetes deployment x509: certificate signed by unknown authority


I have tried setting up a CI/CD pipeline with Gitlab with some success but I am stuck on cert issues.


Unable to connect to the server: x509: certificate signed by unknown authority

Current setup:

  • Rancher version. 2.6.3 I believe (picked latest with docker image at time of this writing)
  • Single node Rancher in docker with ports 8080:80 and 8443:443
  • Gitlab runner deployment - Success
  • Secret registry for Gitlab docker repo - Success

With this I can setup a deployment with the image from private docker repo in Gitlab.
I am however stuck on doing a kubernetes deployment

Part of the pipeline I am using:

- deploy

KUBECONFIG: /root/.kube/config

image: dtzar/helm-kubectl
stage: deploy
    - sed -ie "s/deploy-date-value/$(date)/g" kubernetes/deployment.yml
    - mkdir -p /root/.kube/ && touch /root/.kube/config
    - echo ${KUBERNETES_KUBE_CONFIG} | base64 -d > ${KUBECONFIG}
    - kubectl apply -f kubernetes/deployment.yml

Where KUBERNETES_KUBE_CONFIG is a Gitlab variable.
The value is a base64 encoding using xclip of the kubeconfig downloaded from the cluster in Rancher GUI with the certificate-authority-data removed.


apiVersion: v1
kind: Config
- name: "mycluster"
    server: ""

- name: "mycluster"
    token: "..."

- name: "mycluster"
    user: "mycluster"
    cluster: "mycluster"

current-context: "mycluster"

Originally I receieved the following error:

Unable to connect to the server: x509: cannot validate certificate for because it doesn't contain any IP SANs

(Different ip due to different vm and rancher install)

It was apparently some conflict that occurs when the Rancher docker image is configured with ports 80/443. I have no clue what causes this. The reason I found out was on a sidetrip doing the rancher/hello-world example. I have a separate post here for info on this issue:


As for the issue at hand with unknown authority I have 3 questions to be answered:

  1. Where am a supposed to do a cert update. I have seen many components in rancher/kubernetes that uses certs. From a video I learned about the Authorized Endpoint setting which bypasses the Authentication Proxy. From this I gather that the change I need without this feature enable should lie either with the proxy or somewhere in the cluster.
  2. How to do this in the Rancher GUI as well as a link to the equivalent in cli regardless.
  3. What changes are to be made to whichever cert should be changed. As I am trying things out in isolation to learn them I am planning on using self-signed cert. I am not certain as I have not worked with certs before but I believe there should be a way to disable CA requirement.