Feat/added security context (#38)

* feat: added support of security context in polymorphic-app #37
The support for security context is added services, job, cronjob, and worker files.

* fix: changed chart version #37

* fix: optimized flow control for securityContext #37
Added defaults for securityContext.
Used `with` statement instead of `if` statement.
SecurityContext value is picked up from objects and their templates.
main
HUSSAIN GANDHI 2023-06-15 15:46:27 +05:30 committed by GitHub
parent fff1ffe3b1
commit b562543674
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 4 deletions

View File

@ -4,5 +4,5 @@ description: A Helm chart for deploying any custom applications, specifically po
maintainers: maintainers:
- name: improwised - name: improwised
type: application type: application
version: 1.2.0 version: 1.2.1
appVersion: 1.0.0 appVersion: 1.0.0

View File

@ -81,6 +81,10 @@ spec:
{{- end }} {{- end }}
{{- if $.Values.cronJobTemplate.volumeMounts }} {{- if $.Values.cronJobTemplate.volumeMounts }}
{{ toYaml $.Values.cronJobTemplate.volumeMounts | indent 12 }} {{ toYaml $.Values.cronJobTemplate.volumeMounts | indent 12 }}
{{- end }}
{{- with .securityContext | default $.Values.cronJobTemplate.securityContext }}
securityContext:
{{ toYaml . | indent 12 }}
{{- end }} {{- end }}
{{- with .affinity | default $.Values.cronJobTemplate.affinity }} {{- with .affinity | default $.Values.cronJobTemplate.affinity }}
affinity: affinity:

View File

@ -82,6 +82,10 @@ spec:
{{- if $.Values.jobTemplate.volumeMounts }} {{- if $.Values.jobTemplate.volumeMounts }}
{{ toYaml $.Values.jobTemplate.volumeMounts | indent 10 }} {{ toYaml $.Values.jobTemplate.volumeMounts | indent 10 }}
{{- end }} {{- end }}
{{- with .securityContext | default $.Values.jobTemplate.securityContext }}
securityContext:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .affinity | default $.Values.jobTemplate.affinity }} {{- with .affinity | default $.Values.jobTemplate.affinity }}
affinity: affinity:
{{ toYaml . | indent 8 }} {{ toYaml . | indent 8 }}

View File

@ -152,6 +152,10 @@ spec:
periodSeconds: {{ .healthcheck.periodSeconds | default $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }} periodSeconds: {{ .healthcheck.periodSeconds | default $.Values.serviceTemplate.healthcheck.periodSeconds | default "20" }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .securityContext | default $.Values.serviceTemplate.securityContext }}
securityContext:
{{ toYaml . | indent 8 }}
{{- end }}
volumes: volumes:
{{- if .volumes }} {{- if .volumes }}
{{ toYaml .volumes | indent 8 }} {{ toYaml .volumes | indent 8 }}

View File

@ -139,6 +139,10 @@ spec:
{{- end }} {{- end }}
successThreshold: 1 successThreshold: 1
{{- end }} {{- end }}
{{- with .securityContext | default $.Values.workerTemplate.securityContext }}
securityContext:
{{ toYaml . | indent 8 }}
{{- end }}
volumes: volumes:
{{- if .volumes }} {{- if .volumes }}
{{ toYaml .volumes | indent 8 }} {{ toYaml .volumes | indent 8 }}

View File

@ -61,7 +61,10 @@ serviceTemplate:
# requests: # requests:
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
securityContext: {}
# fsGroup: 1001
# runAsGroup: 1001
# runAsUser: 1001
annotations: {} annotations: {}
nodeSelector: {} nodeSelector: {}
tolerations: [] tolerations: []
@ -120,7 +123,10 @@ workerTemplate:
# requests: # requests:
# cpu: 100m # cpu: 100m
# memory: 128Mi # memory: 128Mi
securityContext: {}
# fsGroup: 1001
# runAsGroup: 1001
# runAsUser: 1001
nodeSelector: {} nodeSelector: {}
tolerations: [] tolerations: []
@ -200,6 +206,10 @@ cronJobTemplate:
volumeMounts: [] volumeMounts: []
annotations: {} annotations: {}
volumes: [] volumes: []
securityContext: {}
# fsGroup: 1001
# runAsGroup: 1001
# runAsUser: 1001
cronJobs: cronJobs:
# - name: update-status # - name: update-status
@ -242,7 +252,10 @@ jobTemplate:
command: command:
annotations: [] annotations: []
volumeMounts: [] volumeMounts: []
securityContext: {}
# fsGroup: 1001
# runAsGroup: 1001
# runAsUser: 1001
volumes: [] volumes: []
jobs: jobs: