{{- if .Values.authhub.backend.enabled -}}
---
apiVersion: v1
kind: Service
metadata:
name: authhub-backend-service
namespace: {{ .Release.Namespace }}
spec:
type: {{ default "ClusterIP" .Values.authhub.backend.service.type }}
selector:
app: authhub-backend
ports:
- port: 11120
targetPort: 11120
nodePort: {{ default nil .Values.authhub.backend.service.nodePort }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: authhub-backend-deploy
namespace: {{ .Release.Namespace }}
labels:
app: authhub-backend
spec:
replicas: {{ default 1 .Values.globals.replicaCount }}
selector:
matchLabels:
app: authhub-backend
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/backend/authhub-backend-config.yaml") . | sha256sum }}
labels:
app: authhub-backend
spec:
automountServiceAccountToken: false
containers:
- name: authhub-backend
image: {{ .Values.authhub.backend.image | default (printf "%s/neocopilot/authhub:0.9.3-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (.Values.globals.arch | default "x86")) }}
imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }}
ports:
- containerPort: 11120
protocol: TCP
volumeMounts:
- name: authhub-shared
mountPath: /etc/aops
livenessProbe:
httpGet:
path: /oauth2/applications
port: 11120
scheme: HTTP
failureThreshold: 5
initialDelaySeconds: 60
periodSeconds: 90
resources:
requests:
cpu: 0.1
memory: 128Mi
limits:
{{ toYaml .Values.authhub.backend.resourceLimits | nindent 14 }}
initContainers:
- name: authback-copy
image: {{ .Values.authhub.secret_inject.image | default (printf "%s/neocopilot/secret_inject:dev-%s" (.Values.globals.imageRegistry | default "hub.oepkgs.net") (.Values.globals.arch | default "x86")) }}
imagePullPolicy: {{ default "IfNotPresent" .Values.globals.imagePullPolicy }}
command:
- python3
- ./main.py
- --config
- /config/copy-config.yml
- --copy
volumeMounts:
- mountPath: /db-secrets
name: euler-copilot-database-vl
- mountPath: /authhub-secrets
name: authhub-secret-vl
- mountPath: /config-rw
name: authhub-shared
- mountPath: /config
name: authhub-config
volumes:
- name: authhub-shared
emptyDir:
medium: Memory
- name: authhub-config
configMap:
name: authhub-backend-config
items:
- key: aops-config.yml
path: aops-config.yml
- key: authhub.yml
path: conf.d/authhub.yml
- key: copy-config.yml
path: copy-config.yml
- name: authhub-secret-vl
secret:
secretName: authhub-secret
- name: euler-copilot-database-vl
secret:
secretName: euler-copilot-database
{{- end -}}