Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

205 deploy approval app #206

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Add more allowed method to CORS
- Add IN-CORE Studio deployment
- Add IN-CORE Studio configMap
- Add IN-CORE user approval application

## 1.32.1 - 2024-11-04
- Add extra variables for datawolf
Expand Down
1 change: 1 addition & 0 deletions Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ annotations:
- Add more allowed method to cors
- Add IN-CORE Studio deployment
- Add IN-CORE Studio ConfigMap for dependency graph.
- Add IN-CORE user approval application
78 changes: 78 additions & 0 deletions templates/approval/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "incore.fullname" . }}-approval
labels:
{{- include "incore.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.approval.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "incore.name" . }}-approval
app.kubernetes.io/instance: {{ .Release.Name }}
strategy:
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "incore.name" . }}-approval
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.approval.image.pullSecrets | default .Values.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: approval
image: "{{ .Values.image.project }}/{{ .Values.approval.image.repository }}:{{ .Values.approval.image.tag }}"
imagePullPolicy: {{ .Values.approval.image.pullPolicy | default .Values.image.pullPolicy }}
env:
- name: ADMIN_LIST
value: {{ .Values.approval.ADMIN_LIST | quote }}
- name: KEYCLOAK_USERNAME
value: {{ .Values.approval.KEYCLOAK_USERNAME | quote }}
- name: KEYCLOAK_PASSWORD
{{- if .Values.approval.KEYCLOAK_PASSWORD }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let not put the direct insert of KEYCLOAK password in here, instead just make it only to use the secret like you put below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but I would need to overwrite it with production keycloak password on dev, hence I have this additional logic.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev and prod uses different secret so you can set it in there, instead of directly put

value: {{ .Values.approval.KEYCLOAK_PASSWORD | quote }}
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "incore.fullname" . }}-services
key: KEYCLOAK_PASSWORD
{{- end }}
- name: KEYCLOAK_URL
value: {{ .Values.approval.KEYCLOAK_URL | default .Values.keycloak.auth.url | default (printf
"https://%s/auth/" (first .Values.keycloak.ingress.rules).host) | quote }}
- name: APPROVE_APP_URL
value: {{ .Values.approval.APPROVE_APP_URL | default .Values.keycloak.auth.approveAppUrl | default (printf "https://%s/approval/approve" (first .Values.keycloak.ingress.rules).host) | quote }}
- name: EMAIL_FROM
value: {{ .Values.approval.EMAIL_FROM | quote }}
- name: SMTP_SERVER
value: {{ .Values.approval.SMTP_SERVER | quote }}
- name: SMTP_PORT
value: {{ .Values.approval.SMTP_PORT | quote }}
ports:
- containerPort: {{ .Values.approval.service.port }}
name: approval
livenessProbe:
httpGet:
path: /approval/healthz
port: approval
readinessProbe:
httpGet:
path: /approval/healthz
port: approval
resources:
{{- toYaml .Values.approval.resources | nindent 12 }}
{{- with .Values.approval.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.approval.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.approval.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
36 changes: 36 additions & 0 deletions templates/approval/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "incore.fullname" . -}}
{{- $svcPort := .Values.approval.service.port -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-approval
labels:
{{- include "incore.labels" . | nindent 4 }}
annotations:
{{- include "incore.authIngressAnnotation" . | nindent 4 }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
- path: /approval/
pathType: ImplementationSpecific
backend:
service:
name: {{ $fullName }}-approval
port:
number: {{ $svcPort }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions templates/approval/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "incore.fullname" . }}-approval
labels:
{{- include "incore.labels" . | nindent 4 }}
spec:
selector:
app.kubernetes.io/name: {{ include "incore.name" . }}-approval
app.kubernetes.io/instance: {{ .Release.Name }}
type: {{ .Values.approval.service.type }}
ports:
- port: {{ .Values.approval.service.port }}
name: approval
targetPort: {{ .Values.approval.service.port }}
protocol: TCP
20 changes: 20 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,26 @@ keycloak:
extraVolumeMounts: |
- name: incore-theme
mountPath: /opt/bitnami/keycloak/themes/incore-theme


# ----------------------------------------------------------------------
# APPROVAL APP CONFIGURATION
# ----------------------------------------------------------------------
approval:
replicas: 1
image:
repository: approval-app
tag: master
service:
type: ClusterIP
port: 5000
ingress:
annotations:
ADMIN_LIST: [email protected],[email protected]
KEYCLOAK_USERNAME: keycloak
EMAIL_FROM: [email protected]
SMTP_SERVER: smtp.server.name
SMTP_PORT: 25

# ----------------------------------------------------------------------
# CRONJOBS
Expand Down
Loading