Skip to content

Commit

Permalink
Add statefulset configuration (#36)
Browse files Browse the repository at this point in the history
Signed-off-by: sgcg10 <[email protected]>
  • Loading branch information
sgcg10 authored Jun 26, 2023
1 parent a52ed38 commit 20ed2de
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/monochart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
description: A declarative helm chart for deploying common types of services on Kubernetes
name: monochart
version: 1.0.1
appVersion: 1.0.1
version: 1.0.2
appVersion: 1.0.2
home: https://github.com/Lowess/charts/tree/master/charts/monochart
icon: https://raw.githubusercontent.com/cloudposse/charts/master/incubator/monochart/logo.png
maintainers:
Expand Down
20 changes: 20 additions & 0 deletions charts/monochart/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ spec:
serviceAccountName: {{ .Values.serviceAccountName }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.statefulset.terminationGracePeriodSeconds }}
{{- with .Values.statefulset.dnsConfig }}
dnsConfig:
{{ toYaml . | indent 10 }}
{{- end }}
{{- if .Values.statefulset.affinity }}
affinity:
{{- if or .Values.statefulset.affinity.podAntiAffinity (eq .Values.statefulset.affinity.affinityRule "ShouldBeOnDifferentNode") }}
Expand All @@ -74,6 +78,22 @@ spec:
{{- end }}
{{- end }}
{{- end }}


{{- if .Values.statefulset.affinity.nodeAffinity }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
{{- if .Values.statefulset.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms }}
{{- with .Values.statefulset.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms }}
{{ toYaml . | indent 16 }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.statefulset.tolerations }}
tolerations:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{ .Release.Name }}
image: {{ required "image.repository is required!" .Values.image.repository }}:{{ required "image.tag is required!" .Values.image.tag }}
Expand Down
14 changes: 13 additions & 1 deletion charts/monochart/values.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,19 @@ statefulset:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000

dnsConfig:
options:
- name: ndots
value: "1"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: Name
operator: In
values:
- va-verity-eks--stage-vng-public

service:
default:
Expand Down

0 comments on commit 20ed2de

Please sign in to comment.