mirror of
https://github.com/Sheldan/Sissi.git
synced 2026-01-25 01:56:52 +00:00
[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:
70
deployment/helm/sissi/templates/rest-api-deployment.yaml
Normal file
70
deployment/helm/sissi/templates/rest-api-deployment.yaml
Normal 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 }}
|
||||
45
deployment/helm/sissi/templates/rest-api-ingress.yaml
Normal file
45
deployment/helm/sissi/templates/rest-api-ingress.yaml
Normal 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 }}
|
||||
12
deployment/helm/sissi/templates/rest-api-service.yaml
Normal file
12
deployment/helm/sissi/templates/rest-api-service.yaml
Normal 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 }}
|
||||
@@ -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
|
||||
|
||||
@@ -797,6 +797,27 @@
|
||||
</artifactItems>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>copy-resources</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>copy-resources</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outputDirectory>src/main/docker/rest-api/python</outputDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>../../python/modules/rest-api/</directory>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
@@ -5,6 +5,10 @@ services:
|
||||
build:
|
||||
context: sissi
|
||||
image: ${REGISTRY_PREFIX}sissi-bot:${VERSION:-latest}
|
||||
rest-api:
|
||||
build:
|
||||
context: rest-api
|
||||
image: ${REGISTRY_PREFIX}sissi-rest-api:${VERSION:-latest}
|
||||
db-data:
|
||||
build:
|
||||
context: db-data
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
FROM python:3.10.13-alpine3.18
|
||||
ADD requirements.txt /
|
||||
RUN pip install -r requirements.txt
|
||||
RUN apk --no-cache add msttcorefonts-installer fontconfig && \
|
||||
update-ms-fonts && \
|
||||
fc-cache -f
|
||||
ADD wrapper /
|
||||
ADD python /python
|
||||
CMD ["/run.sh"]
|
||||
1
deployment/image-packaging/src/main/docker/rest-api/python/.gitignore
vendored
Normal file
1
deployment/image-packaging/src/main/docker/rest-api/python/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*
|
||||
@@ -0,0 +1,16 @@
|
||||
blinker==1.7.0
|
||||
certifi==2023.7.22
|
||||
charset-normalizer==3.3.2
|
||||
click==8.1.7
|
||||
Flask==3.0.0
|
||||
idna==3.4
|
||||
importlib-metadata==6.8.0
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
MarkupSafe==2.1.3
|
||||
Pillow==10.1.0
|
||||
requests==2.31.0
|
||||
urllib3==2.0.7
|
||||
waitress==2.1.2
|
||||
Werkzeug==3.0.1
|
||||
zipp==3.17.0
|
||||
4
deployment/image-packaging/src/main/docker/rest-api/wrapper/run.sh
Executable file
4
deployment/image-packaging/src/main/docker/rest-api/wrapper/run.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "Starting python server..."
|
||||
python3 -u python/main.py
|
||||
Reference in New Issue
Block a user