Add tls,and enable multi hosts in horizon ingress

Aassuming the usge of nginx ingress controller, cert-manager and letsencrypt clusterissuer.
Multi hosts are based on the same backend service.

Change-Id: Ia4c02847afa380a234fa738d467ddbd011270100
This commit is contained in:
okozachenko 2020-05-18 16:25:07 +03:00
parent 5bb1c87d15
commit e3da5a50e4
2 changed files with 28 additions and 1 deletions

View File

@ -6,4 +6,5 @@ metadata:
prometheus: helm
spec:
ingress:
host: "horizon.vexxhost.com"
- host: "horizon1.vexxhost.com"
- host: "horizon2.vexxhost.com"

View File

@ -18,7 +18,11 @@ kind: Ingress
metadata:
name: horizon
namespace: openstack
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
cert-manager.k8s.io/cluster-issuer: "letsencrypt-prod"
spec:
{% if spec.ingress.host is defined %}
rules:
- host: {{ spec.ingress.host }}
http:
@ -27,3 +31,25 @@ spec:
backend:
serviceName: horizon
servicePort: 80
tls:
- hosts:
- {{ spec.ingress.host }}
secretName: horizon-tls
{% else %}
rules:
{% for v in spec.ingress %}
- host: {{ v.host }}
http:
paths:
- path: /
backend:
serviceName: horizon
servicePort: 80
{% endfor %}
tls:
- hosts:
{% for v in spec.ingress %}
- {{ v.host }}
{% endfor %}
secretName: horizon-tls
{% endif %}