Skip to content

feat: add non root support for k8s#3103

Open
sbylica-splunk wants to merge 6 commits into
developfrom
feat/2648-non-root-k8s
Open

feat: add non root support for k8s#3103
sbylica-splunk wants to merge 6 commits into
developfrom
feat/2648-non-root-k8s

Conversation

@sbylica-splunk

@sbylica-splunk sbylica-splunk commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Addresses RKE cluster deployment from this issue:
#2648

@sbylica-splunk sbylica-splunk marked this pull request as ready for review June 12, 2026 17:37
@sbylica-splunk sbylica-splunk requested a review from ajasnosz June 12, 2026 17:37
@sbylica-splunk sbylica-splunk requested a review from digrajpu June 12, 2026 17:37
@Kawron Kawron self-requested a review June 15, 2026 07:44
behavior); set .Values.podSecurityContext to run as non-root. See values.yaml
for the recommended non-root preset.
*/}}
{{- define "splunk-connect-for-syslog.podSecurityContext" -}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if defining this helper is necessary, as it only wraps .Values.podSecruityContext

serviceAccountName: {{ include "splunk-connect-for-syslog.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- include "splunk-connect-for-syslog.podSecurityContext" . | nindent 8 }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, as in https://github.com/splunk/splunk-connect-for-syslog/pull/3103/changes#r3411615226 what's the benefit of moving it the helper function. Why not add toYaml here?

# and standard runtimes).
#
# To run SC4S as the unprivileged "syslog" user (UID/GID 1024) baked into the
# image -- required for hardened environments such as RKE2/OpenShift or any

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would change -- to just -. I think that -- is sometimes used to represent em-dash but I think that in the code we can just use hyphen

# image -- required for hardened environments such as RKE2/OpenShift or any
# cluster that enforces the "restricted" Pod Security Standard -- uncomment the
# preset below. NET_BIND_SERVICE lets the default privileged ports (514/601) bind
# as non-root and is the only capability the "restricted" profile permits adding;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We mention NET_BIND_SERVICE here but we are adding it to secruityContext. I would move this comment down

podSecurityContext:
{}
# fsGroup: 2000
# runAsNonRoot: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious what will happen when I won't set runAsNonRoot but I will set runAsUser?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants