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

Add namespace template variable #181

Closed
wants to merge 2 commits into from
Closed
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
2 changes: 1 addition & 1 deletion charts/uptime-kuma/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ name: uptime-kuma
sources:
- https://github.com/louislam/uptime-kuma
type: application
version: 2.20.0
version: 2.20.1
1 change: 1 addition & 0 deletions charts/uptime-kuma/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ A self-hosted Monitoring tool like "Uptime-Robot".
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `2` | |
| nameOverride | string | `""` | |
| namespaceOverride | string | `""` | A custom namespace to override the default namespace for the deployed resources. |
| nodeSelector | object | `{}` | |
| podAnnotations | object | `{}` | |
| podEnv[0].name | string | `"UPTIME_KUMA_PORT"` | |
Expand Down
11 changes: 11 additions & 0 deletions charts/uptime-kuma/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,14 @@ Set automountServiceAccountToken when service account is created
{{- define "uptime-kuma.automountServiceAccountToken" -}}
{{- default .Values.serviceAccount.create }}
{{- end }}

{{/*
Determine the namespace to use, allowing for a namespace override.
*/}}
{{- define "uptime-kuma.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "uptime-kuma.fullname" . }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
{{- if .Values.ingress.extraLabels }}
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ include "uptime-kuma.fullname" . }}-pvc
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "uptime-kuma.fullname" . }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "uptime-kuma.serviceAccountName" . }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ include "uptime-kuma.fullname" . }}-metrics-basic-auth
namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace | default (include "uptime-kuma.namespace" .) }}
type: kubernetes.io/basic-auth
stringData:
{{- range $key, $value := .Values.serviceMonitor.basicAuth }}
Expand Down
2 changes: 1 addition & 1 deletion charts/uptime-kuma/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "uptime-kuma.fullname" . }}
namespace: {{ default .Release.Namespace .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace | default (include "uptime-kuma.namespace" .) }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.selector }}
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "uptime-kuma.fullname" . }}
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
spec:
Expand Down
1 change: 1 addition & 0 deletions charts/uptime-kuma/templates/tests/test-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: v1
kind: Pod
metadata:
name: "{{ include "uptime-kuma.fullname" . }}-test-connection"
namespace: {{ include "uptime-kuma.namespace" . }}
labels:
{{- include "uptime-kuma.labels" . | nindent 4 }}
annotations:
Expand Down
2 changes: 2 additions & 0 deletions charts/uptime-kuma/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ image:
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
# -- A custom namespace to override the default namespace for the deployed resources.
namespaceOverride: ""

# If this option is set to false a StateFulset instead of a Deployment is used
useDeploy: true
Expand Down
Loading