Skip to content

Credentials file

To access Kubernetes containers through Visual Studio Code or the command line utility kubectl, you need a local credentials file generated by Rancher.

The KubeConfig YAML file tells local applications how to access the Kubernetes cluster icekube.

  1. In Rancher, click the button Download KubeConfig to download the file icekube.yaml.
  2. In Linux, save the file to ~/.kube/config
  3. Because we do external SSL termination you need to remove the certificate-authority-data row:

    Before removal:

    apiVersion: v1
    kind: Config
    clusters:
    - name: "icekube"
    cluster:
        server: "https://k8s.ice.ri.se/k8s/clusters/c-tmfxj"
        certificate-authority-data: "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJpRENDQ\
        VM2Z0F3SUJBZ0lCQURBS0JnZ3Foa2pPUFFRREFqQTdNUnd3R2dZRFZRUUtFeE5rZVc1aGJXbGoKY\
        kdsemRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR1Z1WlhJdFkyRXdIa\
        GNOTWpBdwpOakE0TURjMU9USTJXaGNOTXpBd05qQTJNRGMxT1RJMldqQTdNUnd3R2dZRFZRUUtFe\
        E5rZVc1aGJXbGpiR2x6CmRHVnVaWEl0YjNKbk1Sc3dHUVlEVlFRREV4SmtlVzVoYldsamJHbHpkR\
        1Z1WlhJdFkyRXdXVEFUQmdjcWhrak8KUFFJQkJnZ3Foa2pPUFFNQkJ3TkNBQVJsRHkvdXlRcVplT\
        UdKYWk1WVdPUkNxTVBUS3hJdFVrdmt3THJMR0hGZQpHWXZQa2RJdFM3ZlArKzdBd05RTE5LVHlxR\
        jJId25OWjJrYnlUWnpScXVDbG95TXdJVEFPQmdOVkhROEJBZjhFCkJBTUNBcVF3RHdZRFZSMFRBU\
        UgvQkFVd0F3RUIvekFLQmdncWhrak9QUVFEQWdOSUFEQkZBaUVBaTRvTEFMTG8KTk1tWnlwYUhjN\
        1RKSnhzVjVHMzhvR05PRGJQY2pSWFpqQUVDSUJWREtpL0svOWpTV3dVWGZnZytXTzY5NWpuTApQc\
        2V0cndBbmJ2QVd6Nk5sCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0="
    - name: "icekube-icekubemaster2"
    

    After removal:

    apiVersion: v1
    kind: Config
    clusters:
    - name: "icekube"
    cluster:
        server: "https://k8s.ice.ri.se/k8s/clusters/c-tmfxj"
    - name: "icekube-icekubemaster2"
    
  4. Set file permissions with chmod 600 ~/.kube/config

In Windows, the file is C:\Users\username\.kube\config.

kube config