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

2020-10-12 ML: add namespace section

parent bd33723e
No related branches found
No related tags found
No related merge requests found
......@@ -160,6 +160,7 @@ Command to show federated clusters:
$ kubectl -n kube-federation-system get kubefedclusters
```
## Enable API
To enable a type of resource to be federated it is necessary to use the enable command of kubefedctl:
......@@ -189,3 +190,56 @@ $ kubefedctl disable services --kubefed-namespace kube-federation-system
```
**N.B.**: Do not federate the “kind: pod” resource. In this case, federating a whole namespace will federate pods and deployments at the same time. Deployments will create replicasets which in turn create pods. It will result a duplication of the pods resources.
## Deploy application
Below the procedure to deploy and federate an application and enable ExternalDNS.
### Create namespace (Host Cluster)
The first step is create a namespace in the host cluster:
command line:
```bash
$ kubectl create namespace <namespace-name>
```
or create it by yaml file (resource/namespace.yaml):
```yaml
# namespace.yaml file
apiVersion: v1
kind: Namespace
metadata:
name: fed-namespace
```
```bash
$ kubectl create -f resource/namespace.yaml
```
### Federate namespace
Once the namespace is created in the Host Cluster, it can be federate on the Member Cluster:
```yaml
# federated_namespace.yaml
apiVersion: types.kubefed.io/v1beta1
kind: FederatedNamespace
metadata:
name: fed-namespace
namespace: fed-namespace
spec:
placement:
clusters:
- name: member-cluster-1
- name: member-cluster-2
```
```bash
$ kubectl --context=<host-cluster-context> create -f resource/federated_namespace.yaml
```
**N.B.**: the option `--context` is not necessary but make sure that the right context is selected.
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