Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions charts/octopus-deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,7 @@ A minimal set of writable paths for a read-only root filesystem is:
```yaml
octopus:
containerSecurityContext:
runAsNonRoot: true
runAsGroup: 999
runAsUser: 999
readOnlyRootFilesystem: true
podSecurityContext:
fsGroup: 999
fsGroupChangePolicy: OnRootMismatch

serverConfigurationDirectory: /home/octopus/.local

Expand Down Expand Up @@ -187,6 +181,35 @@ A complete working example including environment variable overrides for .NET too

Note: `enableDockerInDocker` must be set to `false` when using a read-only root filesystem, as Docker-in-Docker requires a privileged, writable container.

### Openshift
If you are using build in mssql chart on Openshift with values:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
If you are using build in mssql chart on Openshift with values:
If you are using built-in mssql chart on Openshift with values:

```
mssql:
enabled: true
```

Our mssql has such default security contexts for mssql.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Our mssql has such default security contexts for mssql.
Our mssql has these default security context values:


```
podSecurityContext:
fsGroup: 10001
seccompProfile:
type: RuntimeDefault
containerSecurityContext:
runAsUser: 10001
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
```

As we're usign hardcoded UID and fsGroup in our `securityContext` you need to assign `nonroot-v2` SCC to allow the SQL Server SA to run:

```oc adm policy add-scc-to-user nonroot-v2 -z octopus-deploy-mssql -n octopus-deploy```


### Ingress
You'll likely want to allow external traffic to your Octopus instance, and this generally means configuring [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/).

Expand Down
8 changes: 8 additions & 0 deletions charts/octopus-deploy/charts/mssql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,11 @@ this template will return sa_password - either from values or autogenerated
{{- include "random_secret" (list . "sapassword") -}}
{{- end -}}
{{- end -}}

{{- define "mssql.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{- default (printf "%s-mssql" (include "octopus.fullname" .)) .Values.serviceAccount.name -}}
{{- else -}}
default "default-mssql" .Values.serviceAccount.name
Copy link
Copy Markdown

@ATGardner ATGardner May 5, 2026

Choose a reason for hiding this comment

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

i am not a helm expert, but shouldn't that be inside some {{ }} ?

{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "labels" . | nindent 4 }}
{{- if .Values.serviceAccount.labels }}
{{- toYaml .Values.serviceAccount.labels | nindent 4 }}
{{- end }}
name: {{ template "mssql.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
labels:
{{- include "mssql.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ template "mssql.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.nodeSelector }}
Expand All @@ -41,6 +42,10 @@ spec:
- cp /var/opt/config/mssql.conf /var/opt/mssql/mssql.conf && /opt/mssql/bin/sqlservr
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.containers.ports.containerPort}}
env:
Expand Down
19 changes: 18 additions & 1 deletion charts/octopus-deploy/charts/mssql/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,24 @@ containers:
podAnnotations: {}

podSecurityContext:
runAsNonRoot: true
fsGroup: 10001
seccompProfile:
type: RuntimeDefault
containerSecurityContext:
runAsUser: 10001
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why is that needed if the port is 1433 (i think this is only needed when running on ports below 1024)


service:
port: 1433
port: 1433

serviceAccount:
create: true
automountServiceAccountToken: false
annotations: {}
labels: {}
10 changes: 0 additions & 10 deletions charts/octopus-deploy/values-rorfsexample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,6 @@ octopus:
mountPath: /Octopus/.diagnostics
sizeLimit: "100Mi"

podSecurityContext:
fsGroup: 999
fsGroupChangePolicy: OnRootMismatch

containerSecurityContext:
runAsNonRoot: true
runAsGroup: 999
runAsUser: 999
readOnlyRootFilesystem: true

serverConfigurationDirectory: /home/octopus/.local

mssql:
Expand Down
11 changes: 9 additions & 2 deletions charts/octopus-deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,18 @@ octopus:
- watch
- list
# Pod security context settings
podSecurityContext: {}
podSecurityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
# Container security context settings
# IMPORTANT: When enableDockerInDocker is true (default), the container must run as privileged.
# If setting security contexts that conflict with privileged mode, set enableDockerInDocker to false.
containerSecurityContext: {}
containerSecurityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
# Custom directory for Octopus server configuration when using non-root security contexts
serverConfigurationDirectory:

Expand Down
Loading