[SIS-xxx] adding rendering of current Debra donation information

updating for Debra 2023 campaign
adding internal rest api for debra information
adding a debra button to receive information
This commit is contained in:
Sheldan
2023-11-09 01:01:49 +01:00
parent 7449c05462
commit c6f20d617d
73 changed files with 1078 additions and 37 deletions

View File

@@ -0,0 +1,70 @@
{{- if .Values.restApi.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "sissi.fullname" . }}-rest-api
spec:
replicas: 1
selector:
matchLabels:
app: rest-api
template:
metadata:
{{- with .Values.restApi.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: rest-api
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "sissi.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.restApi.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.restApi.securityContext | nindent 12 }}
image: "{{ .Values.restApi.repository }}/{{ .Values.restApi.image }}:{{ .Values.restApi.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.restApi.pullPolicy }}
env:
- name: SISSI_HOST
value: "{{ include "sissi.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
- name: SISSI_PORT
value: "{{ .Values.service.port }}"
ports:
- name: {{ .Values.restApi.service.name }}
containerPort: {{ .Values.restApi.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: {{ .Values.restApi.service.port }}
initialDelaySeconds: {{ $.Values.restApi.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ $.Values.restApi.livenessProbe.periodSeconds }}
failureThreshold: {{ $.Values.restApi.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.restApi.service.port }}
initialDelaySeconds: {{ $.Values.restApi.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ $.Values.restApi.readinessProbe.periodSeconds }}
failureThreshold: {{ $.Values.restApi.readinessProbe.failureThreshold }}
resources:
{{- toYaml .Values.restApi.resources | nindent 12 }}
{{- with .Values.restApi.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.restApi.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.restApi.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}

View File

@@ -0,0 +1,45 @@
{{- if .Values.restApi.enabled -}}
{{- $servicePort := .Values.restApi.service.port -}}
{{- $serviceName := .Values.restApi.service.name -}}
{{- $ingressPath := .Values.restApi.ingress.path -}}
{{- $ingressPathType := .Values.restApi.ingress.pathType -}}
{{- $extraPaths := .Values.restApi.ingress.extraPaths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress-rest-api
labels:
{{- with .Values.restApi.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.restApi.ingress.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl $value $ | quote }}
{{- end }}
{{- end }}
spec:
ingressClassName: nginx
{{- with .Values.restApi.ingress.tls }}
tls:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
{{- if .Values.restApi.ingress.hosts }}
{{- range .Values.restApi.ingress.hosts }}
- host: {{ tpl . $ }}
http:
paths:
{{- with $extraPaths }}
{{- toYaml . | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- end -}}
{{- end }}

View File

@@ -0,0 +1,12 @@
{{- if .Values.restApi.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.restApi.service.name }}
spec:
selector:
app: rest-api
ports:
- port: {{ .Values.restApi.service.targetPort }}
targetPort: {{ .Values.restApi.service.port }}
{{- end }}

View File

@@ -20,6 +20,49 @@ bot:
propertyConfig:
hikariPoolSize: 10
restApi:
enabled: true
repository: harbor.sheldan.dev/sissi
pullPolicy: IfNotPresent
image: sissi-rest-api
tag: 1.4.20
podAnnotations: {}
podSecurityContext: {}
securityContext: {}
livenessProbe:
initialDelaySeconds: 2
periodSeconds: 5
failureThreshold: 3
readinessProbe:
initialDelaySeconds: 2
periodSeconds: 5
failureThreshold: 3
service:
port: 8080
targetPort: 80
name: rest-api
resources:
limits:
cpu:
memory:
requests:
cpu:
memory:
nodeSelector: {}
tolerations: []
affinity: {}
ingress:
enabled: false
annotations: {}
labels: {}
path: /
pathType: Prefix
hosts:
extraPaths: []
tls: []
templateDeployment:
enabled: true
repository: harbor.sheldan.dev/abstracto