configure tls on ingress

This commit is contained in:
Tobias Brunner 2020-03-01 15:04:30 +01:00
parent c8c8c7f712
commit 3d9b8c252e
2 changed files with 10 additions and 0 deletions

View file

@ -14,3 +14,7 @@ spec:
- backend:
serviceName: grafana
servicePort: http
tls:
- hosts:
- grafana.knurrli.tbrnt.ch
secretName: grafana-ingress-cert

View file

@ -1,6 +1,7 @@
local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
local pvc = k.core.v1.persistentVolumeClaim;
local ingress = k.extensions.v1beta1.ingress;
local ingressTls = ingress.mixin.spec.tlsType;
local ingressRule = ingress.mixin.spec.rulesType;
local httpIngressPath = ingressRule.mixin.http.pathsType;
@ -56,6 +57,11 @@ local kp =
httpIngressPath.mixin.backend.withServiceName('grafana') +
httpIngressPath.mixin.backend.withServicePort('http')
),
) +
ingress.mixin.spec.withTls(
ingressTls.new() +
ingressTls.withHosts('grafana.knurrli.tbrnt.ch') +
ingressTls.withSecretName('grafana-ingress-cert')
),
},
};