You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(k8s): set containerSecurityContext for mattermost #2937
The Mattermost application pod cannot start in namespace mattermost.
The replicaset controller reports this error: Error creating: pods "mattermost-578c98b7c7-lbts5" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "mattermost" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "mattermost" must set securityContext.capabilities.drop=["ALL"]).
Cause
The namespace mattermost enforces the restricted Pod Security standard.
The manifest k8s/mattermost/mattermost.yaml defines podTemplate.securityContext but omits podTemplate.containerSecurityContext.
The Mattermost Operator therefore generates a Deployment whose container lacks allowPrivilegeEscalation: false and capabilities.drop: ["ALL"].
Solution
Configure containerSecurityContext under spec.podTemplate in k8s/mattermost/mattermost.yaml:
Set allowPrivilegeEscalation: false
Set capabilities.drop: ["ALL"]
Add an invariant test in tests/invariants/test_k8s_argocd_apps.py to prevent regressions.
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
Type: type/bug. The fix prefix of the title gives the type.
Scope: scope/k8s. The (k8s) scope of the title gives the scope.
Priority: P2-Medium. The mattermost pod cannot start at all, blocking that service, but other services are unaffected.
Value: Medium. It unblocks the mattermost application in the mattermost namespace for users who depend on it.
Effort: Low. Adding two fields to one YAML file and one invariant test is a small change.
Related: fix(k8s): specify runAsUser for mattermost-operator #2932, which asks for a different change. Both fix a PodSecurity admission failure in the mattermost namespace, but 2932 sets runAsUser for the operator while this sets allowPrivilegeEscalation and capabilities for the app container.
Activity
dan-petty commentedon Oct 31, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(k8s)scope of the title gives the scope.The mattermost pod cannot start at all, blocking that service, but other services are unaffected.It unblocks the mattermost application in the mattermost namespace for users who depend on it.Adding two fields to one YAML file and one invariant test is a small change.Both fix a PodSecurity admission failure in the mattermost namespace, but 2932 sets runAsUser for the operator while this sets allowPrivilegeEscalation and capabilities for the app container.