How can I modify my kubernetes config file which is separated from my employed company cluster for adding second cluster?

12/17/2019

we have .config file to see our azure kubernetes but I want to modify my personel kubernetes environment in my local machine.So I decided to add my personel cluster info in ".config" file. My cluster name is "grpccluster" . I have 2 config file content below . First one is orginal . Second one is my modification. Buti it is notworking also I don't know I will effect my company kubernetes structure. Original :

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data:xxx
    server: https://xxxxxxxx.io:443
  name: xxxmaincluster
contexts:
- context:
    cluster: xxxmaincluster
    user: clusteruser1
  name: xxxmaincluster
current-context: xxxmaincluster
kind: Config
preferences: {}
users:
- name: clusteruser1
  user:
    client-certificate-data: xxxxxxxx
    client-key-data: xxxxxxxxxxx
    token: xxxxxx

Modified :

apiVersion: v1
clusters:
- cluster:
   certificate-authority-data:xxx
   server: https://xxxxxxxx.io:443
 name: xxxmaincluster
- cluster:
   certificate-authority-data: DATA+OMITTED
   server: 127.0.0.1
 name: grpcluster
contexts:
- context:
   cluster: grpcluster
   namespace: rancher
   user: user-qkvpz
 name: grpcluster
- context:
   cluster: xxxmaincluster
   user: clusteruser1
 name: xxxmaincluster
current-context: xxxmaincluster
kind: Config
preferences: {}
users:
- name: clusteruser1
 user:
   client-certificate-data: xxxxxxxx
   client-key-data: xxxxxxxxxxx
   token: xxxxxx

But I want to learn this is correct or not? And How can I produce crt file for kubernetes. Can you help me for these questions?

-- loki
amazon-s3
amazon-web-services
devops
kubectl
kubernetes

1 Answer

12/17/2019

Here's relevant documentation: Configure Access to Multiple Clusters

-- apisim
Source: StackOverflow