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

2020-10-12 ML: add namespace section

parent bd33723e
......@@ -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:
$ kubectl create namespace <namespace-name>
or create it by yaml file (resource/namespace.yaml):
# namespace.yaml file
apiVersion: v1
kind: Namespace
name: fed-namespace
$ 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:
# federated_namespace.yaml
kind: FederatedNamespace
name: fed-namespace
namespace: fed-namespace
- name: member-cluster-1
- name: member-cluster-2
$ 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.
Supports Markdown
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