diff --git a/pkg/k8sops/statefulset.go b/pkg/k8sops/statefulset.go index 6c872d42..815e10ba 100644 --- a/pkg/k8sops/statefulset.go +++ b/pkg/k8sops/statefulset.go @@ -93,6 +93,9 @@ func NewBaseStatefulSet(ssName, isolationGroup string, cluster *myspec.M3DBClust // Add SYS_RESOURCE security capability if not set (required to raise // rlimit nofile from the process in container) specSecurityCtx := cluster.Spec.SecurityContext + if specSecurityCtx == nil { + specSecurityCtx = &v1.SecurityContext{} + } if specSecurityCtx.Capabilities == nil { specSecurityCtx.Capabilities = &v1.Capabilities{} }