Skip to content

Commit 09fda04

Browse files
committed
[MOSIP-43017] Added prereg-booking helm chart
Signed-off-by: Prafulrakhade <prafulrakhade02@gmail.com>
1 parent e238ef9 commit 09fda04

13 files changed

Lines changed: 783 additions & 0 deletions

helm/prereg-booking/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
charts/
2+
Charts.lock

helm/prereg-booking/.helmignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*~
18+
# Various IDEs
19+
.project
20+
.idea/
21+
*.tmproj

helm/prereg-booking/Chart.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v2
2+
name: prereg-booking
3+
description: A Helm chart for MOSIP Pre-registration application service
4+
type: application
5+
version: 0.0.1-develop
6+
appVersion: ""
7+
dependencies:
8+
- name: common
9+
repository: https://charts.bitnami.com/bitnami
10+
tags:
11+
- bitnami-common
12+
version: 1.x.x
13+
home: https://mosip.io
14+
keywords:
15+
- mosip
16+
- prereg-booking
17+
- kernel
18+
maintainers:
19+
- email: info@mosip.io
20+
name: MOSIP

helm/prereg-booking/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# PreReg Booking
2+
3+
Helm chart for installing Pre-Registration Booking service.
4+
5+
## Install
6+
```console
7+
$ kubectl create namespace prereg
8+
$ helm repo add mosip https://mosip.github.io
9+
$ helm -n prereg install my-release mosip/prereg-booking
10+
```
11+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{{/*
2+
Return the proper image name
3+
*/}}
4+
{{- define "prereg-booking.image" -}}
5+
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
6+
{{- end -}}
7+
8+
{{/*
9+
Return the proper image name (for the init container volume-permissions image)
10+
*/}}
11+
{{- define "prereg-booking.volumePermissions.image" -}}
12+
{{- include "common.images.image" ( dict "imageRoot" .Values.volumePermissions.image "global" .Values.global ) -}}
13+
{{- end -}}
14+
15+
{{/*
16+
Return the proper Docker Image Registry Secret Names
17+
*/}}
18+
{{- define "prereg-booking.imagePullSecrets" -}}
19+
{{- include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.volumePermissions.image) "global" .Values.global) -}}
20+
{{- end -}}
21+
22+
{{/*
23+
Create the name of the service account to use
24+
*/}}
25+
{{- define "prereg-booking.serviceAccountName" -}}
26+
{{- if .Values.serviceAccount.create -}}
27+
{{ default (printf "%s" (include "common.names.fullname" .)) .Values.serviceAccount.name }}
28+
{{- else -}}
29+
{{ default "default" .Values.serviceAccount.name }}
30+
{{- end -}}
31+
{{- end -}}
32+
33+
{{/*
34+
Compile all warnings into a single message.
35+
*/}}
36+
{{- define "prereg-booking.validateValues" -}}
37+
{{- $messages := list -}}
38+
{{- $messages := append $messages (include "prereg-booking.validateValues.foo" .) -}}
39+
{{- $messages := append $messages (include "prereg-booking.validateValues.bar" .) -}}
40+
{{- $messages := without $messages "" -}}
41+
{{- $message := join "\n" $messages -}}
42+
43+
{{- if $message -}}
44+
{{- printf "\nVALUES VALIDATION:\n%s" $message -}}
45+
{{- end -}}
46+
{{- end -}}
47+
48+
{{/*
49+
Return podAnnotations
50+
*/}}
51+
{{- define "prereg-booking.podAnnotations" -}}
52+
{{- if .Values.podAnnotations }}
53+
{{ include "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) }}
54+
{{- end }}
55+
{{- if and .Values.metrics.enabled .Values.metrics.podAnnotations }}
56+
{{ include "common.tplvalues.render" (dict "value" .Values.metrics.podAnnotations "context" $) }}
57+
{{- end }}
58+
{{- end -}}
59+
60+
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
2+
kind: Deployment
3+
metadata:
4+
labels: {{- include "common.labels.standard" . | nindent 4 }}
5+
{{- if .Values.commonLabels }}
6+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
7+
{{- end }}
8+
name: {{ template "common.names.fullname" . }}
9+
annotations:
10+
{{- if .Values.commonAnnotations }}
11+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
12+
{{- end }}
13+
spec:
14+
replicas: {{ .Values.replicaCount }}
15+
{{- if .Values.updateStrategy }}
16+
strategy: {{- toYaml .Values.updateStrategy | nindent 4 }}
17+
{{- end }}
18+
selector:
19+
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
20+
template:
21+
metadata:
22+
annotations:
23+
{{- if or .Values.podAnnotations .Values.metrics.enabled }}
24+
{{- include "prereg-booking.podAnnotations" . | nindent 8 }}
25+
{{- end }}
26+
27+
labels: {{- include "common.labels.standard" . | nindent 8 }}
28+
{{- if .Values.podLabels }}
29+
{{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
30+
{{- end }}
31+
spec:
32+
serviceAccountName: {{ template "prereg-booking.serviceAccountName" . }}
33+
{{- include "prereg-booking.imagePullSecrets" . | nindent 6 }}
34+
{{- if .Values.hostAliases }}
35+
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }}
36+
{{- end }}
37+
{{- if .Values.affinity }}
38+
affinity: {{- include "common.tplvalues.render" ( dict "value" .Values.affinity "context" $) | nindent 8 }}
39+
{{- else }}
40+
affinity:
41+
podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "context" $) | nindent 10 }}
42+
podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "context" $) | nindent 10 }}
43+
nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }}
44+
{{- end }}
45+
{{- if .Values.nodeSelector }}
46+
nodeSelector: {{- include "common.tplvalues.render" ( dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
47+
{{- end }}
48+
{{- if .Values.tolerations }}
49+
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" .) | nindent 8 }}
50+
{{- end }}
51+
{{- if .Values.priorityClassName }}
52+
priorityClassName: {{ .Values.priorityClassName | quote }}
53+
{{- end }}
54+
{{- if .Values.podSecurityContext.enabled }}
55+
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
56+
{{- end }}
57+
initContainers:
58+
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
59+
- name: volume-permissions
60+
image: {{ include "prereg-booking.volumePermissions.image" . }}
61+
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
62+
command:
63+
- %%commands%%
64+
securityContext:
65+
runAsUser: 0
66+
{{- if .Values.volumePermissions.resources }}
67+
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
68+
{{- end }}
69+
volumeMounts:
70+
- name: foo
71+
mountPath: bar
72+
{{- end }}
73+
{{- if .Values.initContainers }}
74+
{{- include "common.tplvalues.render" (dict "value" .Values.initContainers "context" $) | nindent 8 }}
75+
{{- end }}
76+
containers:
77+
- name: prereg-booking
78+
image: {{ template "prereg-booking.image" . }}
79+
imagePullPolicy: {{ .Values.image.pullPolicy }}
80+
{{- if .Values.lifecycleHooks }}
81+
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 12 }}
82+
{{- end }}
83+
{{- if .Values.containerSecurityContext.enabled }}
84+
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
85+
{{- end }}
86+
{{- if .Values.command }}
87+
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }}
88+
{{- end }}
89+
{{- if .Values.args }}
90+
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }}
91+
{{- end }}
92+
env:
93+
- name: container_user
94+
value: {{ .Values.containerSecurityContext.runAsUser }}
95+
- name: JDK_JAVA_OPTIONS
96+
value: {{ .Values.additionalResources.javaOpts }}
97+
{{- if .Values.extraEnvVars }}
98+
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
99+
{{- end }}
100+
envFrom:
101+
{{- if .Values.extraEnvVarsCM }}
102+
{{- range .Values.extraEnvVarsCM }}
103+
- configMapRef:
104+
name: {{ . }}
105+
{{- end }}
106+
{{- end }}
107+
{{- if .Values.extraEnvVarsSecret }}
108+
{{- range .Values.extraEnvVarsSecret }}
109+
- secretRef:
110+
name: {{ . }}
111+
{{- end }}
112+
{{- end }}
113+
ports:
114+
- name: spring-service
115+
containerPort: {{ .Values.springServicePort }}
116+
117+
{{- if .Values.resources }}
118+
resources: {{- toYaml .Values.resources | nindent 12 }}
119+
{{- end }}
120+
{{- if .Values.startupProbe.enabled }}
121+
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.startupProbe "enabled") "context" $) | nindent 12 }}
122+
{{- else if .Values.customStartupProbe }}
123+
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 12 }}
124+
{{- end }}
125+
{{- if .Values.livenessProbe.enabled }}
126+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.livenessProbe "enabled") "context" $) | nindent 12 }}
127+
{{- else if .Values.customLivenessProbe }}
128+
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 12 }}
129+
{{- end }}
130+
{{- if .Values.readinessProbe.enabled }}
131+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.readinessProbe "enabled") "context" $) | nindent 12 }}
132+
{{- else if .Values.customReadinessProbe }}
133+
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }}
134+
{{- end }}
135+
{{- if .Values.sidecars }}
136+
{{- include "common.tplvalues.render" ( dict "value" .Values.sidecars "context" $) | nindent 8 }}
137+
{{- end }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{{- range .Values.extraDeploy }}
2+
---
3+
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
4+
{{- end }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels: {{- include "common.labels.standard" . | nindent 4 }}
5+
{{- if .Values.commonLabels }}
6+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
7+
{{- end }}
8+
name: {{ template "prereg-booking.serviceAccountName" . }}
9+
{{- if .Values.commonAnnotations }}
10+
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
11+
{{- end }}
12+
namespace: {{ .Release.Namespace }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels: {{- include "common.labels.standard" . | nindent 4 }}
5+
{{- if .Values.commonLabels }}
6+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
7+
{{- end }}
8+
name: {{ template "common.names.fullname" . }}
9+
annotations:
10+
{{- if .Values.commonAnnotations }}
11+
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
12+
{{- end }}
13+
spec:
14+
type: {{ .Values.service.type }}
15+
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
16+
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
17+
{{- end }}
18+
{{ if eq .Values.service.type "LoadBalancer" }}
19+
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
20+
{{ end }}
21+
{{- if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
22+
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
23+
{{- end }}
24+
ports:
25+
- port: {{ .Values.service.port }}
26+
protocol: TCP
27+
targetPort: {{ .Values.springServicePort }}
28+
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)