From 0aaa0bc8100b0afbcda35351238471c8fad8ce99 Mon Sep 17 00:00:00 2001 From: Farid Bagishev Date: Mon, 8 Apr 2024 16:17:30 +0500 Subject: [PATCH] Init --- .gitignore | 2 + aidbox/.helmignore | 23 +++++ aidbox/Chart.yaml | 6 ++ aidbox/templates/_helpers.tpl | 62 ++++++++++++ aidbox/templates/configmap.yaml | 12 +++ aidbox/templates/deployment.yaml | 61 ++++++++++++ aidbox/templates/hpa.yaml | 32 +++++++ aidbox/templates/ingress.yaml | 34 +++++++ aidbox/templates/secrets.yaml | 17 ++++ aidbox/templates/service-api.yaml | 15 +++ aidbox/templates/service-metrics.yaml | 15 +++ aidbox/values.yaml | 96 +++++++++++++++++++ aidboxdb/.helmignore | 23 +++++ aidboxdb/Chart.yaml | 6 ++ aidboxdb/templates/_helpers.tpl | 62 ++++++++++++ aidboxdb/templates/configmap-env.yaml | 9 ++ aidboxdb/templates/configmap-files.yaml | 21 ++++ aidboxdb/templates/persistentvolumeclaim.yaml | 15 +++ aidboxdb/templates/secrets.yaml | 10 ++ aidboxdb/templates/service.yaml | 14 +++ aidboxdb/templates/statefulset.yaml | 63 ++++++++++++ aidboxdb/values.yaml | 32 +++++++ 22 files changed, 630 insertions(+) create mode 100644 .gitignore create mode 100644 aidbox/.helmignore create mode 100644 aidbox/Chart.yaml create mode 100644 aidbox/templates/_helpers.tpl create mode 100644 aidbox/templates/configmap.yaml create mode 100644 aidbox/templates/deployment.yaml create mode 100644 aidbox/templates/hpa.yaml create mode 100644 aidbox/templates/ingress.yaml create mode 100644 aidbox/templates/secrets.yaml create mode 100644 aidbox/templates/service-api.yaml create mode 100644 aidbox/templates/service-metrics.yaml create mode 100644 aidbox/values.yaml create mode 100644 aidboxdb/.helmignore create mode 100644 aidboxdb/Chart.yaml create mode 100644 aidboxdb/templates/_helpers.tpl create mode 100644 aidboxdb/templates/configmap-env.yaml create mode 100644 aidboxdb/templates/configmap-files.yaml create mode 100644 aidboxdb/templates/persistentvolumeclaim.yaml create mode 100644 aidboxdb/templates/secrets.yaml create mode 100644 aidboxdb/templates/service.yaml create mode 100644 aidboxdb/templates/statefulset.yaml create mode 100644 aidboxdb/values.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..14db357 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +.#** diff --git a/aidbox/.helmignore b/aidbox/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/aidbox/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/aidbox/Chart.yaml b/aidbox/Chart.yaml new file mode 100644 index 0000000..8587969 --- /dev/null +++ b/aidbox/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: edge +description: Aidbox +name: aidbox +type: application +version: 0.1.0 diff --git a/aidbox/templates/_helpers.tpl b/aidbox/templates/_helpers.tpl new file mode 100644 index 0000000..090fcc4 --- /dev/null +++ b/aidbox/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "aidbox.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "aidbox.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "aidbox.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aidbox.labels" -}} +helm.sh/chart: {{ include "aidbox.chart" . }} +{{ include "aidbox.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aidbox.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aidbox.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aidbox.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aidbox.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/aidbox/templates/configmap.yaml b/aidbox/templates/configmap.yaml new file mode 100644 index 0000000..636909c --- /dev/null +++ b/aidbox/templates/configmap.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aidbox.fullname" . }} + labels: + {{- include "aidbox.labels" . | nindent 4 }} +data: + {{- range $key, $val := .Values.config }} + {{ $key }}: {{ $val | quote }} + {{- end }} + AIDBOX_BASE_URL: {{ .Values.protocol }}://{{ .Values.host }} + PGHOST: {{ required "missing config PGHOST value" .Values.config.PGHOST | quote }} diff --git a/aidbox/templates/deployment.yaml b/aidbox/templates/deployment.yaml new file mode 100644 index 0000000..40aaf95 --- /dev/null +++ b/aidbox/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "aidbox.fullname" . }} + labels: + {{- include "aidbox.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "aidbox.selectorLabels" . | nindent 6 }} + template: + metadata: + annotations: + checksum/config: {{ toJson .Values.config | sha256sum }} + checksum/secrets: {{ toJson .Values.secrets | sha256sum }} + labels: + {{- include "aidbox.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: {{ include "aidbox.fullname" . }} + - secretRef: + name: {{ include "aidbox.fullname" . }} + ports: + - name: api + containerPort: {{ int .Values.config.AIDBOX_PORT }} + protocol: TCP + - name: metrics + containerPort: {{ int .Values.config.BOX_METRICS_PORT }} + protocol: TCP + startupProbe: + {{- toYaml .Values.startupProbe | nindent 12 }} + livenessProbe: + {{- toYaml .Values.livenessProbe | nindent 12 }} + readinessProbe: + {{- toYaml .Values.readinessProbe | nindent 12 }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchLabels: + {{- include "aidbox.selectorLabels" . | nindent 20 }} + topologyKey: "kubernetes.io/hostname" + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/aidbox/templates/hpa.yaml b/aidbox/templates/hpa.yaml new file mode 100644 index 0000000..6f1eb9f --- /dev/null +++ b/aidbox/templates/hpa.yaml @@ -0,0 +1,32 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "aidbox.fullname" . }} + labels: + {{- include "aidbox.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "aidbox.fullname" . }} + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/aidbox/templates/ingress.yaml b/aidbox/templates/ingress.yaml new file mode 100644 index 0000000..ed46d7e --- /dev/null +++ b/aidbox/templates/ingress.yaml @@ -0,0 +1,34 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "aidbox.fullname" . -}} +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "aidbox.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if eq .Values.protocol "https" }} + tls: + - hosts: + - {{ .Values.host | quote }} + secretName: {{ $fullName }}-tls + {{- end }} + rules: + - host: {{ .Values.host | quote }} + http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: {{ $fullName }}-api + port: + number: {{ int .Values.config.AIDBOX_PORT }} +{{- end }} diff --git a/aidbox/templates/secrets.yaml b/aidbox/templates/secrets.yaml new file mode 100644 index 0000000..1703db2 --- /dev/null +++ b/aidbox/templates/secrets.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "aidbox.fullname" . }} + labels: + {{- include "aidbox.labels" . | nindent 4 }} +data: + {{- range $key, $val := .Values.secrets }} + {{ $key }}: {{ required (printf "missing secret %s value" $key) $val | b64enc }} + {{- end }} + + {{- with .Values.secrets }} + {{- if not .AIDBOX_LICENSE }} + AIDBOX_LICENSE_ID: {{ required "missing secret AIDBOX_LICENSE or AIDBOX_LICENSE_ID value" .AIDBOX_LICENSE_ID | b64enc }} + AIDBOX_LICENSE_KEY: {{ required "missing secret AIDBOX_LICENSE or AIDBOX_LICENSE_KEY value" .AIDBOX_LICENSE_KEY | b64enc }} + {{- end }} + {{- end }} diff --git a/aidbox/templates/service-api.yaml b/aidbox/templates/service-api.yaml new file mode 100644 index 0000000..8dde297 --- /dev/null +++ b/aidbox/templates/service-api.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aidbox.fullname" . }}-api + labels: + {{- include "aidbox.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - name: api + port: {{ int .Values.service.apiPort }} + protocol: TCP + targetPort: api + selector: + {{- include "aidbox.selectorLabels" . | nindent 4 }} diff --git a/aidbox/templates/service-metrics.yaml b/aidbox/templates/service-metrics.yaml new file mode 100644 index 0000000..87caded --- /dev/null +++ b/aidbox/templates/service-metrics.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aidbox.fullname" . }}-metrics + labels: + {{- include "aidbox.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - name: metrics + port: {{ int .Values.service.metricsPort }} + protocol: TCP + targetPort: metrics + selector: + {{- include "aidbox.selectorLabels" . | nindent 4 }} diff --git a/aidbox/values.yaml b/aidbox/values.yaml new file mode 100644 index 0000000..ae37765 --- /dev/null +++ b/aidbox/values.yaml @@ -0,0 +1,96 @@ +host: my.domain.tld +protocol: http + +config: + AIDBOX_BOX_ID: aidbox + AIDBOX_PORT: 8080 + BOX_INSTANCE_NAME: aidbox + BOX_METRICS_PORT: 8765 + PGDATABASE: aidbox + PGPORT: 5432 + +secrets: + AIDBOX_ADMIN_ID: admin + AIDBOX_ADMIN_PASSWORD: "" + AIDBOX_CLIENT_ID: admin + AIDBOX_CLIENT_SECRET: "" + # AIDBOX_LICENSE: "" + # or + # AIDBOX_LICENSE_ID: "" + # AIDBOX_LICENSE_KEY: "" + PGUSER: "" + PGPASSWORD: "" + + +image: + repository: healthsamurai/aidboxone + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +ingress: + enabled: true + className: "nginx" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + +livenessProbe: + httpGet: + path: /health + port: api + periodSeconds: 10 + failureThreshold: 10 +readinessProbe: + httpGet: + path: /health + port: api + periodSeconds: 10 + successThreshold: 1 + failureThreshold: 5 +startupProbe: + httpGet: + path: /health + port: api + initialDelaySeconds: 20 + periodSeconds: 5 + failureThreshold: 10 + +resources: + # limits: + # cpu: 100m + # memory: 128Mi + requests: + cpu: 500m + memory: 256Mi + +replicaCount: 1 + +autoscaling: + enabled: false + minReplicas: 1 + maxReplicas: 100 + targetCPUUtilizationPercentage: 80 + # targetMemoryUtilizationPercentage: 80 + +service: + type: ClusterIP + apiPort: 80 + metricsPort: 80 + +nameOverride: "" +fullnameOverride: "" + +podAnnotations: {} +podLabels: {} + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: + runAsNonRoot: true + runAsUser: 1000 + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true diff --git a/aidboxdb/.helmignore b/aidboxdb/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/aidboxdb/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/aidboxdb/Chart.yaml b/aidboxdb/Chart.yaml new file mode 100644 index 0000000..da4edbe --- /dev/null +++ b/aidboxdb/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +appVersion: "16.1" +description: AidboxDB +name: aidboxdb +type: application +version: 0.1.0 diff --git a/aidboxdb/templates/_helpers.tpl b/aidboxdb/templates/_helpers.tpl new file mode 100644 index 0000000..cd667f9 --- /dev/null +++ b/aidboxdb/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "aidboxdb.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "aidboxdb.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "aidboxdb.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "aidboxdb.labels" -}} +helm.sh/chart: {{ include "aidboxdb.chart" . }} +{{ include "aidboxdb.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "aidboxdb.selectorLabels" -}} +app.kubernetes.io/name: {{ include "aidboxdb.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "aidboxdb.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "aidboxdb.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/aidboxdb/templates/configmap-env.yaml b/aidboxdb/templates/configmap-env.yaml new file mode 100644 index 0000000..c501f05 --- /dev/null +++ b/aidboxdb/templates/configmap-env.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aidboxdb.fullname" . }}-env + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +data: + PGDATA: /data/pg + POSTGRES_DB: postgres diff --git a/aidboxdb/templates/configmap-files.yaml b/aidboxdb/templates/configmap-files.yaml new file mode 100644 index 0000000..80a36b7 --- /dev/null +++ b/aidboxdb/templates/configmap-files.yaml @@ -0,0 +1,21 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "aidboxdb.fullname" . }}-files + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +data: + postgres.conf: |- + listen_addresses = '*' + shared_buffers = {{ .Values.config.shared_buffers | squote }} + max_wal_size = {{ .Values.config.max_wal_size | squote }} + pg_stat_statements.max = 500 + pg_stat_statements.save = false + pg_stat_statements.track = top + pg_stat_statements.track_utility = true + shared_preload_libraries = 'pg_stat_statements' + track_io_timing = on + wal_level = logical + wal_log_hints = on + archive_command = 'wal-g wal-push %p' + restore_command = 'wal-g wal-fetch %f %p' diff --git a/aidboxdb/templates/persistentvolumeclaim.yaml b/aidboxdb/templates/persistentvolumeclaim.yaml new file mode 100644 index 0000000..f5167ce --- /dev/null +++ b/aidboxdb/templates/persistentvolumeclaim.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "aidboxdb.fullname" . }}-data + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ required "missing storageSize value" .Values.storageSize }} + {{- if .Values.storageClassName }} + storageClassName: {{ .Values.storageClassName }} + {{- end }} diff --git a/aidboxdb/templates/secrets.yaml b/aidboxdb/templates/secrets.yaml new file mode 100644 index 0000000..4834c70 --- /dev/null +++ b/aidboxdb/templates/secrets.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "aidboxdb.fullname" . }} + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +type: Opaque +data: + POSTGRES_PASSWORD: {{ required "missing env.PGPASSWORD value" .Values.env.PGPASSWORD | b64enc }} + POSTGRES_USER: {{ required "missing env.PGUSER value" .Values.env.PGUSER | b64enc }} diff --git a/aidboxdb/templates/service.yaml b/aidboxdb/templates/service.yaml new file mode 100644 index 0000000..f26b218 --- /dev/null +++ b/aidboxdb/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "aidboxdb.fullname" . }} + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - port: 5432 + targetPort: 5432 + protocol: TCP + selector: + {{- include "aidboxdb.selectorLabels" . | nindent 4 }} diff --git a/aidboxdb/templates/statefulset.yaml b/aidboxdb/templates/statefulset.yaml new file mode 100644 index 0000000..afed097 --- /dev/null +++ b/aidboxdb/templates/statefulset.yaml @@ -0,0 +1,63 @@ +{{- $fullName := include "aidboxdb.fullname" . -}} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ $fullName }} + labels: + {{- include "aidboxdb.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "aidboxdb.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "aidboxdb.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + envFrom: + - configMapRef: + name: {{ $fullName }}-env + - secretRef: + name: {{ $fullName }} + volumeMounts: + - name: db-pg-config + mountPath: /etc/configs + - name: db-dshm + mountPath: /dev/shm + - name: db-data + mountPath: /data + subPath: pg + ports: + - containerPort: 5432 + protocol: TCP + volumes: + - name: db-pg-config + configMap: + name: {{ $fullName }}-files + defaultMode: 420 + - name: db-dshm + emptyDir: + medium: Memory + - name: db-data + persistentVolumeClaim: + claimName: {{ $fullName }}-data diff --git a/aidboxdb/values.yaml b/aidboxdb/values.yaml new file mode 100644 index 0000000..f4a1dc8 --- /dev/null +++ b/aidboxdb/values.yaml @@ -0,0 +1,32 @@ +config: + max_wal_size: 4GB + shared_buffers: 2GB + +env: + PGUSER: postgres + PGPASSWORD: postgres + +storageClassName: "" +storageSize: 300Gi + + +image: + repository: healthsamurai/aidboxdb + pullPolicy: IfNotPresent + # Overrides the image tag whose default is the chart appVersion. + tag: "" + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +podSecurityContext: {} + # fsGroup: 2000 + +securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000