-
Notifications
You must be signed in to change notification settings - Fork 115
/
ingress.yaml
43 lines (43 loc) · 2.16 KB
/
ingress.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
apiVersion: "networking.k8s.io/{{ 'v1' if (lookup(k8s_plugin, kind='Ingress', api_version='networking.k8s.io/v1', errors='ignore') is iterable) else 'v1beta1' }}"
kind: Ingress
metadata:
name: {{ kiali_vars.deployment.instance_name }}
namespace: "{{ kiali_vars.deployment.namespace }}"
labels: {{ kiali_vars.deployment.ingress.additional_labels | combine(kiali_resource_metadata_labels) }}
{% if kiali_vars.deployment.ingress.override_yaml is defined and kiali_vars.deployment.ingress.override_yaml.metadata is defined and kiali_vars.deployment.ingress.override_yaml.metadata.annotations is defined %}
{{ kiali_vars.deployment.ingress.override_yaml.metadata | to_nice_yaml(indent=0) | trim | indent(2) }}
{% else %}
annotations:
# For ingress-nginx versions older than 0.20.0
# (see: https://github.com/kubernetes/ingress-nginx/issues/3416#issuecomment-438247948)
nginx.ingress.kubernetes.io/secure-backends: "{{ 'false' if kiali_vars.identity.cert_file == "" else 'true' }}"
# For ingress-nginx versions 0.20.0 and later
nginx.ingress.kubernetes.io/backend-protocol: "{{ 'HTTP' if kiali_vars.identity.cert_file == "" else 'HTTPS' }}"
{% endif %}
spec:
{% if kiali_vars.deployment.ingress.override_yaml is defined and kiali_vars.deployment.ingress.override_yaml.spec is defined %}
{{ kiali_vars.deployment.ingress.override_yaml.spec | to_nice_yaml(indent=0) | trim | indent(2) }}
{% else %}
{% if kiali_vars.deployment.ingress.class_name != "" %}
ingressClassName: {{ kiali_vars.deployment.ingress.class_name }}
{% endif %}
rules:
- http:
paths:
- path: {{ kiali_vars.server.web_root }}
{% if lookup(k8s_plugin, kind='Ingress', api_version='networking.k8s.io/v1', errors='ignore') is iterable %}
pathType: Prefix
backend:
service:
name: {{ kiali_vars.deployment.instance_name }}
port:
number: {{ kiali_vars.server.port }}
{% else %}
backend:
serviceName: {{ kiali_vars.deployment.instance_name }}
servicePort: {{ kiali_vars.server.port }}
{% endif %}
{% if kiali_vars.server.web_fqdn|length != 0 %}
host: {{ kiali_vars.server.web_fqdn }}
{% endif %}
{% endif %}