yesod-mirror/k8s/configs/environments/sourcebot/main.jsonnet
Copybara 8157b39ea4
Some checks failed
CI / build (push) Failing after 12s
Project import generated by Copybara.
GitOrigin-RevId: 6370f6ea785709295b6abcf9c60717cacf3ac432
2026-01-20 21:26:21 +00:00

159 lines
No EOL
4.2 KiB
Jsonnet

local base = import 'k8s/configs/base.libsonnet';
local linuxserver = import 'k8s/configs/templates/core/linuxserver.libsonnet';
local nginxIngress = import 'k8s/configs/templates/core/network/nginx-ingress.libsonnet';
local namespaceName = 'sourcebot';
local appName = 'sourcebot';
local WebPort = 3000;
local params = linuxserver.AppParams {
name: appName,
baseAppName: appName,
namespace: namespaceName,
imageName: 'sourcebot',
filePath: std.thisFile,
templatePath: std.thisFile,
authUrl: 'https://sourcebot.csbx.dev',
ports: [ base.DeployUtil.ContainerPort("http", WebPort), ],
services: [
linuxserver.Service {
suffix: "ui",
spec: base.SvcUtil.BasicHttpClusterIpSpec(WebPort)
},
],
pvcs: [
linuxserver.Pvc {
name: 'data',
bindName: appName + '-data',
mountPath: '/data',
},
],
resources: {
requests: {
cpu: "1000m",
memory: "2Gi",
},
limits: {
cpu: "2000m",
memory: "4Gi",
},
},
configMaps: [
linuxserver.ConfigMap {
name: 'config',
bindName: appName,
mountPath: '/etc/sourcebot',
},
],
env+: {
others+: [
base.NameVal('CONFIG_PATH', '/etc/sourcebot/config.json'),
base.NameVal('AUTH_URL', $.authUrl),
base.NameVal('SOURCEBOT_TELEMETRY_DISABLED', 'true'),
{
name: 'GITEA_TOKEN',
valueFrom: {
secretKeyRef: {
name: 'gitea-token',
key: 'token',
},
},
},
],
},
};
{
namespace: {
apiVersion: 'v1',
kind: 'Namespace',
metadata: {
name: namespaceName,
},
},
pvc: base.RecoverableSimplePvc(namespaceName, appName + '-data', 'nfs-client', '10Gi', {
volumeName: "pvc-55405f2b-f253-4e3e-a45f-2a1a18f75c89",
nfsPath: "/volume3/fs/sourcebot-sourcebot-data-pvc-55405f2b-f253-4e3e-a45f-2a1a18f75c89",
nfsServer: "apollo1.dominion.lan",
}),
pvc2: base.RecoverableSimplePvc(namespaceName, appName + '-2-data', 'nfs-client', '10Gi', {
volumeName: "pvc-73d0ed19-562b-4bd9-a198-d8a5d21f0146",
nfsPath: "/volume3/fs/sourcebot-sourcebot-2-data-pvc-73d0ed19-562b-4bd9-a198-d8a5d21f0146",
nfsServer: "apollo1.dominion.lan",
}),
secret: base.Secret(namespaceName, 'gitea-token') {
stringData: {
token: '539779da7d1a922e1c1ba61e5ff25909b5bdca2d',
},
},
configmap: base.ConfigMap(namespaceName, appName) {
data: {
'config.json': |||
{
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
"connections": {
"forgejo": {
"type": "gitea",
"url": "https://forgejo.csbx.dev",
"token": {
"env": "GITEA_TOKEN"
},
"repos": [
"acmcarther/infra2",
"acmcarther/yesod",
"acmcarther/sourcebot",
"acmcarther/qwen-code"
]
}
}
}
|||
},
},
configmap2: base.ConfigMap(namespaceName, appName + '-2') {
data: {
'config.json': |||
{
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
"connections": {
"forgejo": {
"type": "gitea",
"url": "https://forgejo.csbx.dev",
"token": {
"env": "GITEA_TOKEN"
},
"repos": [
"acmcarther/yesod-mirror",
]
}
}
}
|||
},
},
app: linuxserver.App(params),
app2: linuxserver.App(params {
name: appName + '-2',
authUrl: 'https://source-mirror.csbx.dev',
}),
ingress1: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespaceName,
name: appName,
hosts: [
'sourcebot.csbx.dev',
],
annotations: nginxIngress.KubeCsbxOauthProxyAnnotations,
serviceName: appName + '-ui',
}),
ingress2: nginxIngress.Ingress(nginxIngress.IngressParams {
namespace: namespaceName,
name: appName + '-2',
hosts: [
'source-mirror.csbx.dev',
],
annotations: nginxIngress.KubeCsbxOauthProxyAnnotations,
serviceName: appName + '-2-ui',
}),
}