|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "orb.fullname" . }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + {{- include "orb.labels" . | nindent 4 }} |
| 8 | +spec: |
| 9 | + replicas: {{ .Values.replicaCount }} |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + {{- include "orb.selectorLabels" . | nindent 6 }} |
| 13 | + template: |
| 14 | + metadata: |
| 15 | + annotations: |
| 16 | + # Force pod rollout when ConfigMap content changes |
| 17 | + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 18 | + {{- with .Values.podAnnotations }} |
| 19 | + {{- toYaml . | nindent 8 }} |
| 20 | + {{- end }} |
| 21 | + labels: |
| 22 | + {{- include "orb.selectorLabels" . | nindent 8 }} |
| 23 | + {{- with .Values.podLabels }} |
| 24 | + {{- toYaml . | nindent 8 }} |
| 25 | + {{- end }} |
| 26 | + spec: |
| 27 | + {{- with .Values.imagePullSecrets }} |
| 28 | + imagePullSecrets: |
| 29 | + {{- toYaml . | nindent 8 }} |
| 30 | + {{- end }} |
| 31 | + serviceAccountName: {{ include "orb.serviceAccountName" . }} |
| 32 | + securityContext: |
| 33 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 34 | + containers: |
| 35 | + - name: orb |
| 36 | + securityContext: |
| 37 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 38 | + image: {{ include "orb.image" . }} |
| 39 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 40 | + # Entrypoint: docker-entrypoint.sh serve |
| 41 | + # -> orb server start --foreground --host HOST --port PORT [--workers N] |
| 42 | + # The entrypoint reads HF_* env vars and invokes `orb server start --foreground`. |
| 43 | + command: ["./docker-entrypoint.sh", "serve"] |
| 44 | + ports: |
| 45 | + - name: http |
| 46 | + containerPort: {{ .Values.server.port }} |
| 47 | + protocol: TCP |
| 48 | + env: |
| 49 | + # Server |
| 50 | + - name: HF_SERVER_ENABLED |
| 51 | + value: "true" |
| 52 | + - name: HF_SERVER_HOST |
| 53 | + value: {{ .Values.server.host | quote }} |
| 54 | + - name: HF_SERVER_PORT |
| 55 | + value: {{ .Values.server.port | quote }} |
| 56 | + - name: HF_SERVER_WORKERS |
| 57 | + value: {{ .Values.server.workers | quote }} |
| 58 | + - name: HF_SERVER_LOG_LEVEL |
| 59 | + value: {{ .Values.server.serverLogLevel | quote }} |
| 60 | + - name: HF_LOGGING_LEVEL |
| 61 | + value: {{ .Values.server.logLevel | quote }} |
| 62 | + # Config file path (mounted from ConfigMap) |
| 63 | + - name: HF_CONFIG_FILE |
| 64 | + value: "/etc/orb/config.json" |
| 65 | + # Auth |
| 66 | + - name: HF_AUTH_ENABLED |
| 67 | + value: {{ .Values.auth.enabled | quote }} |
| 68 | + - name: HF_AUTH_STRATEGY |
| 69 | + value: {{ .Values.auth.strategy | quote }} |
| 70 | + {{- if .Values.auth.existingSecret }} |
| 71 | + - name: HF_AUTH_BEARER_TOKEN |
| 72 | + valueFrom: |
| 73 | + secretKeyRef: |
| 74 | + name: {{ .Values.auth.existingSecret }} |
| 75 | + key: bearer-token |
| 76 | + {{- end }} |
| 77 | + # Provider |
| 78 | + - name: HF_PROVIDER_TYPE |
| 79 | + value: {{ .Values.provider.type | quote }} |
| 80 | + {{- if eq .Values.provider.type "aws" }} |
| 81 | + - name: HF_PROVIDER_AWS_REGION |
| 82 | + value: {{ .Values.provider.aws.region | quote }} |
| 83 | + {{- end }} |
| 84 | + # Storage |
| 85 | + - name: HF_STORAGE_STRATEGY |
| 86 | + value: {{ .Values.storage.type | quote }} |
| 87 | + - name: HF_STORAGE_BASE_PATH |
| 88 | + value: {{ .Values.storage.basePath | quote }} |
| 89 | + {{- with .Values.extraEnv }} |
| 90 | + {{- toYaml . | nindent 12 }} |
| 91 | + {{- end }} |
| 92 | + volumeMounts: |
| 93 | + - name: orb-config |
| 94 | + mountPath: /etc/orb |
| 95 | + readOnly: true |
| 96 | + - name: orb-data |
| 97 | + mountPath: /app/data |
| 98 | + - name: orb-logs |
| 99 | + mountPath: /app/logs |
| 100 | + - name: orb-tmp |
| 101 | + mountPath: /app/tmp |
| 102 | + {{- with .Values.extraVolumeMounts }} |
| 103 | + {{- toYaml . | nindent 12 }} |
| 104 | + {{- end }} |
| 105 | + livenessProbe: |
| 106 | + httpGet: |
| 107 | + path: /health |
| 108 | + port: http |
| 109 | + initialDelaySeconds: 15 |
| 110 | + periodSeconds: 30 |
| 111 | + timeoutSeconds: 10 |
| 112 | + failureThreshold: 3 |
| 113 | + readinessProbe: |
| 114 | + httpGet: |
| 115 | + path: /health |
| 116 | + port: http |
| 117 | + initialDelaySeconds: 10 |
| 118 | + periodSeconds: 10 |
| 119 | + timeoutSeconds: 5 |
| 120 | + failureThreshold: 3 |
| 121 | + resources: |
| 122 | + {{- toYaml .Values.resources | nindent 12 }} |
| 123 | + volumes: |
| 124 | + - name: orb-config |
| 125 | + configMap: |
| 126 | + name: {{ include "orb.fullname" . }}-config |
| 127 | + - name: orb-data |
| 128 | + emptyDir: {} |
| 129 | + - name: orb-logs |
| 130 | + emptyDir: {} |
| 131 | + - name: orb-tmp |
| 132 | + emptyDir: {} |
| 133 | + {{- with .Values.extraVolumes }} |
| 134 | + {{- toYaml . | nindent 8 }} |
| 135 | + {{- end }} |
| 136 | + {{- with .Values.nodeSelector }} |
| 137 | + nodeSelector: |
| 138 | + {{- toYaml . | nindent 8 }} |
| 139 | + {{- end }} |
| 140 | + {{- with .Values.affinity }} |
| 141 | + affinity: |
| 142 | + {{- toYaml . | nindent 8 }} |
| 143 | + {{- end }} |
| 144 | + {{- with .Values.tolerations }} |
| 145 | + tolerations: |
| 146 | + {{- toYaml . | nindent 8 }} |
| 147 | + {{- end }} |
0 commit comments