yesod-mirror/k8s/configs/templates/dev/organization/focalboard.libsonnet

127 lines
3 KiB
Jsonnet
Raw Permalink Normal View History

local kube = import "k8s/configs/base.libsonnet";
local linuxserver = import "k8s/configs/templates/core/linuxserver.libsonnet";
local images = import "k8s/configs/images.libsonnet";
local probe(delaySeconds) = {
initialDelaySeconds: delaySeconds,
periodSeconds: 30,
tcpSocket: {
port: "http",
},
};
local ConfigMap(params) = kube.ConfigMap(params.namespace, params.name + "-config") {
data: {
"config.json": "",
/*
|||
{
"serverRoot": "http://localhost:8000",
"port": 8000,
"dbtype": "sqlite3",
"dbconfig": "./focalboard.db?_busy_timeout=5000",
"dbtableprefix": "",
"postgres_dbconfig": "dbname=focalboard sslmode=disable",
"useSSL": false,
"webpath": "./webapp/pack",
"filesdriver": "local",
"filespath": "./files",
"telemetry": true,
"prometheusaddress": ":9092",
"webhook_update": [],
"session_expire_time": 2592000,
"session_refresh_time": 18000,
"localOnly": false,
"enableLocalMode": true,
"localModeSocketLocation": "/var/tmp/focalboard_local.socket",
"authMode": "native",
"logging_cfg_file": "",
"audit_cfg_file": "",
"enablePublicSharedBoards": false
}
|||,
*/
},
};
local WebPort = 8000;
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"dataClaimName",
]) {
labels: {},
gatekeeperSidecar: null,
configMapName: $.name + "-config",
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "focalboard",
imageName: "mattermost/focalboard",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
ports: [ kube.DeployUtil.ContainerPort("http", WebPort), ],
env: linuxserver.Env {
others: [
kube.NameVal("VIRTUAL_HOST", "localhost"),
kube.NameVal("VIRTUAL_PORT", "8000"),
kube.NameVal("VIRTUAL_PROTO", "http"),
]
},
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
pvcs: [
linuxserver.Pvc{
name: "data",
mountPath: "/opt/focalboard/data",
bindName: $.dataClaimName,
},
],
/*
configMaps: [
linuxserver.ConfigMap {
name: "config",
mountPath: "/opt/focalboard/config.json",
bindName: $.configMapName,
mountSubPath: "config.json",
items: [
{
key: "config.json",
path: "config.json",
},
],
},
],
*/
resources: {
requests: {
cpu: "10m",
memory: "128Mi",
},
limits: {
cpu: "50m",
memory: "256Mi",
},
},
livenessProbe: probe(/*delaySeconds=*/60),
readinessProbe: probe(/*delaySeconds=*/60),
},
};
local App(params) = linuxserver.App(params.lsParams) {
configMap: ConfigMap(params),
};
{
Params: Params,
WebPort: WebPort,
App(params): App(params),
}