diff --git a/README.md b/README.md index 115329a62de910b0887a49289bbe022178bf0225..ca45b6eec290d5a5c903371ef06b7d00773cd983 100644 --- a/README.md +++ b/README.md @@ -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.