diff --git a/k8s/app/config.dhall b/k8s/app/config.dhall index 1f0a6d4..bcd2cca 100644 --- a/k8s/app/config.dhall +++ b/k8s/app/config.dhall @@ -5,15 +5,19 @@ in { Type = , appPort : Natural , image : Text , domain : Text + , replicas : Natural , leIssuer : Text , envVars : List kubernetes.EnvVar.Type + , otherContainers : List kubernetes.Container.Type } , default = { name = "" , appPort = 5000 , image = "" , domain = "" + , replicas = 1 , leIssuer = "staging" , envVars = [] : List kubernetes.EnvVar.Type + , otherContainers = [] : List kubernetes.Container.Type } } diff --git a/k8s/apps/idp.dhall b/k8s/apps/idp.dhall new file mode 100644 index 0000000..29bda97 --- /dev/null +++ b/k8s/apps/idp.dhall @@ -0,0 +1,15 @@ +let makeApp = ../app/make.dhall + +let Config = ../app/config.dhall + +let cfg = + Config::{ + , name = "idp" + , appPort = 5000 + , image = "xena/idp:031320190918" + , domain = "idp.christine.website" + , leIssuer = "prod" + , envVars = /home/cadey/code/within-terraform-secret/idp.dhall + } + +in makeApp cfg diff --git a/k8s/apps/olin.dhall b/k8s/apps/olin.dhall new file mode 100644 index 0000000..24a259d --- /dev/null +++ b/k8s/apps/olin.dhall @@ -0,0 +1,14 @@ +let makeApp = ../app/make.dhall + +let Config = ../app/config.dhall + +let cfg = + Config::{ + , name = "olin" + , appPort = 5000 + , image = "xena/olin:latest" + , domain = "olin.within.website" + , leIssuer = "prod" + } + +in makeApp cfg diff --git a/k8s/apps/tulpaforce.xyz.dhall b/k8s/apps/tulpaforce.xyz.dhall new file mode 100644 index 0000000..995740a --- /dev/null +++ b/k8s/apps/tulpaforce.xyz.dhall @@ -0,0 +1,16 @@ +let makeApp = ../app/make.dhall + +let Config = ../app/config.dhall + +let image = env:DOCKER_IMAGE as Text ? "xena/tulpaforce:20190906" + +let cfg = + Config::{ + , name = "tulpaforcexyz" + , appPort = 80 + , image = image + , domain = "tulpaforce.xyz" + , leIssuer = "prod" + } + +in makeApp cfg diff --git a/k8s/apps/within.website.dhall b/k8s/apps/within.website.dhall new file mode 100644 index 0000000..a9f6528 --- /dev/null +++ b/k8s/apps/within.website.dhall @@ -0,0 +1,16 @@ +let makeApp = ../app/make.dhall + +let Config = ../app/config.dhall + +let image = env:DOCKER_IMAGE as Text ? "xena/within.website:091120192252" + +let cfg = + Config::{ + , name = "withinwebsite" + , appPort = 5000 + , image = image + , domain = "within.website" + , leIssuer = "prod" + } + +in makeApp cfg diff --git a/k8s/http/deployment.dhall b/k8s/http/deployment.dhall index c30993f..c0fb555 100644 --- a/k8s/http/deployment.dhall +++ b/k8s/http/deployment.dhall @@ -11,20 +11,27 @@ let selector = ./selector.dhall let podSpec : Config.Type → kubernetes.PodSpec.Type = λ(config : Config.Type) - → kubernetes.PodSpec::{ - , containers = - [ kubernetes.Container::{ - , name = "web" - , env = config.envVars - , image = Some config.image - , imagePullPolicy = Some "Always" - , ports = - [ kubernetes.ContainerPort::{ containerPort = config.appPort } ] + → let rootContainer = + [ kubernetes.Container::{ + , name = "web" + , env = config.envVars + , image = Some config.image + , imagePullPolicy = Some "Always" + , ports = + [ kubernetes.ContainerPort::{ containerPort = config.appPort } + ] + } + ] + + let other = config.otherContainers + + let combined = rootContainer # other + + in kubernetes.PodSpec::{ + , containers = combined + , imagePullSecrets = + [ kubernetes.LocalObjectReference::{ name = Some "regcred" } ] } - ] - , imagePullSecrets = - [ kubernetes.LocalObjectReference::{ name = Some "regcred" } ] - } let spec = λ(config : Config.Type) @@ -32,6 +39,7 @@ let spec = , selector = kubernetes.LabelSelector::{ , matchLabels = selector config.name } + , replicas = Some config.replicas , template = kubernetes.PodTemplateSpec::{ , metadata = kubernetes.ObjectMeta::{ , name = config.name diff --git a/k8s/typesUnion.dhall b/k8s/typesUnion.dhall index a9d5ef6..4bf1569 100644 --- a/k8s/typesUnion.dhall +++ b/k8s/typesUnion.dhall @@ -1 +1 @@ -https://raw.githubusercontent.com/dhall-lang/dhall-kubernetes/master/1.15/typesUnion.dhall sha256:930a34021bd380209b6763d4a98fb16e1f5608fe5e8d1403d0ec03f6c4a08f00 +https://xena.greedo.xeserv.us/pkg/dhall/dhall-kubernetes/1.15/typesUnion.dhall sha256:930a34021bd380209b6763d4a98fb16e1f5608fe5e8d1403d0ec03f6c4a08f00