k8s: import other apps
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Cadey Ratio 2020-01-25 18:54:21 +00:00
parent 81d091659f
commit 35e2add229
7 changed files with 87 additions and 14 deletions

View File

@ -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
}
}

15
k8s/apps/idp.dhall Normal file
View File

@ -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

14
k8s/apps/olin.dhall Normal file
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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