Commit be367523 authored by Marco Lorini's avatar Marco Lorini
Browse files

2020-10-06 ML: add in readme the Environment configuration section

parent 5c2f7631
......@@ -7,3 +7,71 @@ Below some useful links for the main tools of a Kubernetes federation:
- https://github.com/kubernetes-sigs/kubefed
- https://github.com/kubernetes-sigs/external-dns
- https://github.com/kubernetes-sigs/kubefed/blob/master/docs/ingressdns-with-externaldns.md
## Environment configuration
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:
list contexts:
```
$ kubectl config get-contexts
```
switch context:
```
$ kubectl config use-context <context-name>
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment