How to add an Azure AKS Kubernetes Cluster self-signed CA to GitLab CI/CD Kubernetes integration?

前端 未结 1 600
走了就别回头了
走了就别回头了 2021-02-20 00:21

I\'m trying to add my Azure AKS Kubernetes cluster to my GitLab CI/CD Kubernetes integration.

I can execute kubectl commands on the cluster from my pc, afte

1条回答
  •  被撕碎了的回忆
    2021-02-20 01:15

    I found out later that the base64 string in the certificate-authority-data of the .kube/config file that I was coping its content into the CA Certificate field of GitLab "Add Kubernetes cluster" form, it is the PEM format, but base64 encoded.

    The PEM format already is a base64 encoded representation of the certificate bits, but it has some line breaks in the middle. This whole content is base64 encoded again before it goes to the .kube/config so it is turned into a big base64 single-line string.

    I just had to base64 decode this big single-line string (I used the javascript atob("....") in the Chrome's Console window), what gave me something like this:

    -----BEGIN CERTIFICATE-----
    MIIEyDCCArCgAwIBAgIRAOL3N8oMIwWIxcFTZhTkfgMwDQYJKoZIhvcNAQELBQAw
    ...
    ...
    ...
    5gP7yoL1peZ+AWjCgcUVZYiItqrBLpWYDgY9g8btYDUIiWlqkmC0+kBaPfwCtckx
    cUp3vlwRITrv0mzrxiQjTLTUpEy7EcD+U6IecA==
    -----END CERTIFICATE-----
    

    Then I just copied this content into the GitLab "CA Certificate" field and it worked.

    0 讨论(0)
提交回复
热议问题