Skip to content

Commit

Permalink
Merge pull request #74 from irfanhakim-as/uptimekuma
Browse files Browse the repository at this point in the history
Add Uptime Kuma chart
  • Loading branch information
irfanhakim-as authored May 23, 2024
2 parents 4de4ff7 + 10ad67c commit 67415ab
Show file tree
Hide file tree
Showing 16 changed files with 573 additions and 10 deletions.
Binary file added logos/uptimekuma.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion mika/syncthing/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: syncthing
description: Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers.
type: application
version: 0.1.0
version: 0.1.1
appVersion: "v1.27.3-ls131"
keywords:
- "syncthing"
Expand Down
5 changes: 2 additions & 3 deletions mika/syncthing/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{{- $ingress := .Values.ingress.enabled }}
{{- $syncthingIngress := .Values.syncthing.ingress }}
{{- $syncthingDomain := .Values.syncthing.domain | toString }}
{{- $domain := .Values.syncthing.domain | toString }}
Syncthing is now installed and configured for {{ .Release.Name | toString }}.

Visit the following service to get started:

Syncthing: {{ if and $ingress $syncthingIngress }}https://{{ $syncthingDomain }}{{- else }}Please refer to {{ .Release.Name }}-syncthing-svc for the right address{{- end }}
Syncthing: {{ if $ingress }}https://{{ $domain }}{{- else }}Please refer to {{ .Release.Name }}-syncthing-svc for the right address{{- end }}

For more information on how to use and configure Syncthing, please refer to the official documentation.
2 changes: 1 addition & 1 deletion mika/syncthing/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ imagePullSecrets: []
syncthing:
# The ingress domain name that hosts the Syncthing server.
# Example:
# domain: "chart_name.example.com"
# domain: "syncthing.example.com"
domain: ""
# The group ID used to run the Syncthing containers.
# Default: "1000"
Expand Down
23 changes: 23 additions & 0 deletions mika/uptimekuma/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
19 changes: 19 additions & 0 deletions mika/uptimekuma/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v2
name: uptimekuma
description: Uptime Kuma is an easy-to-use self-hosted monitoring tool.
type: application
version: 0.1.0
appVersion: "1.23.13-alpine"
keywords:
- "uptime"
- "kuma"
- "monitoring"
home: "https://github.com/irfanhakim-as/charts"
icon: "https://irfanhakim-as.github.io/charts/logos/uptimekuma.png"
sources:
- "https://github.com/louislam/uptime-kuma"
- "https://github.com/irfanhakim-as/charts"
maintainers:
- name: "Irfan Hakim"
email: "[email protected]"
url: "https://github.com/irfanhakim-as"
151 changes: 151 additions & 0 deletions mika/uptimekuma/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# [Uptime Kuma](https://github.com/louislam/uptime-kuma)

Uptime Kuma is an easy-to-use self-hosted monitoring tool.

## Prerequisites

> [!NOTE]
> You may refer to [Orked](https://github.com/irfanhakim-as/orked) for help with setting up a Kubernetes cluster that meets all the following prerequisites.
- Kubernetes 1.19+
- Helm 3.2.0+
- Longhorn 1.4.1+

---

## External dependencies

> [!IMPORTANT]
> The following items are required to be set up prior to installing this chart.
**This section does not apply to this chart.**

---

## Recommended configurations

> [!NOTE]
> The following configuration recommendations might not be the default settings for this chart but are **highly recommended**. Please carefully consider them before configuring your installation.
**This section does not apply to this chart.**

---

## Application configurations

> [!NOTE]
> The following configurations are expected or recommended to be set up from within the application after completing the installation.
**This section does not apply to this chart.**

---

## How to add the chart repo

1. Add the repo to your local helm client:

```sh
helm repo add mika https://irfanhakim-as.github.io/charts
```

2. Update the repo to retrieve the latest versions of the packages:

```sh
helm repo update
```

---

## How to install or upgrade a chart release

1. Get the values file of the Uptime Kuma chart or an existing installation (release).

Get the latest Uptime Kuma chart values file for a new installation:

```sh
helm show values mika/uptimekuma > values.yaml
```

Alternatively, get the values file of an existing Uptime Kuma release:

```sh
helm get values ${releaseName} --namespace ${namespace} > values.yaml
```

Replace `${releaseName}` and `${namespace}` accordingly.

2. Edit your Uptime Kuma values file with the intended configurations:

```sh
nano values.yaml
```

Pay extra attention to the descriptions and sample values provided in the chart values file.

3. Install a new release for Uptime Kuma or upgrade an existing Uptime Kuma release:

```sh
helm upgrade --install ${releaseName} mika/uptimekuma --namespace ${namespace} --create-namespace --values values.yaml --wait
```

Replace `${releaseName}` and `${namespace}` accordingly.

4. Verify that your Uptime Kuma release has been installed:

```sh
helm ls --namespace ${namespace} | grep "${releaseName}"
```

Replace `${namespace}` and `${releaseName}` accordingly. This should return the release information if the release has been installed.

---

## How to uninstall a chart release

> [!CAUTION]
> Uninstalling a release will irreversibly delete all the resources associated with the release, including any persistent data.

1. Uninstall the desired release:

```sh
helm uninstall ${releaseName} --namespace ${namespace} --wait
```

Replace `${releaseName}` and `${namespace}` accordingly.

2. Verify that the release has been uninstalled:

```sh
helm ls --namespace ${namespace} | grep "${releaseName}"
```

Replace `${namespace}` and `${releaseName}` accordingly. This should return nothing if the release has been uninstalled.

---

## Chart configurations

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| image.init.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Init container image. Default: `"IfNotPresent"`. |
| image.init.registry | string | `""` | The registry where the Init container image is hosted. Default: `"docker.io"`. |
| image.init.repository | string | `""` | The name of the repository that contains the Init container image used. Default: `"busybox"`. |
| image.init.tag | string | `""` | The tag that specifies the version of the Init container image used. Default: `"1.36.1"`. |
| image.uptimekuma.pullPolicy | string | `""` | The policy that determines when Kubernetes should pull the Uptime Kuma container image. Default: `"IfNotPresent"`. |
| image.uptimekuma.registry | string | `""` | The registry where the Uptime Kuma container image is hosted. Default: `"docker.io"`. |
| image.uptimekuma.repository | string | `""` | The name of the repository that contains the Uptime Kuma container image used. Default: `"louislam/uptime-kuma"`. |
| image.uptimekuma.tag | string | `""` | The tag that specifies the version of the Uptime Kuma container image used. Default: `Chart appVersion`. |
| imagePullSecrets | list | `[]` | Credentials used to securely authenticate and authorise the pulling of container images from private registries. |
| ingress.clusterIssuer | string | `""` | The name of the cluster issuer for Ingress. Default: `"letsencrypt-dns-prod"`. |
| ingress.enabled | bool | `false` | Specifies whether Ingress should be enabled for hosting Uptime Kuma services. |
| replicaCount | string | `""` | The desired number of running replicas for Uptime Kuma. Default: `"1"`. |
| resources.uptimekuma | object | `{}` | Resource requirements and limits for Uptime Kuma containers. |
| service.port | string | `""` | The port on which the Uptime Kuma server should listen. Default: `"3001"`. |
| service.type | string | `""` | The type of service used for Uptime Kuma services. Default: `"ClusterIP"`. |
| storage.data.enabled | bool | `true` | Specifies whether persistent storage should be provisioned for data storage. |
| storage.data.mountPath | string | `""` | The path where the data storage should be mounted on the container. Default: `"/app/data"`. |
| storage.data.storage | string | `""` | The default amount of persistent storage allocated for the data storage. Default: `"1Gi"`. |
| storage.data.storageClassName | string | `""` | The storage class name used for dynamically provisioning a persistent volume for the data storage. Default: `"longhorn"`. |
| storage.data.subPath | string | `""` | The subpath within the data storage to mount to the container. Leave empty if not required. |
| uptimekuma.domain | string | `""` | The ingress domain name that hosts the Uptime Kuma server. |
| uptimekuma.initScript | string | `""` | Custom init script to run before the Uptime Kuma container starts. |
9 changes: 9 additions & 0 deletions mika/uptimekuma/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{- $ingress := .Values.ingress.enabled }}
{{- $domain := .Values.uptimekuma.domain | toString }}
Uptime Kuma is now installed and configured for {{ .Release.Name | toString }}.

Visit the following service to get started:

Uptime Kuma: {{ if $ingress }}https://{{ $domain }}{{- else }}Please refer to {{ .Release.Name }}-uptimekuma-svc for the right address{{- end }}

For more information on how to use and configure Uptime Kuma, please refer to the official documentation.
62 changes: 62 additions & 0 deletions mika/uptimekuma/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "uptimekuma.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "uptimekuma.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "uptimekuma.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "uptimekuma.labels" -}}
helm.sh/chart: {{ include "uptimekuma.chart" . }}
{{ include "uptimekuma.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "uptimekuma.selectorLabels" -}}
app.kubernetes.io/name: {{ include "uptimekuma.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "uptimekuma.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "uptimekuma.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
87 changes: 87 additions & 0 deletions mika/uptimekuma/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{{- $dataPersistence := .Values.storage.data.enabled }}
{{- $uptimekuma_registry := .Values.image.uptimekuma.registry | default "docker.io" | toString }}
{{- $uptimekuma_repository := .Values.image.uptimekuma.repository | default "louislam/uptime-kuma" | toString }}
{{- $uptimekuma_tag := .Values.image.uptimekuma.tag | default .Chart.AppVersion | toString }}
{{- $uptimekuma_pullPolicy := .Values.image.uptimekuma.pullPolicy | default "IfNotPresent" | toString | quote }}
{{- $init_registry := .Values.image.init.registry | default "docker.io" | toString }}
{{- $init_repository := .Values.image.init.repository | default "busybox" | toString }}
{{- $init_tag := .Values.image.init.tag | default "1.36.1" | toString }}
{{- $init_pullPolicy := .Values.image.init.pullPolicy | default "IfNotPresent" | toString | quote }}
{{- $replica_count := .Values.replicaCount | default "1" | toString }}
{{- $dataMountPath := .Values.storage.data.mountPath | default "/app/data" | toString | quote }}
{{- $dataSubPath := .Values.storage.data.subPath | toString }}
{{- $initScript := .Values.uptimekuma.initScript | toString }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-uptimekuma
labels:
{{- include "uptimekuma.labels" . | nindent 4 }}
spec:
replicas: {{ int $replica_count }}
selector:
matchLabels:
{{- include "uptimekuma.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "uptimekuma.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $initScript }}
initContainers:
- name: init
image: {{ printf "%s/%s:%s" $init_registry $init_repository $init_tag | quote }}
imagePullPolicy: {{ $init_pullPolicy }}
command: ["/bin/sh"]
args:
- -c
- >-
{{- $initScript | nindent 14 }}
{{- if or $dataPersistence }}
volumeMounts:
{{- if $dataPersistence }}
- name: {{ .Release.Name }}-uptimekuma-data
mountPath: {{ $dataMountPath }}
{{- if $dataSubPath }}
subPath: {{ $dataSubPath | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
containers:
- name: uptimekuma
image: {{ printf "%s/%s:%s" $uptimekuma_registry $uptimekuma_repository $uptimekuma_tag | quote }}
imagePullPolicy: {{ $uptimekuma_pullPolicy }}
ports:
- name: uptimekuma
containerPort: 3001
protocol: TCP
resources:
{{- toYaml .Values.resources.uptimekuma | nindent 12 }}
{{- if or $dataPersistence }}
volumeMounts:
{{- if $dataPersistence }}
- name: {{ .Release.Name }}-uptimekuma-data
mountPath: {{ $dataMountPath }}
{{- if $dataSubPath }}
subPath: {{ $dataSubPath | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- if or $dataPersistence }}
volumes:
{{- if $dataPersistence }}
- name: {{ .Release.Name }}-uptimekuma-data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-uptimekuma-data-pvc
{{- end }}
{{- end }}
Loading

0 comments on commit 67415ab

Please sign in to comment.