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

2020-10-13 ML: add service, ingress and Multi-Cluster Ingress DNS sections

parent f9fc8167
......@@ -386,3 +386,110 @@ spec:
```bash
$ kubectl --context=<host-cluster-context> create -f resource/federated_deployment.yaml
```
### Federate service
Create the service for the "fed-helloworld" deployment:
```yaml
# federated_service.yaml
apiVersion: types.kubefed.io/v1beta1
kind: FederatedService
metadata:
name: fed-helloworld-service
namespace: fed-namespace
spec:
template:
metadata:
name: fed-helloworld-service
labels:
app: helloworld
spec:
selector:
app: helloworld
type: ClusterIP
ports:
- name: http
port: 8080
targetPort: 8080
protocol: TCP
placement:
clusters:
- name: member-cluster-1
- name: member-cluster-2
```
```bash
$ kubectl --context=<host-cluster-context> create -f resource/federated_service.yaml
```
### Federate ingress
Now it is possible create the ingress resource for the fed-helloworld-service:
```yaml
# federated_ingress.yaml
apiVersion: types.kubefed.io/v1beta1
kind: FederatedIngress
metadata:
name: fed-helloworld-ingress
namespace: fed-namespace
spec:
template:
metadata:
name: helloworld-ingress
labels:
app: helloworld
spec:
rules:
- host: helloworld.<domain>
http:
paths:
- path: /
backend:
serviceName: fed-helloworld-service
servicePort: 8080
placement:
clusters:
- name: member-cluster-1
- name: member-cluster-2
```
```bash
$ kubectl --context=<host-cluster-context> create -f resource/federated_ingress.yaml
```
### List federated resources
If you want to show or describe the federated resource that have been propagated on the Member Cluster, you can run the follow command:
```bash
$ kubectl describe federated<resource-type>.types.kubefed.io/<resource-name> --namespace <namespace>
```
## Multi-Cluster Ingress DNS
One the service and the ingress are deployed the Multi-Cluster Ingress DNS can be run. To run this meccanism and use the ExternalDNS to configure your DNS Provider, it is necessary create an IngressDNSRecord.
### Create IngressDNSRecord
The IngressDNSRecord resource can be created in the follow way:
```yaml
# ingressdnsrecord.yaml
apiVersion: multiclusterdns.kubefed.io/v1alpha1
kind: IngressDNSRecord
metadata:
name: fed-helloworld-ingress
namespace: fed-namespace
spec:
hosts:
- helloworld.<domain>
recordTTL: 300
```
```bash
$ kubectl --context=<host-cluster-context> create -f resource/ingressdnsrecord.yaml
```
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