fix(hermes-webui): remove root initContainer and custom /etc mount to fix read-only fs + sudo error
- Removed initContainer running as root (violates PodSecurity restricted:latest) - Removed shared emptyDir /etc mount (no longer needed) - Rely on fsGroup:1000 + runAsUser:1000 for volume ownership and container UID - Added runAsNonRoot: true to podSecurityContext and both containers for policy compliance Pod will now start, webui runs as UID 1000 == WANTED_UID, init.bash skips chown/sudo.
This commit is contained in:
parent
a893406374
commit
22964a16a8
1 changed files with 6 additions and 20 deletions
|
|
@ -16,21 +16,8 @@ spec:
|
||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
initContainers:
|
runAsNonRoot: true
|
||||||
- name: create-webui-user
|
|
||||||
image: busybox
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
echo "hermeswebui:x:1000:1000::/home/hermeswebui:/bin/sh" >> /etc/passwd
|
|
||||||
echo "hermeswebui:x:1000:" >> /etc/group
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
runAsGroup: 0
|
|
||||||
volumeMounts:
|
|
||||||
- name: webui-etc
|
|
||||||
mountPath: /etc
|
|
||||||
containers:
|
containers:
|
||||||
- name: hermes-agent
|
- name: hermes-agent
|
||||||
securityContext:
|
securityContext:
|
||||||
|
|
@ -40,6 +27,7 @@ spec:
|
||||||
- ALL
|
- ALL
|
||||||
seccompProfile:
|
seccompProfile:
|
||||||
type: RuntimeDefault
|
type: RuntimeDefault
|
||||||
|
runAsNonRoot: true
|
||||||
image: nousresearch/hermes-agent:latest
|
image: nousresearch/hermes-agent:latest
|
||||||
command: ["/bin/bash", "-c"]
|
command: ["/bin/bash", "-c"]
|
||||||
args:
|
args:
|
||||||
|
|
@ -156,8 +144,7 @@ spec:
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: hermes-data
|
- name: hermes-data
|
||||||
mountPath: /home/hermeswebui/.hermes
|
mountPath: /home/hermeswebui/.hermes
|
||||||
- name: webui-etc
|
|
||||||
mountPath: /etc
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
memory: 256Mi
|
memory: 256Mi
|
||||||
|
|
@ -170,7 +157,7 @@ spec:
|
||||||
capabilities:
|
capabilities:
|
||||||
drop:
|
drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
runAsNonRoot: true
|
||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
seccompProfile:
|
seccompProfile:
|
||||||
|
|
@ -182,8 +169,7 @@ spec:
|
||||||
- name: hermes-data
|
- name: hermes-data
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: hermes-agent-pvc
|
claimName: hermes-agent-pvc
|
||||||
- name: webui-etc
|
|
||||||
emptyDir: {}
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue