Skip to content

Commit

Permalink
Adding statefulset support;
Browse files Browse the repository at this point in the history
  • Loading branch information
sarbis committed Dec 18, 2023
1 parent a041a1d commit e0b3d81
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 2 additions & 0 deletions charts/gks-template/templates/_deployment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Generate Deployment
*/ -}}
{{- define "gks.shared.deployment" -}}
{{- if eq .Values.type "Deployment" }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -102,4 +103,5 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
{{- end -}}
22 changes: 22 additions & 0 deletions charts/gks-template/templates/_service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,26 @@ spec:
{{- end }}
selector:
{{- include "gks.shared.selectorLabels" . | nindent 4 }}
{{- end }}
{{- if eq .Values.type "StatefulSet" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "gks.shared.fullname" . }}
labels:
{{- include "gks.shared.labels" . | nindent 4 }}
{{- if .Values.serviceAnnotations }}
annotations:
{{- toYaml .Values.serviceAnnotations | nindent 4 }}
{{- end }}
spec:
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
protocol: {{ .Values.service.protocol }}
name: http
clusterIP: None
selector:
{{- include "gks.shared.selectorLabels" . | nindent 4 }}
{{- end }}
{{- end }}
6 changes: 4 additions & 2 deletions charts/gks-template/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ autoscaling:
maxReplicas: 100
# -- Target CPU utilization percentage
targetCPUUtilizationPercentage: 80
# -- Type of kuberenetes deployment (Deployment, StatefulSet)
type: Deployment
# -- Image configuration. [Documentation](https://kubernetes.io/docs/concepts/containers/images/).
# @default -- `{}`
image:
# -- Image repository.
repository: harbor.teamgeta.net/cervera/giftshop-web/test
repository: ''
# -- Image pull policy.
pullPolicy: IfNotPresent
# -- Image tag.
Expand Down Expand Up @@ -63,7 +65,7 @@ podLabels: {}
# -- Pod lifecycle rules
# @default -- `{}`
podLifecycle: {}
# -- Deployment level annotations.
# -- Deployment (or StatefulSet) level annotations.
deploymentAnnotations: []
# -- Service level annotations.
serviceAnnotations: []
Expand Down

0 comments on commit e0b3d81

Please sign in to comment.