Skip to content

Commit

Permalink
refactor(application-template): security context 설정가능하도록 수정 (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
hschoi1104 authored Apr 25, 2024
1 parent d8941eb commit 6f6087a
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/application-template/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ maintainers:
- name: modusign
url: https://github.com/modusign
name: application-template
version: 1.5.2
version: 1.6.0
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.scheduler.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "scheduler.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.scheduler.name }}
{{- with (.Values.scheduler.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -131,6 +135,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.scheduler.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.scheduler.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/application-template/templates/scheduler/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.scheduler.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "scheduler.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.scheduler.name }}
{{- with (.Values.scheduler.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -135,6 +139,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.scheduler.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.scheduler.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/application-template/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "server.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.server.name }}
{{- with (.Values.server.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -131,6 +135,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.server.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.server.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/application-template/templates/server/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "server.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.server.name }}
{{- with (.Values.server.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -135,6 +139,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.server.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.server.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/application-template/templates/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.worker.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "worker.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.worker.name }}
{{- with (.Values.worker.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -131,6 +135,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.worker.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.worker.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
8 changes: 8 additions & 0 deletions charts/application-template/templates/worker/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ spec:
terminationGracePeriodSeconds: {{ .Values.worker.terminationGracePeriodSeconds }}
{{- end }}
serviceAccountName: {{ include "worker.serviceAccountName" . }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.worker.name }}
{{- with (.Values.worker.image.repository | default .Values.global.image.repository) }}
Expand Down Expand Up @@ -135,6 +139,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.worker.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.worker.initContainers }}
initContainers:
{{- range $index, $container := . }}
Expand Down
12 changes: 12 additions & 0 deletions charts/application-template/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ global:
# -- Image pull Secrets for the Service Account
imagePullSecrets: []

# -- Security context for all containers
securityContext: {}

# -- Environment variables to pass to all deployed Deployments
env: {}

Expand Down Expand Up @@ -212,6 +215,9 @@ server:
# -- Specify postStart and preStop lifecycle hooks for your container
lifecycle: {}

# -- Security context for container
containerSecurityContext: {}

# -- Annotations to be added to server Deployment
deploymentAnnotations: {}

Expand Down Expand Up @@ -469,6 +475,9 @@ worker:
# -- Specify postStart and preStop lifecycle hooks for your container
lifecycle: {}

# -- Security context for container
containerSecurityContext: {}

# -- Annotations to be added to worker Deployment
deploymentAnnotations: {}

Expand Down Expand Up @@ -730,6 +739,9 @@ scheduler:
# -- Specify postStart and preStop lifecycle hooks for your container
lifecycle: {}

# -- Security context for container
containerSecurityContext: {}

# -- Annotations to be added to scheduler Deployment
deploymentAnnotations: {}

Expand Down

0 comments on commit 6f6087a

Please sign in to comment.