Last active
January 23, 2018 22:26
-
-
Save DazWilkin/b965da400f85479d31569c866670bb19 to your computer and use it in GitHub Desktop.
Kubernetes 10-domain Ingress
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
{ | |
// Required arguments | |
serviceName:: error "'name' must be specified", | |
servicePort:: error "'servicePort' must be specified", | |
prefix:: error "'prefix' must be specified", | |
domain:: error "'domain' must be specified", | |
local name(num) = $.prefix + num + “.” + $.domain | |
apiVersion: "extensions/v1beta1", | |
kind: "Ingress", | |
metadata: { | |
name: $.serviceName, | |
annotations: { | |
"kubernetes.io/ingress.class": "gce" | |
}, | |
}, | |
spec: { | |
rules:[ | |
{ | |
host: name(num), | |
http: { | |
paths: [ | |
{ | |
backend: { | |
serviceName: $.serviceName, | |
servicePort: $.servicePort, | |
}, | |
}, | |
], | |
}, | |
} | |
for num in [0,1,2,3,4,5,6,7,8,9] | |
], | |
tls: [ | |
{ | |
hosts: [name(num)], | |
secretName: name(num) | |
} | |
for num in [0,1,2,3,4,5,6,7,8,9] | |
], | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment