|
| 1 | +--- |
| 2 | +# the following tasks are only for local environments, not for production environments |
| 3 | +# gardener exposes the istio ingress gateway through service type load balancer |
| 4 | +# we can fake the exposal by patching the status field, which is also what's |
| 5 | +# done in the gardener local environment |
| 6 | + |
| 7 | +- name: Patch istio ingress gateway service to allow the seed to get ready (for local environments) |
| 8 | + block: |
| 9 | + - name: Wait for istio ingress gateway service |
| 10 | + kubernetes.core.k8s_info: |
| 11 | + api_version: v1 |
| 12 | + kind: Service |
| 13 | + name: istio-ingressgateway |
| 14 | + namespace: virtual-garden-istio-ingress |
| 15 | + register: result |
| 16 | + until: result.resources |
| 17 | + retries: 30 |
| 18 | + delay: 10 |
| 19 | + |
| 20 | + - name: Patch istio ingress gateway service status |
| 21 | + patch_service_status_k8s: |
| 22 | + name: istio-ingressgateway |
| 23 | + namespace: virtual-garden-istio-ingress |
| 24 | + body: |
| 25 | + status: |
| 26 | + loadBalancer: |
| 27 | + ingress: |
| 28 | + - ip: "{{ gardener_operator_patch_istio_ingress_gateway_service_ip }}" |
| 29 | + when: gardener_operator_patch_istio_ingress_gateway_service_ip |
| 30 | + |
| 31 | +# as we do not have service type load balancer in the local environment, this is optional for those setups |
| 32 | +- name: Expose istio gateway through ingress-nginx (for local environments) |
| 33 | + k8s: |
| 34 | + definition: |
| 35 | + apiVersion: networking.k8s.io/v1 |
| 36 | + kind: Ingress |
| 37 | + metadata: |
| 38 | + annotations: |
| 39 | + nginx.ingress.kubernetes.io/ssl-passthrough: "true" |
| 40 | + name: apiserver-ingress |
| 41 | + namespace: virtual-garden-istio-ingress |
| 42 | + spec: |
| 43 | + ingressClassName: nginx |
| 44 | + rules: |
| 45 | + - host: "api.{{ gardener_operator_virtual_garden_public_dns }}" |
| 46 | + http: |
| 47 | + paths: |
| 48 | + - path: / |
| 49 | + pathType: Prefix |
| 50 | + backend: |
| 51 | + service: |
| 52 | + name: istio-ingressgateway |
| 53 | + port: |
| 54 | + number: 443 |
| 55 | + tls: |
| 56 | + - hosts: |
| 57 | + - "api.{{ gardener_operator_virtual_garden_public_dns }}" |
| 58 | + when: gardener_operator_expose_virtual_garden_through_ingress_nginx |
0 commit comments