|
| 1 | +{{- range $key, $val := .Values.apis }} |
| 2 | +--- |
| 3 | +apiVersion: apps/v1 |
| 4 | +kind: Deployment |
| 5 | +metadata: |
| 6 | + name: {{ printf "%s-%s" (include "chart.name" $) $key | kebabcase }} |
| 7 | + namespace: {{ include "final.namespace" $ }} |
| 8 | + labels: |
| 9 | + app.kubernetes.io/name: {{ $key | kebabcase }} |
| 10 | + app.kubernetes.io/component: api |
| 11 | + app.kubernetes.io/instance: {{ $.Release.Name }} |
| 12 | + app.kubernetes.io/managed-by: {{ $.Release.Service }} |
| 13 | + app.kubernetes.io/part-of: {{ include "chart.name" $ }} |
| 14 | + helm.sh/chart: {{ $.Chart.Name }} |
| 15 | + {{- with $val.labels }} |
| 16 | + {{- toYaml . | nindent 4 }} |
| 17 | + {{- end }} |
| 18 | + {{- with $val.annotations }} |
| 19 | + annotations: |
| 20 | + {{- toYaml . | nindent 4 }} |
| 21 | + {{- end }} |
| 22 | +spec: |
| 23 | + replicas: {{ $val.replicas | default 1 }} |
| 24 | + {{- with $val.strategy }} |
| 25 | + strategy: |
| 26 | + {{- toYaml . | nindent 4 }} |
| 27 | + {{- end }} |
| 28 | + selector: |
| 29 | + matchLabels: |
| 30 | + app.kubernetes.io/name: {{ $key | kebabcase }} |
| 31 | + app.kubernetes.io/component: api |
| 32 | + app.kubernetes.io/instance: {{ $.Release.Name }} |
| 33 | + template: |
| 34 | + metadata: |
| 35 | + labels: |
| 36 | + app.kubernetes.io/name: {{ $key | kebabcase }} |
| 37 | + app.kubernetes.io/component: api |
| 38 | + app.kubernetes.io/instance: {{ $.Release.Name }} |
| 39 | + app.kubernetes.io/managed-by: {{ $.Release.Service }} |
| 40 | + app.kubernetes.io/part-of: {{ include "chart.name" $ }} |
| 41 | + helm.sh/chart: {{ $.Chart.Name }} |
| 42 | + {{- with $val.labels }} |
| 43 | + {{- toYaml . | nindent 8 }} |
| 44 | + {{- end }} |
| 45 | + {{- with $val.podAnnotations }} |
| 46 | + annotations: |
| 47 | + {{- toYaml . | nindent 8 }} |
| 48 | + {{- end }} |
| 49 | + spec: |
| 50 | + serviceAccountName: {{ $val.serviceAccount.name | default "default" }} |
| 51 | + {{- with $val.imagePullSecrets }} |
| 52 | + imagePullSecrets: |
| 53 | + {{- toYaml . | nindent 8 }} |
| 54 | + {{- end }} |
| 55 | + containers: |
| 56 | + - name: {{ $key | kebabcase }} |
| 57 | + {{- $image := get $val "image" | default dict }} |
| 58 | + image: "{{ get $image "registry" | default $.Values.global.image.registry }}/{{ get $image "repository" | default $.Values.global.image.repository }}:{{ get $image "tag" | default $.Values.global.image.tag | default $.Chart.AppVersion }}" |
| 59 | + imagePullPolicy: {{ $val.imagePullPolicy | default "IfNotPresent" }} |
| 60 | + |
| 61 | + {{- with $val.command }} |
| 62 | + command: |
| 63 | + {{- toYaml . | nindent 12 }} |
| 64 | + {{- end }} |
| 65 | + |
| 66 | + {{- with $val.args }} |
| 67 | + args: |
| 68 | + {{- toYaml . | nindent 12 }} |
| 69 | + {{- end }} |
| 70 | + |
| 71 | + {{- with $val.env }} |
| 72 | + env: |
| 73 | + {{- range . }} |
| 74 | + - name: {{ .name }} |
| 75 | + value: {{ .value | quote }} |
| 76 | + {{- end }} |
| 77 | + {{- end }} |
| 78 | + |
| 79 | + envFrom: |
| 80 | + - secretRef: |
| 81 | + name: {{ include "activeloop-neohorizon.fullname" $ }} |
| 82 | + {{- with $val.envFrom }} |
| 83 | + {{- toYaml . | nindent 12 }} |
| 84 | + {{- end }} |
| 85 | + |
| 86 | + {{- if and $val.enableHealthProbes }} |
| 87 | + livenessProbe: |
| 88 | + httpGet: |
| 89 | + path: /health |
| 90 | + port: 8000 |
| 91 | + initialDelaySeconds: 30 |
| 92 | + periodSeconds: 20 |
| 93 | + timeoutSeconds: 3 |
| 94 | + failureThreshold: 3 |
| 95 | + readinessProbe: |
| 96 | + httpGet: |
| 97 | + path: /health |
| 98 | + port: 8000 |
| 99 | + initialDelaySeconds: 10 |
| 100 | + periodSeconds: 10 |
| 101 | + timeoutSeconds: 3 |
| 102 | + failureThreshold: 3 |
| 103 | + successThreshold: 1 |
| 104 | + startupProbe: |
| 105 | + httpGet: |
| 106 | + path: /health |
| 107 | + port: 8000 |
| 108 | + failureThreshold: 20 |
| 109 | + periodSeconds: 5 |
| 110 | + timeoutSeconds: 3 |
| 111 | + {{- end }} |
| 112 | + |
| 113 | + {{- with $val.resources }} |
| 114 | + resources: |
| 115 | + {{- toYaml . | nindent 12 }} |
| 116 | + {{- end }} |
| 117 | + |
| 118 | + |
| 119 | + {{- with $val.securityContext | default $.Values.global.securityContext }} |
| 120 | + securityContext: |
| 121 | + {{- toYaml . | nindent 12 }} |
| 122 | + {{- end }} |
| 123 | + |
| 124 | + {{- with $val.nodeSelector | default $.Values.global.nodeSelector }} |
| 125 | + nodeSelector: |
| 126 | + {{- toYaml . | nindent 8 }} |
| 127 | + {{- end }} |
| 128 | + |
| 129 | + {{- with $val.affinity | default $.Values.global.affinity }} |
| 130 | + affinity: |
| 131 | + {{- toYaml . | nindent 8 }} |
| 132 | + {{- end }} |
| 133 | + |
| 134 | + {{- with $val.tolerations | default $.Values.global.tolerations }} |
| 135 | + tolerations: |
| 136 | + {{- toYaml . | nindent 8 }} |
| 137 | + {{- end }} |
| 138 | + |
| 139 | + {{- with $val.podSecurityContext | default $.Values.global.podSecurityContext }} |
| 140 | + securityContext: |
| 141 | + {{- toYaml . | nindent 8 }} |
| 142 | + {{- end }} |
| 143 | +{{- end }} |
0 commit comments