Before starting it is necessary create several Kubernetes clusters to make the federation. One cluster will be the Host (Host Cluster), in which will be install the KubeFed (Control Plane), and the remaining clusters will be the Members (Member Cluster).
To create the clusters on Openstack, it is possible to use the follow Juju bundle: https://jaas.ai/u/csd-garr/kubernetes-openstack-integrator/bundle.
Once all the clusters for federation have been created, it is useful to collect all cluster access configurations (.kube/config) in a single config file. In this way you can easily switch from one cluster to another.
Below is an example of a compound file config:
```
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1CRUdJT...
server: https://<ip>:443
name: k8s-cluster-host
- cluster:
certificate-authority-data: LS0tLS1CRUdJT...
server: https://<ip>:443
name: k8s-cluster-member1
- cluster:
certificate-authority-data: LS0tLS1CRUdJT...
server: https://<ip>:443
name: k8s-cluster-member2
contexts:
- context:
cluster: k8s-cluster-host
user: admin-host
name: k8s-context-host
- context:
cluster: k8s-cluster-member1
user: admin-member1
name: k8s-context-member1
- context:
cluster: k8s-cluster-member2
user: admin-member2
name: k8s-context-member2
current-context: k8s-context-host
kind: Config
preferences: {}
users:
- name: admin-host
user:
password: 8Rvl5qW...
username: admin
- name: admin-member1
user:
password: 0JefxZq...
username: admin
- name: admin-member2
user:
password: hJLiVLI...
username: admin
```
In this way you have access to all the clusters by the context switch, below are the commands for the context switch: