Skip to content

Commit

Permalink
Merge pull request #203 from one-acre-fund/feature/nocodb-extra-confi…
Browse files Browse the repository at this point in the history
…guration

Refactor NocoDB Helm Chart to increase configurability
  • Loading branch information
samaroon authored Oct 17, 2024
2 parents ae96e73 + 1fb6663 commit 5f99980
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/nocodb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.3.0
version: 0.3.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
15 changes: 15 additions & 0 deletions charts/nocodb/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.extraEnv -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "nocodb.fullname" . }}-config
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
{{- range $key, $val := .Values.extraEnv }}
{{ $key }}: {{ $val | quote }}
{{- end }}
{{- end }}
14 changes: 7 additions & 7 deletions charts/nocodb/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,6 @@ spec:
- name: NC_REDIS_URL
value: "redis://:$(NC_REDIS_PASSWORD)@{{ template "nocodb.redis.fullname" . }}-master:{{ .Values.redis.master.service.ports.redis }}"
{{- end }}
{{- if and .Values.jwt.create (not (eq .Values.jwt.secret "")) }}
- name: NC_AUTH_JWT_SECRET
valueFrom:
secretKeyRef:
name: {{ include "nocodb.jwtSecretName" . }}
key: {{ include "nocodb.jwtSecretKey" . }}
{{- end }}
{{- if .Values.admin.create }}
- name: NC_ADMIN_EMAIL
valueFrom:
Expand Down Expand Up @@ -196,6 +189,13 @@ spec:
name: {{ include "nocodb.databaseSecretName" . }}
key: {{ include "nocodb.databaseSecretPasswordKey" . }}
{{- end }}
envFrom:
- secretRef:
name: {{ include "nocodb.fullname" . }}-secrets
optional: true
- configMapRef:
name: {{ include "nocodb.fullname" . }}-config
optional: true
ports:
- name: http
containerPort: {{ .Values.service.ports.http }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{{- if and .Values.jwt.create (not (eq .Values.jwt.secret "")) }}
{{- if and .Values.extraEnvSecrets }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "nocodb.jwtSecretName" . }}
name: {{ include "nocodb.fullname" . }}-secrets
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
type: Opaque
data:
{{ include "nocodb.jwtSecretKey" . }}: {{ .Values.jwt.secret | b64enc | quote }}
{{- range $key, $val := .Values.extraEnvSecrets }}
{{ $key }}: {{ $val | b64enc }}
{{- end }}
{{- end }}
8 changes: 2 additions & 6 deletions charts/nocodb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,8 @@ priorityClassName: ""

schedulerName: ""

jwt:
create: true
name: ""
secret: ""
existingSecretName: ""
existingSecretKey: ""
extraEnvSecrets: []
extraEnv: []

admin:
create: true
Expand Down

0 comments on commit 5f99980

Please sign in to comment.