Skip to content

Commit

Permalink
Add custom database secret for uptime kuma v2
Browse files Browse the repository at this point in the history
  • Loading branch information
3-commerce committed Jun 11, 2024
1 parent 1fe2035 commit dd62c26
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
22 changes: 22 additions & 0 deletions charts/uptime-kuma/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,28 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
- name: UPTIME_KUMA_DB_TYPE
value: {{ .Values.database.type | lower }}
- name: UPTIME_KUMA_DB_HOSTNAME
value: {{ .Values.database.host | quote }}
- name: UPTIME_KUMA_DB_PORT
value: {{ .Values.database.port | quote }}
- name: UPTIME_KUMA_DB_NAME
value: {{ .Values.database.dbname | quote }}
{{- if and .Values.database.existingSecret .Values.database.existingSecretUsernameKey }}
- name: UPTIME_KUMA_DB_USERNAME
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret }}
key: {{ .Values.database.existingSecretUsernameKey }}
{{- end }}
{{- if and .Values.database.existingSecret .Values.database.existingSecretPasswordKey }}
- name: UPTIME_KUMA_DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.database.existingSecret }}
key: {{ .Values.database.existingSecretPasswordKey }}
{{- end }}
ports:
- name: http
containerPort: 3001
Expand Down
18 changes: 18 additions & 0 deletions charts/uptime-kuma/templates/securitygrouppolicy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.awsEKS.sgp.enabled -}}
apiVersion: vpcresources.k8s.aws/v1beta1
kind: SecurityGroupPolicy
metadata:
name: {{ template "uptime-kuma.name" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "uptime-kuma.selectorLabels" . | nindent 6 }}
securityGroups:
groupIds:
{{- range .Values.awsEKS.sgp.sgIds }}
- {{ . | quote }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions charts/uptime-kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ securityContext:
# runAsNonRoot: true
# runAsUser: 1000

awsEKS:
sgp:
enabled: false
# AWS Security Group IDs to attach to the pod
# sgIds:
# - sg-01abcd23456efgh
# - sg-99xyz87abc65def

service:
type: ClusterIP
port: 3001
Expand Down Expand Up @@ -125,6 +133,15 @@ volume:
# Reuse your own pre-existing PVC.
existingClaim: ""

database:
type: mariadb
# host:
# port:
# dbname:
# existingSecret:
# existingSecretUsernameKey:
# existingSecretPasswordKey:

# -- A list of additional volumes to be added to the pod
additionalVolumes:
[]
Expand Down

0 comments on commit dd62c26

Please sign in to comment.