|
| 1 | +{{- include "oc.basicServiceTemplates" (dict "scope" . "appName" "appNameAuthService" "appNameSuffix" "") -}} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +{{ include "oc.metadata" . }} |
| 5 | +spec: |
| 6 | + {{- include "oc.selector" . | nindent 2 }} |
| 7 | + {{- if and (not .Values.autoscaling.enabled) (.Values.replicas) }} |
| 8 | + replicas: {{ .Values.replicas }} |
| 9 | + {{- end }} |
| 10 | + {{- include "oc.deploymentStrategy" . | nindent 2 }} |
| 11 | + template: |
| 12 | + {{- include "oc.templateMetadata" (dict "scope" $ "configCheck" false) | nindent 4 }} |
| 13 | + spec: |
| 14 | + {{- include "oc.affinity" $ | nindent 6 }} |
| 15 | + {{- include "oc.securityContextAndtopologySpreadConstraints" . | nindent 6 }} |
| 16 | + {{- include "oc.priorityClassName" $.priorityClassName | nindent 6 }} |
| 17 | + {{- include "oc.hostAliases" $ | nindent 6 }} |
| 18 | + nodeSelector: {{ toYaml $.nodeSelector | nindent 8 }} |
| 19 | + containers: |
| 20 | + - name: {{ .appName }} |
| 21 | + {{- include "oc.image" $ | nindent 10 }} |
| 22 | + command: ["opencloud"] |
| 23 | + args: ["auth-service", "server"] |
| 24 | + {{- include "oc.containerSecurityContext" . | nindent 10 }} |
| 25 | + env: |
| 26 | + {{- include "oc.serviceRegistry" . | nindent 12 }} |
| 27 | + |
| 28 | + - name: AUTH_SERVICE_LOG_COLOR |
| 29 | + value: {{ .Values.logging.color | quote }} |
| 30 | + - name: AUTH_SERVICE_LOG_LEVEL |
| 31 | + value: {{ .Values.logging.level | quote }} |
| 32 | + - name: AUTH_SERVICE_LOG_PRETTY |
| 33 | + value: {{ .Values.logging.pretty | quote }} |
| 34 | + |
| 35 | + - name: AUTH_SERVICE_TRACING_ENABLED |
| 36 | + value: "{{ .Values.tracing.enabled }}" |
| 37 | + - name: AUTH_SERVICE_TRACING_TYPE |
| 38 | + value: {{ .Values.tracing.type | quote }} |
| 39 | + - name: AUTH_SERVICE_TRACING_ENDPOINT |
| 40 | + value: {{ .Values.tracing.endpoint | quote }} |
| 41 | + - name: AUTH_SERVICE_TRACING_COLLECTOR |
| 42 | + value: {{ .Values.tracing.collector | quote }} |
| 43 | + |
| 44 | + - name: AUTH_SERVICE_DEBUG_PPROF |
| 45 | + value: {{ .Values.debug.profiling | quote }} |
| 46 | + |
| 47 | + - name: AUTH_SERVICE_GRPC_ADDR |
| 48 | + value: 0.0.0.0:9616 |
| 49 | + - name: AUTH_SERVICE_DEBUG_ADDR |
| 50 | + value: 0.0.0.0:9617 |
| 51 | + |
| 52 | + - name: AUTH_SERVICE_JWT_SECRET |
| 53 | + valueFrom: |
| 54 | + secretKeyRef: |
| 55 | + name: {{ include "secrets.jwtSecret" . }} |
| 56 | + key: jwt-secret |
| 57 | + |
| 58 | + - name: AUTH_SERVICE_SERVICE_ACCOUNT_ID |
| 59 | + valueFrom: |
| 60 | + configMapKeyRef: |
| 61 | + name: {{ include "config.authService" . }} |
| 62 | + key: service-account-id |
| 63 | + - name: AUTH_SERVICE_SERVICE_ACCOUNT_SECRET |
| 64 | + valueFrom: |
| 65 | + secretKeyRef: |
| 66 | + name: {{ include "secrets.serviceAccountSecret" . }} |
| 67 | + key: service-account-secret |
| 68 | + |
| 69 | + {{- include "oc.caEnv" $ | nindent 12}} |
| 70 | + |
| 71 | + {{- include "oc.livenessProbe" . | nindent 10 }} |
| 72 | + |
| 73 | + resources: {{ toYaml .resources | nindent 12 }} |
| 74 | + |
| 75 | + ports: |
| 76 | + - name: grpc |
| 77 | + containerPort: 9616 |
| 78 | + - name: metrics-debug |
| 79 | + containerPort: 9617 |
| 80 | + |
| 81 | + volumeMounts: |
| 82 | + - name: tmp-volume |
| 83 | + mountPath: /tmp |
| 84 | + {{- include "oc.caPath" $ | nindent 12}} |
| 85 | + |
| 86 | + {{- include "oc.imagePullSecrets" $ | nindent 6 }} |
| 87 | + volumes: |
| 88 | + - name: tmp-volume |
| 89 | + emptyDir: {} |
| 90 | + {{- include "oc.caVolume" $ | nindent 8}} |
0 commit comments