Skip to content
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
6 changes: 6 additions & 0 deletions charts/gonenote/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- define "gonenote.redis.fullname" -}}
{{ include "gonenote.fullname" . }}-redis
{{- end }}

{{- define "gonenote.redis.labels" -}}
app.kubernetes.io/name: {{ include "gonenote.redis.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: redis
{{- end }}
42 changes: 42 additions & 0 deletions charts/gonenote/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,45 @@ data:
REDIS_URL: redis://{{ include "gonenote.redis.fullname" . }}:{{ .Values.redis.port | toString }}
MAX_NOTE_LENGTH: {{ .Values.app.maxNoteLength | quote }}
DEFAULT_TTL: {{ .Values.app.defaultTtl | quote }}
{{- if .Values.branding.name }}
APP_NAME: {{ .Values.branding.name | quote }}
{{- end }}
{{- if .Values.branding.logoUrl }}
APP_LOGO_URL: {{ .Values.branding.logoUrl | quote }}
{{- end }}
{{- if .Values.branding.colors.root }}
APP_COLOR_ROOT: {{ .Values.branding.colors.root | quote }}
{{- end }}
{{- if .Values.branding.colors.surface }}
APP_COLOR_SURFACE: {{ .Values.branding.colors.surface | quote }}
{{- end }}
{{- if .Values.branding.colors.elevated }}
APP_COLOR_ELEVATED: {{ .Values.branding.colors.elevated | quote }}
{{- end }}
{{- if .Values.branding.colors.border }}
APP_COLOR_BORDER: {{ .Values.branding.colors.border | quote }}
{{- end }}
{{- if .Values.branding.colors.primary }}
APP_COLOR_PRIMARY: {{ .Values.branding.colors.primary | quote }}
{{- end }}
{{- if .Values.branding.colors.secondary }}
APP_COLOR_SECONDARY: {{ .Values.branding.colors.secondary | quote }}
{{- end }}
{{- if .Values.branding.colors.muted }}
APP_COLOR_MUTED: {{ .Values.branding.colors.muted | quote }}
{{- end }}
{{- if .Values.branding.colors.accent }}
APP_COLOR_ACCENT: {{ .Values.branding.colors.accent | quote }}
{{- end }}
{{- if .Values.branding.colors.accentHover }}
APP_COLOR_ACCENT_HOVER: {{ .Values.branding.colors.accentHover | quote }}
{{- end }}
{{- if .Values.branding.colors.success }}
APP_COLOR_SUCCESS: {{ .Values.branding.colors.success | quote }}
{{- end }}
{{- if .Values.branding.colors.error }}
APP_COLOR_ERROR: {{ .Values.branding.colors.error | quote }}
{{- end }}
{{- if .Values.app.apiKey }}
API_KEY: {{ .Values.app.apiKey | quote }}
{{- end }}
4 changes: 4 additions & 0 deletions charts/gonenote/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ spec:
- configMapRef:
name: {{ include "gonenote.fullname" . }}
- secretRef:
{{- if .Values.useExistingSecret }}
name: {{ .Values.existingSecret.name }}
{{- else }}
name: {{ include "gonenote.fullname" . }}
{{- end }}
env:
- name: HOST
value: "0.0.0.0"
Expand Down
22 changes: 17 additions & 5 deletions charts/gonenote/templates/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "gonenote.redis.fullname" . }}
labels: {{- include "gonenote.labels" . | nindent 4 }}
labels: {{- include "gonenote.redis.labels" . | nindent 4 }}
spec:
selector: {{- include "gonenote.labels" . | nindent 4 }}
selector: {{- include "gonenote.redis.labels" . | nindent 4 }}
ports:
- port: {{ .Values.redis.port }}
targetPort: redis
Expand All @@ -13,14 +13,14 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "gonenote.redis.fullname" . }}
labels: {{- include "gonenote.labels" . | nindent 4 }}
labels: {{- include "gonenote.redis.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels: {{- include "gonenote.labels" . | nindent 6 }}
matchLabels: {{- include "gonenote.redis.labels" . | nindent 6 }}
template:
metadata:
labels: {{- include "gonenote.labels" . | nindent 8 }}
labels: {{- include "gonenote.redis.labels" . | nindent 8 }}
spec:
containers:
- name: redis
Expand All @@ -30,3 +30,15 @@ spec:
containerPort: {{ .Values.redis.port }}
args: {{- toYaml .Values.redis.args | nindent 12 }}
resources: {{- toYaml .Values.redis.resources | nindent 12 }}
readinessProbe:
exec:
command: ["redis-cli", "ping"]
initialDelaySeconds: 2
periodSeconds: 5
timeoutSeconds: 3
livenessProbe:
exec:
command: ["redis-cli", "ping"]
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
2 changes: 2 additions & 0 deletions charts/gonenote/templates/secret.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if not .Values.useExistingSecret }}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -6,3 +7,4 @@ metadata:
type: Opaque
stringData:
SECRET_KEY: {{ required "A valid .Values.secretKey is required (generate: openssl rand -hex 32)" .Values.secretKey | quote }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/gonenote/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@ image:

# -- Generate on first install and keep: openssl rand -hex 32
secretKey: ""
useExistingSecret: false
existingSecret:
name: ""

app:
port: 3000
maxNoteLength: "102400"
defaultTtl: "604800"
# -- Optional: protect the API endpoint with a Bearer token
apiKey: ""

# Whitelabel branding (all optional — unset = GoneNote defaults)
branding:
Expand Down
Loading