Skip to content

Commit

Permalink
fix(ee): improve helm security (#560)
Browse files Browse the repository at this point in the history
* fix(ee): improve helm security

* fix imagePullSecrets

* adjust resource limits

* bump chart patch version

* fix worker liveliness and readiness port
  • Loading branch information
Gabriel-Ladzaretti authored Aug 18, 2024
1 parent db262e4 commit eb32b66
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 69 deletions.
2 changes: 1 addition & 1 deletion helm-charts/mend-renovate-ee/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: mend-renovate-enterprise-edition
version: 2.0.0
version: 2.0.1
appVersion: 8.0.0
description: Mend Renovate Enterprise Edition
home: https://github.com/mend/renovate-ce-ee
Expand Down
3 changes: 3 additions & 0 deletions helm-charts/mend-renovate-ee/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data:
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "mend-renovate.license-secret-name" . }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
Expand All @@ -37,6 +38,7 @@ data:
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "mend-renovate.server-secret-name" . }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
Expand Down Expand Up @@ -76,6 +78,7 @@ data:
apiVersion: v1
kind: Secret
metadata:
namespace: {{ .Release.Namespace }}
name: {{ include "mend-renovate.worker-secret-name" . }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
Expand Down
7 changes: 4 additions & 3 deletions helm-charts/mend-renovate-ee/templates/server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: false
{{- with .Values.renovateServer.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -88,7 +89,7 @@ spec:
{{- end }}
{{- if or .Values.renovateServer.mendRnvGithubBotUserId }}
- name: MEND_RNV_GITHUB_BOT_USER_ID
value: {{ .Values.renovateServer.mendRnvGithubBotUserId | quote }}
value: {{ .Values.renovateServer.mendRnvGithubBotUserId | quote }}
{{- end }}
{{- if or .Values.renovateServer.mendRnvGithubAppKey .Values.renovateServer.existingSecret }}
- name: MEND_RNV_GITHUB_APP_KEY
Expand Down Expand Up @@ -274,7 +275,7 @@ spec:
{{- end }}
{{- if .Values.renovateServer.imagePullSecrets }}
imagePullSecrets:
- name: .Values.renovateServer.imagePullSecrets
- name: {{ .Values.renovateServer.imagePullSecrets }}
{{- end }}
volumes:
- name: {{ .Release.Name }}-database-volume
Expand All @@ -285,7 +286,7 @@ spec:
emptyDir:
medium: Memory
{{- else }}
emptyDir: {}
emptyDir: { }
{{- end }}
{{- if ne (len .Values.renovateServer.extraVolumes) 0 }}
{{ toYaml .Values.renovateServer.extraVolumes | nindent 8 | trim }}
Expand Down
22 changes: 19 additions & 3 deletions helm-charts/mend-renovate-ee/templates/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
automountServiceAccountToken: false
{{- with .Values.renovateWorker.podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -43,7 +44,7 @@ spec:
- name: {{ .Chart.Name }}-worker
image: "{{ .Values.renovateWorker.image.repository }}:{{ .Values.renovateWorker.image.tag }}"
imagePullPolicy: {{ .Values.renovateWorker.image.pullPolicy }}
{{- with .Values.renovateServer.containerSecurityContext }}
{{- with .Values.renovateWorker.containerSecurityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
env:
Expand Down Expand Up @@ -124,18 +125,33 @@ spec:
- name: LOG_FORMAT
value: {{ .Values.renovateWorker.logFormat | quote }}
{{- end }}
ports:
- name: ee-worker
containerPort: 8080
protocol: TCP
{{- with .Values.renovateWorker.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.renovateWorker.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.renovateWorker.resources | nindent 12 }}
volumeMounts:
- name: {{ .Release.Name }}-config-js-volume
readOnly: true
mountPath: /usr/src/app/config.js
subPath: config.js
{{- if .Values.renovateWorker.npmrc }}
- name: {{ .Release.Name }}-npmrc-volume
readOnly: true
mountPath: /home/ubuntu/.npmrc
subPath: .npmrc
{{- end }}
- name: {{ .Release.Name }}-cache-volume
readOnly: false
mountPath: /tmp/renovate
{{- if ne (len .Values.renovateWorker.extraVolumeMounts) 0 }}
{{ toYaml .Values.renovateWorker.extraVolumeMounts | nindent 12 | trim }}
Expand All @@ -146,7 +162,7 @@ spec:
{{- end }}
{{- if .Values.renovateWorker.imagePullSecrets }}
imagePullSecrets:
- name: .Values.renovateWorker.imagePullSecrets
- name: {{ .Values.renovateWorker.imagePullSecrets }}
{{- end }}
volumes:
- name: {{ .Release.Name }}-config-js-volume
Expand All @@ -165,7 +181,7 @@ spec:
emptyDir:
medium: Memory
{{- else }}
emptyDir: {}
emptyDir: { }
{{- end }}
{{- if ne (len .Values.renovateWorker.extraVolumes) 0 }}
{{ toYaml .Values.renovateWorker.extraVolumes | nindent 8 | trim }}
Expand Down
Loading

0 comments on commit eb32b66

Please sign in to comment.