Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support PVC as input for config for Hosted Gateways #27

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions charts/lunar-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ metadata:
{{- include "lunar-proxy.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
{{- if eq .Values.configSource "pvc" }}
# TODO: This is needed because PersistentVolumeClaim cannot be mounted
# twice, as would naturally happen with RollingUpdate (default)
strategy:
type: Recreate
{{- end }}
selector:
matchLabels:
{{- include "lunar-proxy.selectorLabels" . | nindent 6 }}
Expand Down Expand Up @@ -207,6 +213,7 @@ spec:

volumeMounts:
{{- if .Values.lunarStreamsEnabled }}
{{- if eq .Values.configSource "configMap" }}
- mountPath: /etc/lunar-proxy
name: root
- mountPath: /etc/lunar-proxy/flows
Expand All @@ -222,8 +229,12 @@ spec:
{{- if .Values.secretNames.mtlsCerts }}
- mountPath: /etc/lunar-proxy/certs/mtls
name: mtls-certs
{{- end }}
{{- else }}
{{- end }}
{{- else }} # it's not a configMap source - it's pvc
- mountPath: "/etc/lunar-proxy"
name: lunar-proxy-config-pvc
{{- end }}
{{- else }} # Lunar streams not enabled
- mountPath: /etc/lunar-proxy
name: policies
{{- end }}
Expand All @@ -241,6 +252,12 @@ spec:
{{- end }}
volumes:
{{- if .Values.lunarStreamsEnabled }}
{{- if eq .Values.configSource "pvc" }}
- name: lunar-proxy-config-pvc
persistentVolumeClaim:
claimName: {{ include "lunar-proxy.fullname" . }}
{{- end }}

{{- if .Values.configMapNames.flows }}
- configMap:
name: {{ .Values.configMapNames.flows }}
Expand Down
14 changes: 14 additions & 0 deletions charts/lunar-proxy/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if eq .Values.configSource "pvc" }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "lunar-proxy.fullname" . }}
spec:
# storageClassName: manual
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
{{- end }}
5 changes: 5 additions & 0 deletions charts/lunar-proxy/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@
"type": "object",
"description": "Kubernetes requests and limits"
},
"configSource": {
"type": "string",
"enum": ["configMap", "vpc"],
"description": "The type of source for the configuration for Lunar Gateway."
},
"configMapNames": {
"type": "object",
"description": "ConfigMap names correlating to configuration to be used by Lunar Proxy. See https://docs.lunar.dev/flows-configurations/#folder-structure for folder structure used by Lunar Gateway. Alternatively, the `.configFiles` field can be used to provide the configurations inline",
Expand Down
1 change: 1 addition & 0 deletions charts/lunar-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ serviceMonitor:

targetLabels: []

configSource: 'configMap' # 'configMap' or 'pvc'
configMapNames: {}
secretNames: {}
configFiles: {}
Expand Down