Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c0bbe2d12 |
4 changed files with 28 additions and 23 deletions
|
|
@ -79,11 +79,8 @@ spec:
|
||||||
image: docker:27-dind
|
image: docker:27-dind
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
# The image's own user. No root needed: the dind socket is created
|
# root is needed for exactly one thing: chown of the PVC.
|
||||||
# 0660 root:1000 by `dockerd --group 1000`, and fix-data-perms
|
runAsUser: 0
|
||||||
# re-owns the PVC as 1000:1000 so the actions cache is writable.
|
|
||||||
runAsUser: 1000
|
|
||||||
runAsGroup: 1000
|
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
|
|
@ -175,14 +172,12 @@ spec:
|
||||||
- name: runner
|
- name: runner
|
||||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
# The image runs as uid 1000. The dind socket is created 660
|
|
||||||
# root:docker and the one-shot chmod 666 in the dind container can
|
|
||||||
# race a dockerd restart, after which the runner crashloops on
|
|
||||||
# "permission denied ... /var/run/docker.sock" (its wait loop only
|
|
||||||
# checks that the socket exists). Running the runner as root removes
|
|
||||||
# the dependency on that race; it is the uid the dind setup assumes.
|
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
# The image's own user. No root needed: the dind socket is 0660
|
||||||
|
# root:1000 (`dockerd --group 1000`) and fix-data-perms owns the PVC
|
||||||
|
# as 1000:1000, so the actions cache is writable.
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,8 @@ spec:
|
||||||
image: docker:27-dind
|
image: docker:27-dind
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
securityContext:
|
securityContext:
|
||||||
# Image default user (uid 1000). No root needed: the dind socket is
|
# root is needed for exactly one thing: chown of the PVC.
|
||||||
# 0660 root:1000 (dockerd --group 1000) and fix-data-perms owns the
|
runAsUser: 0
|
||||||
# PVC as 1000:1000.
|
|
||||||
runAsUser: 1000
|
|
||||||
runAsGroup: 1000
|
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
|
|
@ -148,13 +145,12 @@ spec:
|
||||||
# job in onionwire/siriusdevops-contact.
|
# job in onionwire/siriusdevops-contact.
|
||||||
image: code.forgejo.org/forgejo/runner:5.0.1
|
image: code.forgejo.org/forgejo/runner:5.0.1
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
# uid 1000 in this image vs a `660 root:docker` dind socket: the dind
|
|
||||||
# container's one-shot chmod 666 can race a dockerd restart and the
|
|
||||||
# runner's wait loop only checks that the socket exists, so it would
|
|
||||||
# crashloop on "permission denied". Running as root is what the amd64
|
|
||||||
# runner proved deterministic (2eff85b).
|
|
||||||
securityContext:
|
securityContext:
|
||||||
runAsUser: 0
|
# The image's own user. No root needed: the dind socket is 0660
|
||||||
|
# root:1000 (`dockerd --group 1000`) and fix-data-perms owns the PVC
|
||||||
|
# as 1000:1000, so the actions cache is writable.
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,14 @@ kind: Namespace
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.io/name: cloudnative-pg
|
app.kubernetes.io/name: cloudnative-pg
|
||||||
|
# Pod Security: warn/audit only. The operator pods are baseline-clean today,
|
||||||
|
# but this namespace is upstream-managed and we do not want a future
|
||||||
|
# operator version to be rejected on a cluster upgrade without warning;
|
||||||
|
# warn/audit makes any such pod visible first.
|
||||||
|
pod-security.kubernetes.io/warn: restricted
|
||||||
|
pod-security.kubernetes.io/warn-version: latest
|
||||||
|
pod-security.kubernetes.io/audit: restricted
|
||||||
|
pod-security.kubernetes.io/audit-version: latest
|
||||||
name: cnpg-system
|
name: cnpg-system
|
||||||
---
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
|
|
|
||||||
|
|
@ -11,3 +11,9 @@ metadata:
|
||||||
# run with a read-only root filesystem; the only real privilege is the root
|
# run with a read-only root filesystem; the only real privilege is the root
|
||||||
# UID needed to read journal files (0640 root:systemd-journal).
|
# UID needed to read journal files (0640 root:systemd-journal).
|
||||||
pod-security.kubernetes.io/enforce: privileged
|
pod-security.kubernetes.io/enforce: privileged
|
||||||
|
# enforce=privileged silences PSA entirely; warn/audit at restricted keeps
|
||||||
|
# the violations visible on every pod creation (and in the audit log).
|
||||||
|
pod-security.kubernetes.io/warn: restricted
|
||||||
|
pod-security.kubernetes.io/warn-version: latest
|
||||||
|
pod-security.kubernetes.io/audit: restricted
|
||||||
|
pod-security.kubernetes.io/audit-version: latest
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue