cockroachdb / cockroachdb/cockroach-operator

securityContext for namespaces with pod security restricted

Open
#1,034 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
318
Forks
104
Avg merge
1d 6h
Merged PRs (30d)
1

Description

Hello,

In a namespace with label `pod-security.kubernetes.io/enforce: restricted`, the cockroachdb cluster created by the operator does not start :

```
create Pod crdb-0 in StatefulSet crdb failed error: pods "crdb-0" is forbidden: violates PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "db" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (containers "db-init", "db" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or containers "db-init", "k8tz", "db" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "db-init" must not set runAsUser=0), seccompProfile (pod or containers "db-init", "db" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
```

Is there a way to update pods and containers securityContext to match requirements ? It seams that in the crdb helm chart theses values are properly populated

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing how the operator creates the CRDB StatefulSet and compare the generated pod and container securityContext with the PodSecurity restricted requirements listed in the error. Use the Helm chart's populated values as a reference; done means the generated cluster pods satisfy those requirements and start in a restricted namespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
devops, infrastructure, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.