diff --git a/charts/dependency-track/templates/api-server/deployment.yaml b/charts/dependency-track/templates/api-server/deployment.yaml index f815ae8..bbe7077 100644 --- a/charts/dependency-track/templates/api-server/deployment.yaml +++ b/charts/dependency-track/templates/api-server/deployment.yaml @@ -28,6 +28,9 @@ spec: {{- toYaml .Values.apiServer.initContainers | nindent 6 }} {{- end }} serviceAccount: {{ include "dependencytrack.serviceAccountName" . }} + {{- with .Values.apiServer.podSecurityContext }} + securityContext: {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "dependencytrack.apiServerName" . }} image: {{ include "dependencytrack.apiServerImage" . }} diff --git a/charts/dependency-track/templates/api-server/statefulset.yaml b/charts/dependency-track/templates/api-server/statefulset.yaml index ed5c701..c9e9083 100644 --- a/charts/dependency-track/templates/api-server/statefulset.yaml +++ b/charts/dependency-track/templates/api-server/statefulset.yaml @@ -29,6 +29,9 @@ spec: {{- toYaml .Values.apiServer.initContainers | nindent 6 }} {{- end }} serviceAccount: {{ include "dependencytrack.serviceAccountName" . }} + {{- with .Values.apiServer.podSecurityContext }} + securityContext: {{- toYaml . | nindent 8 }} + {{- end }} containers: - name: {{ include "dependencytrack.apiServerName" . }} image: {{ include "dependencytrack.apiServerImage" . }} @@ -138,4 +141,4 @@ spec: accessModes: - ReadWriteOnce {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/dependency-track/values.schema.json b/charts/dependency-track/values.schema.json index 0c610e4..f78a06a 100644 --- a/charts/dependency-track/values.schema.json +++ b/charts/dependency-track/values.schema.json @@ -132,6 +132,9 @@ }, "nodeSelector": { "type": "object" + }, + "podSecurityContext": { + "type": "object" } } }, @@ -341,4 +344,4 @@ } } } -} \ No newline at end of file +} diff --git a/charts/dependency-track/values.yaml b/charts/dependency-track/values.yaml index 7d6a249..1cf4597 100644 --- a/charts/dependency-track/values.yaml +++ b/charts/dependency-track/values.yaml @@ -84,26 +84,9 @@ apiServer: scrapeTimeout: 30s initContainers: [] nodeSelector: {} - # Use the following to fix permissions on the /data volume. - # initContainers: - # - name: fix-permissions - # image: docker.io/library/busybox - # command: - # - sh - # - -c - # - | - # chown -R 1000:1000 /data - # volumeMounts: - # - name: data - # mountPath: /data - # securityContext: - # capabilities: - # add: - # - CHOWN - # runAsNonRoot: false - # runAsUser: 0 - # seccompProfile: - # type: RuntimeDefault + # deactivate this for openshift + podSecurityContext: + fsGroup: 1000 frontend: replicaCount: 1