diff --git a/charts/uptime-kuma/templates/deployment.yaml b/charts/uptime-kuma/templates/deployment.yaml index 90dac1b..d441934 100644 --- a/charts/uptime-kuma/templates/deployment.yaml +++ b/charts/uptime-kuma/templates/deployment.yaml @@ -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 diff --git a/charts/uptime-kuma/templates/securitygrouppolicy.yaml b/charts/uptime-kuma/templates/securitygrouppolicy.yaml new file mode 100644 index 0000000..598774d --- /dev/null +++ b/charts/uptime-kuma/templates/securitygrouppolicy.yaml @@ -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 }} diff --git a/charts/uptime-kuma/values.yaml b/charts/uptime-kuma/values.yaml index 5128bd2..d7b6045 100644 --- a/charts/uptime-kuma/values.yaml +++ b/charts/uptime-kuma/values.yaml @@ -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 @@ -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: []