mirror of https://gerrit.hackerspace.pl/hscloud
hswaw/labelmaker: add jspaint
Change-Id: Iae72a5ba9d023803944502ce7416a408c1f55077 Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1897 Reviewed-by: informatic <informatic@hackerspace.pl>changes/97/1897/4
parent
4628133cb0
commit
ef3100332d
|
@ -0,0 +1,91 @@
|
|||
local kube = import "../../kube/hscloud.libsonnet";
|
||||
|
||||
{
|
||||
local top = self,
|
||||
local cfg = self.cfg,
|
||||
|
||||
cfg:: {
|
||||
name: 'jspaint',
|
||||
namespace: 'labelmaker',
|
||||
domain: 'pixel.label.hackerspace.pl',
|
||||
images: {
|
||||
app: 'registry.k0.hswaw.net/radex/jspaint:20240202221310',
|
||||
proxy: "quay.io/oauth2-proxy/oauth2-proxy:v7.2.1",
|
||||
},
|
||||
},
|
||||
|
||||
secretRefs:: {
|
||||
cookie_secret: { secretKeyRef: { name: "jspaint-proxy", key: "cookie_secret" } },
|
||||
oidc_secret: { secretKeyRef: { name: "jspaint-proxy", key: "oidc_secret" } },
|
||||
},
|
||||
|
||||
local ns = kube.Namespace(cfg.namespace),
|
||||
|
||||
deployment: ns.Contain(kube.Deployment(cfg.name)) {
|
||||
spec+: {
|
||||
replicas: 1,
|
||||
template+: {
|
||||
spec+: {
|
||||
containers_: {
|
||||
default: kube.Container("default") {
|
||||
image: cfg.images.proxy,
|
||||
ports_: {
|
||||
http: { containerPort: 8001 },
|
||||
},
|
||||
env_: {
|
||||
OAUTH2_PROXY_UPSTREAMS: "http://127.0.0.1:8080",
|
||||
OAUTH2_PROXY_HTTP_ADDRESS: "0.0.0.0:8001",
|
||||
|
||||
OAUTH2_PROXY_COOKIE_SECRET: top.secretRefs.cookie_secret,
|
||||
|
||||
OAUTH2_PROXY_PROVIDER: "oidc",
|
||||
OAUTH2_PROXY_OIDC_ISSUER_URL: "https://sso.hackerspace.pl",
|
||||
OAUTH2_PROXY_SKIP_PROVIDER_BUTTON: "true",
|
||||
|
||||
OAUTH2_PROXY_CLIENT_ID: "42ab4167-fb20-4f8a-86e2-7d1c0bd59dea",
|
||||
OAUTH2_PROXY_CLIENT_SECRET: top.secretRefs.oidc_secret,
|
||||
|
||||
OAUTH2_PROXY_EMAIL_DOMAINS: "*",
|
||||
|
||||
OAUTH2_PROXY_REVERSE_PROXY: true,
|
||||
OAUTH2_PROXY_TRUSTED_IPS: "185.236.240.5", // customs.hackerspace.pl
|
||||
},
|
||||
},
|
||||
|
||||
app: kube.Container("app") {
|
||||
image: cfg.images.app,
|
||||
ports_: {
|
||||
http: { containerPort: 8080 },
|
||||
},
|
||||
volumeMounts: [
|
||||
{
|
||||
name: 'config',
|
||||
subPath: 'default.conf',
|
||||
mountPath: '/etc/nginx/conf.d/default.conf'
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
volumes_: {
|
||||
config: top.config.volume,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
config: ns.Contain(kube.ConfigMap(cfg.name + '-config')) {
|
||||
data: {
|
||||
'default.conf': importstr 'nginx.default.conf',
|
||||
},
|
||||
},
|
||||
|
||||
service: ns.Contain(kube.Service(cfg.name)) {
|
||||
target:: top.deployment,
|
||||
},
|
||||
|
||||
ingress: ns.Contain(kube.SimpleIngress(cfg.name)) {
|
||||
hosts:: [cfg.domain],
|
||||
target:: top.service,
|
||||
},
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
local method_draw = import "./method-draw.libsonnet";
|
||||
local jspaint = import "./jspaint.libsonnet";
|
||||
|
||||
{
|
||||
vector: method_draw,
|
||||
pixel: jspaint,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue