yesod-mirror/k8s/configs/templates/personal/home/home-assistant.libsonnet

67 lines
1.5 KiB
Jsonnet
Raw 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 homeAssistantProbe(delaySeconds) = {
initialDelaySeconds: delaySeconds,
periodSeconds: 15,
tcpSocket: {
port: "http",
},
};
local Params = kube.simpleFieldStruct([
"namespace",
"name",
"filePath",
"filesClaimName",
]) {
local webPort = 8123,
labels: {},
gatekeeperSidecar: null,
lsParams: linuxserver.AppParams {
name: $.name,
namespace: $.namespace,
filePath: $.filePath,
templatePath: std.thisFile,
baseAppName: "home-assistant",
imageName: "linuxserver/homeassistant",
labels+: $.labels,
gatekeeperSidecar: $.gatekeeperSidecar,
services: [
linuxserver.Service {
suffix: "ui",
spec: kube.SvcUtil.BasicHttpClusterIpSpec(webPort)
},
],
ports: [ kube.DeployUtil.ContainerPort("http", webPort), ],
pvcs: [
linuxserver.Pvc{
name: "files",
mountPath: "/config",
bindName: $.filesClaimName,
},
],
resources: {
requests: {
cpu: "500m",
memory: "500Mi",
},
limits: {
cpu: "1000m",
memory: "1000Mi",
},
},
livenessProbe: homeAssistantProbe(/*delaySeconds=*/30),
readinessProbe: homeAssistantProbe(/*delaySeconds=*/30),
},
};
local App(params) = linuxserver.App(params.lsParams);
{
Params: Params,
App(params): App(params),
}