Created
September 10, 2018 15:43
-
-
Save bryanl/dd0d3b7580375c9782b14752290f3ceb to your computer and use it in GitHub Desktop.
ingress.jsonnet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local params = std.extVar('__ksonnet/params').components['site-ingress']; | |
local svcParams = std.extVar('__ksonnet/params').components['site-service']; | |
local deployParams = std.extVar('__ksonnet/params').components['site-deployment']; | |
{ | |
apiVersion: 'extensions/v1beta1', | |
kind: 'Ingress', | |
metadata: { | |
annotations: { | |
'kubernetes.io/ingress.class': 'contour', | |
'kubernetes.io/tls-acme': 'true', | |
'certmanager.k8s.io/cluster-issuer': params.certIssuer, // Set in environment | |
'ingress.kubernetes.io/force-ssl-redirect': 'true', | |
}, | |
name: deployParams.name, | |
}, | |
spec: { | |
rules: [ | |
{ | |
host: host, | |
http: { | |
paths: [ | |
{ | |
backend: { | |
serviceName: deployParams.name, | |
servicePort: svcParams.port, | |
}, | |
path: '/', | |
}, | |
], | |
}, | |
} | |
for host in params.hosts | |
], | |
tls: [ | |
{ | |
hosts: params.hosts, | |
secretName: params.secretName, | |
}, | |
], | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment