Skip to content

Commit

Permalink
Use values from secrets env
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulinux committed Feb 27, 2024
1 parent 0a85cca commit 3814836
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 17 deletions.
2 changes: 1 addition & 1 deletion charts/neon-storage-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: neon-storage-controller
description: Neon storage controller
type: application
version: 1.0.1
version: 1.0.2
appVersion: "0.1.0"
kubeVersion: "^1.18.x-x"
home: https://neon.tech
Expand Down
2 changes: 1 addition & 1 deletion charts/neon-storage-controller/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# neon-storage-controller

![Version: 1.0.1](https://img.shields.io/badge/Version-1.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml)
![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml)

Neon storage controller

Expand Down
39 changes: 24 additions & 15 deletions charts/neon-storage-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,10 @@ spec:
- -l
# In the container, use the same port as service.
- 0.0.0.0:{{ .Values.service.port }}
{{- if .Values.settings.databaseUrl }}
- --database-url
- {{ .Values.settings.databaseUrl }}
{{- end }}
{{- if .Values.settings.jwtToken }}
- --jwt-token
- {{ .Values.settings.jwtToken }}
{{- end }}
{{- if .Values.settings.publicKey }}
- --public-key={{ .Values.settings.publicKey | toJson }}
{{- end }}
{{- if .Values.settings.controlPlaneJwtToken }}
- --control-plane-jwt-token
- {{ .Values.settings.controlPlaneJwtToken }}
{{- end }}
- --database-url $(DATABASE_URL)
- --jwt-token $(JWT_TOKEN)
- --public-key={{ $(PUBLIC_KEY) | b64dec | toJson }}
- --control-plane-jwt-token $(CONTROL_PLANE_JWT_TOKEN)
{{- if .Values.settings.computeHookUrl }}
- --compute-hook-url
- {{ .Values.settings.computeHookUrl }}
Expand All @@ -79,6 +68,26 @@ spec:
value: {{ . }}
{{- end }}
{{- end }}
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: {{ include "neon-storage-controller.fullname" . }}
key: DATABASE_URL
- name: JWT_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "neon-storage-controller.fullname" . }}
key: JWT_TOKEN
- name: PUBLIC_KEY
valueFrom:
secretKeyRef:
name: {{ include "neon-storage-controller.fullname" . }}
key: PUBLIC_KEY
- name: CONTROL_PLANE_JWT_TOKEN
valueFrom:
secretKeyRef:
name: {{ include "neon-storage-controller.fullname" . }}
key: CONTROL_PLANE_JWT_TOKEN
ports:
- name: controller
containerPort: {{ .Values.service.port }}
Expand Down
12 changes: 12 additions & 0 deletions charts/neon-storage-controller/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ include "neon-storage-controller.fullname" . }}
labels:
{{- include "neon-storage-controller.labels" . | nindent 4 }}
type: Opaque
data:
DATABASE_URL: {{ .Values.settings.databaseUrl | b64enc | quote }}
JWT_TOKEN: {{ .Values.settings.jwtToken| b64enc | quote }}
CONTROL_PLANE_JWT_TOKEN: {{ .Values.settings.controlPlaneJwtToken | b64enc | quote }}
PUBLIC_KEY: {{ .Values.settings.publicKey | b64enc | quote }}

0 comments on commit 3814836

Please sign in to comment.