[OPB-xxx] upgrading abstracto version

enabling experience leaderboard dashboard deployment
This commit is contained in:
Sheldan
2024-03-27 00:13:23 +01:00
parent 6b777c9f20
commit 718445bbd6
9 changed files with 188 additions and 4 deletions

View File

@@ -0,0 +1,70 @@
{{- if .Values.restApi.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "oneplusBot.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 "oneplusBot.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.restApi.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-rest-api
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: BACKEND_HOST
value: "{{ include "oneplusBot.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local"
- name: BACKEND_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

@@ -21,7 +21,7 @@ templateDeployment:
repository: harbor.sheldan.dev/abstracto
pullPolicy: Always
image: abstracto-template-deployment
tag: 1.5.27
tag: 1.5.32
templateDeploymentData:
repository: harbor.sheldan.dev/oneplus-bot
pullPolicy: Always
@@ -32,7 +32,7 @@ dbConfigDeployment:
repository: harbor.sheldan.dev/abstracto
pullPolicy: Always
image: abstracto-db-deployment
tag: 1.5.27
tag: 1.5.32
dbConfigDeploymentData:
repository: harbor.sheldan.dev/oneplus-bot
pullPolicy: Always
@@ -76,6 +76,46 @@ privateRestApi:
nodeSelector: {}
tolerations: []
affinity: {}
restApi:
enabled: true
repository: harbor.sheldan.dev/oneplus-bot
pullPolicy: Always
image: oneplus-bot-rest-api
tag: 1.6.22
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: null
memory: null
requests:
cpu: null
memory: null
nodeSelector: {}
tolerations: []
affinity: {}
ingress:
enabled: false
annotations: {}
labels: {}
path: /
pathType: Prefix
hosts: null
extraPaths: []
tls: []
grafanaDeployment:
repository: harbor.sheldan.dev/grafana-tools
pullPolicy: Always

View File

@@ -0,0 +1,9 @@
ARG REGISTRY_PREFIX
ARG ABSTRACTO_VERSION
FROM ${REGISTRY_PREFIX}abstracto-rest-api-experience:${ABSTRACTO_VERSION:-latest} AS experience-api
FROM ${REGISTRY_PREFIX}abstracto-rest-api-core:${ABSTRACTO_VERSION:-latest} AS core-api
FROM ${REGISTRY_PREFIX}abstracto-rest-api:${ABSTRACTO_VERSION:-latest}
COPY --from=core-api /python /python
COPY --from=experience-api /python /python