Some checks failed
CI / build (push) Failing after 12s
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
118 lines
2.9 KiB
Jsonnet
118 lines
2.9 KiB
Jsonnet
local kube = import "k8s/configs/base.libsonnet";
|
|
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
|
|
local images = import "k8s/configs/images.libsonnet";
|
|
|
|
local SecretParams = kube.simpleFieldStruct([
|
|
"namespace",
|
|
"name",
|
|
"vikunja_db_password",
|
|
"vikunja_jwt_secret",
|
|
]);
|
|
|
|
local Secret(params) = kube.Secret(params.namespace, params.name) {
|
|
type: "Opaque",
|
|
data+: {
|
|
"vikunja-db-pwd": params.vikunja_db_password,
|
|
"vikunja-jwt-secret": params.vikunja_jwt_secret,
|
|
}
|
|
};
|
|
|
|
local probe(delaySeconds) = {
|
|
initialDelaySeconds: delaySeconds,
|
|
periodSeconds: 30,
|
|
tcpSocket: {
|
|
port: "http",
|
|
},
|
|
};
|
|
|
|
local WebPort = 3456;
|
|
local Params = kube.simpleFieldStruct([
|
|
"namespace",
|
|
"name",
|
|
"filePath",
|
|
"dataClaimName",
|
|
"ingressBaseUrl", # something.com/
|
|
"postgresHost",
|
|
"secretName",
|
|
]) {
|
|
jwtSecretKey: "vikunja-jwt-secret",
|
|
dbPwdSecretKey: "vikunja-db-pwd",
|
|
postgresDbUser: "vikunja",
|
|
postgresDbName: "vikunja",
|
|
//postgresSchema: "public",
|
|
timezone: "US/Pacific",
|
|
labels: {},
|
|
gatekeeperSidecar: null,
|
|
lsParams: linuxserver.AppParams {
|
|
name: $.name,
|
|
namespace: $.namespace,
|
|
filePath: $.filePath,
|
|
templatePath: std.thisFile,
|
|
baseAppName: "vikunja",
|
|
imageName: "vikunja/vikunja",
|
|
labels+: $.labels,
|
|
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
|
|
env: linuxserver.Env {
|
|
others: [
|
|
kube.NameVal("VIKUNJA_SERVICE_PUBLICURL", $.ingressBaseUrl),
|
|
kube.NameVal("VIKUNJA_DATABASE_HOST", $.postgresHost),
|
|
kube.NameVal("VIKUNJA_DATABASE_TYPE", "postgres"),
|
|
kube.NameVal("VIKUNJA_DATABASE_USER", $.postgresDbUser),
|
|
kube.NameVal("VIKUNJA_DATABASE_DATABASE", $.postgresDbName),
|
|
{
|
|
name: "VIKUNJA_SERVICE_JWTSECRET",
|
|
valueFrom: {
|
|
secretKeyRef: {
|
|
name: $.secretName,
|
|
key: $.jwtSecretKey,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
name: "VIKUNJA_DATABASE_PASSWORD",
|
|
valueFrom: {
|
|
secretKeyRef: {
|
|
name: $.secretName,
|
|
key: $.dbPwdSecretKey,
|
|
},
|
|
},
|
|
},
|
|
],
|
|
},
|
|
services: [
|
|
linuxserver.Service {
|
|
suffix: "ui",
|
|
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
|
|
},
|
|
],
|
|
pvcs: [
|
|
linuxserver.Pvc{
|
|
name: "files",
|
|
mountPath: "/app/vikunja/files",
|
|
bindName: $.dataClaimName,
|
|
},
|
|
],
|
|
resources: {
|
|
requests: {
|
|
cpu: "250m",
|
|
memory: "512Mi",
|
|
},
|
|
limits: {
|
|
cpu: "500m",
|
|
memory: "1Gi",
|
|
},
|
|
},
|
|
livenessProbe: probe(/*delaySeconds=*/20),
|
|
readinessProbe: probe(/*delaySeconds=*/20),
|
|
},
|
|
};
|
|
|
|
local App(params) = linuxserver.App(params.lsParams) {};
|
|
|
|
{
|
|
Params: Params,
|
|
WebPort: WebPort,
|
|
App(params): App(params),
|
|
SecretParams: SecretParams,
|
|
Secret(params): Secret(params)
|
|
}
|