Skip to content
Snippets Groups Projects
Commit d6d9bdd5 authored by Marco Lorini's avatar Marco Lorini
Browse files

2020-10-12 ML: add bash sections

parent e1f5ee7e
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ To create the clusters on Openstack, it is possible to use the follow Juju bundl
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:
```
```bash
apiVersion: v1
clusters:
- cluster:
......@@ -67,12 +67,12 @@ users:
In this way you have access to all the clusters by the context switch, below are the commands for the context switch:
list contexts:
```
```bash
$ kubectl config get-contexts
```
switch context:
```
```bash
$ kubectl config use-context <context-name>
```
......@@ -82,7 +82,7 @@ $ kubectl config use-context <context-name>
To install the KubeFed client run the following commands in your local machine:
```
```bash
$ VERSION=0.2.0-alpha.1
$ OS=linux
$ ARCH=amd64
......@@ -98,7 +98,7 @@ $ sudo mv kubefedctl /usr/local/bin/ # make sure the location is in the PATH
To install the Controll Plane, switch to the host context and configuring the RBAC role for Tiller (in this case we use Helm v2):
```
```bash
$ cat << EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
......@@ -122,13 +122,14 @@ $ cat << EOF | kubectl apply -f -
```
helm init command:
```
```bash
$ helm init --service-account tiller
```
Now it is possible install the Control Plane on the Host Cluster:
```
```bash
$ helm repo add kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts
$ helm install kubefed-charts/kubefed --name kubefed --version=0.2.0-alpha.1 --namespace kube-federation-system
```
......@@ -142,21 +143,21 @@ $ helm install kubefed-charts/kubefed --name kubefed --version=0.2.0-alpha.1 --n
To create a Kubernetes Federation it is necessary federate Member Clusters. Use the KubeFed `join` command:
```
```bash
$ kubefedctl join fed-cluster-member1 --cluster-context k8s-context-member1 --host-cluster-context k8s-context-host --v=2
$ kubefedctl join fed-cluster-member2 --cluster-context k8s-context-member2 --host-cluster-context k8s-context-host --v=2
```
Remove cluster to the federation, `unjoin` command:
```
```bash
$ kubefedctl unjoin fed-cluster-member1 --cluster-context k8s-context-member1 --host-cluster-context k8s-context-host --v=2
$ kubefedctl unjoin fed-cluster-member2 --cluster-context k8s-context-member2 --host-cluster-context k8s-context-host --v=2
```
Command to show federated clusters:
```
```bash
$ kubectl -n kube-federation-system get kubefedclusters
```
......@@ -165,19 +166,19 @@ $ kubectl -n kube-federation-system get kubefedclusters
To enable a type of resource to be federated it is necessary to use the enable command of kubefedctl:
```
```bash
$ kubefedctl enable <api-resources-name.api-group> --kubefed-namespace kube-federation-system
```
To know the list of resourses:
```
```bash
$ kubectl api-resources -o wide
```
Some examples:
```
```bash
$ kubefedctl enable deployments.apps --kubefed-namespace kube-federation-system
$ kubefedctl enable services --kubefed-namespace kube-federation-system
$ kubefedctl enable ingresses.extensions --kubefed-namespace kube-federation-system
......@@ -185,7 +186,7 @@ $ kubefedctl enable ingresses.extensions --kubefed-namespace kube-federation-sys
Command to disable federated API:
```
```bash
$ kubefedctl disable services --kubefed-namespace kube-federation-system
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment