Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

All of the following commands are executed on federation master node.

Table of Contents


  • 6

    5.1 Modify kube config of federation cluster

Follow steps at 5. Deploying Federation Control Plane for federation master node. change the default kubernetes config values to make them unique. 

...

Code Block
 ubuntu@kubefed-1:~$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.147.113.131:6443
  name: kubernetes-host
contexts:
- context:
    cluster: kubernetes-host
    user: kubernetes-adminhost
  name: kubernetes-admin-host
current-context: kubernetes-admin-host
kind: Config
preferences: {}
users:
- name: kubernetes-adminhost
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
ubuntu@kubefed-1:~$


  • 6

    5.2 Merge kube config of sites into kube config of federation

Manual Merge

Edit ~/.kube/config on federation master node to incorporate underlying kubernetes site's configuration. From ~/.kube/config file on each site's master node, extract "block of data" for clustercontext and user and insert them in the ~/.kube/config file of federation master node. Make sure you follow yaml file rules, when putting the same set of data together. In other words,cluster, make sure "block of data" for: cluster context and use,  for site-1, site-2, .. and federation site will be merged in a single file, under clusters, contexts and users.

...

Code Block
ubuntu@kubefed-1:~$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.147.113.131:6443
  name: kubernetes-host
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.147.112.140:6443
  name: kubernetes-s1
- cluster:
    certificate-authority-data: REDACTED
    server: https://10.147.113.15:6443
  name: kubernetes-s2
contexts:
- context:
    cluster: kubernetes-host
    user: kubernetes-adminhost
  name: kubernetes-admin-host
- context:
    cluster: kubernetes-s1
    user: kubernetes-admins1
  name: kubernetes-admin-s1
- context:
    cluster: kubernetes-s2
    user: kubernetes-admins2
  name: kubernetes-admin-s2
current-context: kubernetes-admin-host
kind: Config
preferences: {}
users:
- name: kubernetes-adminhost
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
- name: kubernetes-admins1
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
- name: kubernetes-admins2
  user:
    client-certificate-data: REDACTED
    client-key-data: REDACTED
ubuntu@kubefed-1:~$


  • 6

    5.3 Change current context  

    We picked federation cluster as federation host cluster.  So we need to execute "kubectl config use-context <contexts.context.name of host cluster>" on the federation master node to change current-context to that of the federation host cluster.

...

Code Block
ubuntu@kubefed-1:~# kubectl config use-context kubernetes-admin-host
Switched to context "kubernetes-admin-host".
ubuntu@kubefed-1:~#

# Verify 
ubuntu@kubefed-1:~# kubectl config current-context
kubernetes-admin-host
ubuntu@kubefed-1:~#


  • 6

    5.4 Deploy federation control plane

The command "kubefed init" is used to setup federation control plane and it should be fed with several parameters. See below syntax:

...

Code Block
Creating a namespace federation-system for federation system components... done
Creating federation control plane service... done
Creating federation control plane objects (credentials, persistent volume claim)... done
Creating federation component deployments... done
Updating kubeconfig... done
Waiting for federation control plane to come up.................. done
Federation API server is running at: 10.147.113.19:31417
  • 5.5 Verification list 

  • PV and PVC status on host cluster

...