Skip to content

Instantly share code, notes, and snippets.

@DazWilkin
Last active January 23, 2018 22:26
Show Gist options
  • Save DazWilkin/b965da400f85479d31569c866670bb19 to your computer and use it in GitHub Desktop.
Save DazWilkin/b965da400f85479d31569c866670bb19 to your computer and use it in GitHub Desktop.
Kubernetes 10-domain Ingress
{
// 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