mirror of
https://gerrit.hackerspace.pl/hscloud
synced 2025-03-26 04:04:53 +00:00
devtools: fix sourcegraph
Permissions get mangled on container restart. This adds an init container to fix them. Change-Id: I37c44e23a75b8ec41e6aba2ed38eee223496b8b9
This commit is contained in:
parent
31e41d5ff7
commit
b7898a8038
2 changed files with 15 additions and 1 deletions
|
@ -21,7 +21,19 @@ local kube = import "../../kube/kube.libsonnet";
|
|||
},
|
||||
securityContext: {
|
||||
runAsUser: 0,
|
||||
fsGroup: 70,
|
||||
fsGroup: 0,
|
||||
},
|
||||
// This container fixes some permissions that Kubernetes volume mounts break.
|
||||
initContainer: sourcegraph.Container("fixperms") {
|
||||
image: "alpine:3",
|
||||
volumeMounts_+: {
|
||||
data: { mountPath: "/var/opt/sourcegraph" },
|
||||
},
|
||||
ports_: {},
|
||||
command: [
|
||||
"sh", "-c",
|
||||
"chmod 755 /var/opt/sourcegraph; chmod -R 700 /var/opt/sourcegraph/postgresql",
|
||||
],
|
||||
},
|
||||
container: sourcegraph.Container("main") {
|
||||
volumeMounts_+: {
|
||||
|
|
|
@ -129,6 +129,7 @@ local kube = import "kube.libsonnet";
|
|||
nodeSelector: null,
|
||||
securityContext: {},
|
||||
container:: error "container(s) must be set",
|
||||
initContainer:: null,
|
||||
ports:: {
|
||||
publicHTTP: {}, // name -> { port: no, dns: fqdn }
|
||||
grpc: { main: 4200 }, // name -> port no
|
||||
|
@ -189,6 +190,7 @@ local kube = import "kube.libsonnet";
|
|||
},
|
||||
} + cfg.volumes,
|
||||
containers_: cfg.containers,
|
||||
[if cfg.initContainer != null then "initContainers"]: [cfg.initContainer],
|
||||
nodeSelector: cfg.nodeSelector,
|
||||
|
||||
serviceAccountName: component.sa.metadata.name,
|
||||
|
|
Loading…
Add table
Reference in a new issue