feat : uptime-kuma helm chart

This commit is contained in:
unchaptered 2024-11-08 15:38:11 +09:00
parent 0dcaf787cb
commit 08ad6aefb4
8 changed files with 163 additions and 142 deletions

View file

@ -0,0 +1,69 @@
# Uptime Kuma
Uptime Kuma is an easy-to-use self-hosted monitoring tool.
Homepage : https://uptime.kuma.pet/
### Source Code
- https://github.com/louislam/uptime-kuma
### TL:DR
```shell
helm install uptime-kuma uptime-kuma -n uptime-kuma \
--values values-test.yaml \
--set persistVolume.csi.handle=<your-efs-id> \
--set ingress.host=<your-host-name> \
--set ingress.metadata.annotations.alb\.ingress\.kubernetes\.io/vpc-id=<vpc-id>
```
> In [Installation & Configuration](https://github.com/louislam/uptime-kuma/wiki/%F0%9F%94%A7-How-to-Install), uptime-kuma officially recommend volume mapping to `/app/data`. <br>
> So I used the PersistVolume(e.g. efs), PersistVolumeCliam to maintain persistance data. <br>
### Requirements
I used these helm chart with Amazon EKS 1.30.
> HOWEVER, I don't use any special features that are only available in certain versions, <br>
> so I guess it would be campatiable Amazon EKS 1.30, and more.
| Requirements | Name | Version | Ref |
| ---------------------------------------------------- | ---------------------------- | ------- | --------------------------------------------------------------- |
| https://aws.github.io/eks-charts | aws-load-balancer-controller | 1.8.1 | https://github.com/kubernetes-sigs/aws-load-balancer-controller |
| https://kubernetes-sigs.github.io/aws-efs-csi-driver | aws-efs-csi-driver | 3.0.4 | https://github.com/kubernetes-sigs/aws-efs-csi-driver |
### Values
| Key | Type | Default |
| ------------------------------------------- | ------ | ------------------------ |
| nameOverride | string | `nil` |
| namespaceOverride | string | `nil` |
| isEnableService | bool | `false` |
| isEnableIngress | bool | `false` |
| isEnablePersistVolume | bool | `false` |
| deployment.image | string | `louislam/uptime-kuma:1` |
| deployment.port | int | `3001` |
| deployment.spec.replicas | int | `1` |
| deployment.request.cpu | string | `256Mi` |
| deployment.request.memory | string | `150m` |
| service.metadata.labels | object | `{}` |
| service.metadata.annotations | object | `{}` |
| service.spec.type | string | `NodePort` |
| service.spec.sessionAffinity | string | `nil` |
| service.spec.selectors | object | `{}` |
| service.spec.externalTrafficPolicy | string | `nil` |
| service.spec.externalIPs | list | `[]` |
| ingress.host | string | `example.com` |
| ingress.ingressClassName | string | `alb` |
| ingress.metadata.labels | object | `{}` |
| ingress.metadata.annotations | object | `{}` |
| ingress.spec.selector | object | `{}` |
| persistVolume.size | string | `1Gi` |
| persistVolume.volumemode | string | `FileSystem` |
| persistVolume.accessmode | string | `ReadWriteMany` |
| persistVolume.persistentVolumeReclaimPolicy | string | `Retain` |
| persistVolume.storageClass | string | `efs-sc` |
| persistVolume.csi.driver | string | `efs.csi.aws.com` |
| persistVolume.csi.handle | string | `nil` |

View file

@ -1,8 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: dep-{{ default .Chart.Name .Values.nameOverride }}
name: {{ default .Chart.Name .Values.nameOverride }}
namespace: {{ default .Chart.Name .Values.namespaceOverride }}
labels:
app: {{ default .Chart.Name .Values.nameOverride }}
spec:
replicas: {{ .Values.deployment.spec.replicas }}
@ -27,27 +29,9 @@ spec:
ports:
- containerPort: {{ default "3001" .Values.deployment.port }}
volumeMounts:
- name: app_data
- name: pvc-{{ default .Chart.Name .Values.nameOverride }}
mountPath: /app/data
readinessProbe: # Pod Container, 연결성 테스트 (트래픽 라우트 조건)
tcpSocket:
port: {{ default "3001" .Values.deployment.port }}
initialDelaySeconds: {{ default 60 .Values.deployment.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ default 60 .Values.deployment.readinessProbe.periodSeconds }}
livenessProbe: # Pod Container, 연결성 테스트 (재시작 조건)
httpGet:
path: {{ default "/" .Values.deployment.livenessProbe.path }}
port: {{ default "3001" .Values.deployment.port }}
initialDelaySeconds: {{ default 60 .Values.deployment.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ default 60 .Values.deployment.livenessProbe.periodSeconds }}
startupProbe: # Pod 실행 전, 연결성 테스트
httpGet:
path: {{ default "/" .Values.deployment.startupProbe.path }}
port: {{ default "3001" .Values.deployment.port }}
initialDelaySeconds: {{ default 60 .Values.deployment.startupProbe.initialDelaySeconds }}
periodSeconds: {{ default 60 .Values.deployment.startupProbe.periodSeconds }}
resources:
requests:
memory: "{{ default "256Mi" .Values.deployment.request.memory }}"

View file

@ -37,7 +37,7 @@ spec:
pathType: Prefix
backend:
service:
name: carrieverse-abc-cms-api-dev
name: svc-{{ default .Chart.Name .Values.nameOverride }}
port:
number: 80
serviceName: svc-{{ default .Chart.Name .Values.nameOverride }}

View file

@ -8,8 +8,9 @@ spec:
capacity:
storage: {{ .Values.persistVolume.size }}
volumeMode: {{ .Values.persistVolume.volumemode }}
accessModes: {{ .Values.persistVolume.accessmode }}
persistentVolumeReclaimPolicy: {{ .Values.persistVolume.persistentvolumereclaimpolicy }}
accessModes:
- {{ .Values.persistVolume.accessmode }}
persistentVolumeReclaimPolicy: {{ .Values.persistVolume.persistentVolumeReclaimPolicy }}
storageClassName: {{ .Values.persistVolume.storageClass }}
csi:
driver: {{ .Values.persistVolume.csi.driver }}

View file

@ -7,7 +7,8 @@ metadata:
annotations:
volume.beta.kubernetes.io/storage-class: {{ .Values.persistVolume.storageClass }}
spec:
accessModes: {{ .Values.persistVolume.accessmode }}
accessModes:
- {{ .Values.persistVolume.accessmode }}
storageClassName: {{ .Values.persistVolume.storageClass }}
resources:
requests:

View file

@ -5,8 +5,9 @@ metadata:
name: svc-{{ default .Chart.Name .Values.nameOverride }}
namespace: {{ default .Chart.Name .Values.namespaceOverride }}
{{- with .Values.service.metadata.labels}}
labels:
app: {{ default .Chart.Name .Values.nameOverride }}
{{- with .Values.service.metadata.labels}}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end}}
@ -20,8 +21,8 @@ metadata:
{{- end }}
spec:
annotations:
app: dep-{{ default .Chart.Name .Values.nameOverride }}
selector:
app: {{ default .Chart.Name .Values.nameOverride }}
{{- with .Values.service.spec.selector }}
{{- range $key, $value := .}}
{{ $key }}: {{ $value | quote }}

View file

@ -1,21 +1,10 @@
nameOverride:
namespaceOverride:
# serviceAccountName: ~
# serviceAccount:
# create: false
# annotations: {}
isEnableConfigmap: false
isEnableIngress: true
isEnableService: true
isEnableIngress: true
isEnablePersistVolume: true
configmap:
dataMap:
SAMPLE_KEY_1: SAMPLE_VALUE_1
SAMPLE_KEY_2: 1
deployment:
image: louislam/uptime-kuma:1
port: 3001
@ -27,18 +16,6 @@ deployment:
cpu: ~
memory: ~
readinessProbe:
initialDelaySeconds: ~
periodSeconds: ~
livenessProbe:
path: /
initialDelaySeconds: ~
periodSeconds: ~
startupProbe:
path: /
initialDelaySeconds: ~
periodSeconds: ~
service:
metadata:
labels: ~
@ -51,22 +28,22 @@ service:
externalTrafficPolicy: ~
externalIPs: ~
# <vpc-id>, <lb-name>, <arn-id>
# <vpc-id>, lb_name, <arn-id>
ingress:
host: example.com
host: host_name
ingressClassName: alb
metadata:
labels: ~
annotations:
alb.ingress.kubernetes.io/vpc-id: <vpc-id>
alb.ingress.kubernetes.io/vpc-id: "VPC_ID"
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]'
alb.ingress.kubernetes.io/load-balancer-name: <lb-name>
alb.ingress.kubernetes.io/tags: Name=<lb-name>
alb.ingress.kubernetes.io/load-balancer-name: lb_name
alb.ingress.kubernetes.io/tags: Name=lb_name
alb.ingress.kubernetes.io/certificate-arn: <arn-id>
# alb.ingress.kubernetes.io/certificate-arn: <arn-id>
alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-2016-08
kubernetes.io/ingress.class: alb
@ -99,7 +76,7 @@ ingress:
"forwardConfig": {
"targetGroups": [
{
"serviceName": "<lb-name>",
"serviceName": "lb_name",
"servicePort": 80,
"weight": 100
}
@ -110,13 +87,13 @@ ingress:
}
}
alb.ingress.kubernetes.io/actions.<lb-name>: |
alb.ingress.kubernetes.io/actions.lb_name: |
{
"type": "forward",
"forwardConfig": {
"targetGroups": [
{
"serviceName": "<lb-name>",
"serviceName": "lb_name",
"servicePort": 80,
"weight": 100
}
@ -132,11 +109,11 @@ ingress:
persistVolume:
size: 1Gi
volumemode: FileSystem
size: 5Gi
volumemode: Filesystem
accessmode: ReadWriteMany
persistentvolumereclaimpolicy: Retain
persistentVolumeReclaimPolicy: Retain
storageClass: efs-sc
csi:
driver: efs.csi.aws.com
handle: ~
handle: fs_name

View file

@ -1,8 +1,8 @@
nameOverride:
namespaceOverride:
isEnableIngress: false
isEnableService: false
isEnableIngress: false
isEnablePersistVolume: false
deployment:
@ -16,18 +16,6 @@ deployment:
cpu: ~
memory: ~
readinessProbe:
initialDelaySeconds: ~
periodSeconds: ~
livenessProbe:
path: /
initialDelaySeconds: ~
periodSeconds: ~
startupProbe:
path: /
initialDelaySeconds: ~
periodSeconds: ~
service:
metadata:
labels: ~
@ -40,81 +28,81 @@ service:
externalTrafficPolicy: ~
externalIPs: ~
# <vpc-id>, <lb-name>, <arn-id>
# vpc_id, lb_name, arn_id
ingress:
host: example.com
ingressClassName: alb
metadata:
labels: ~
annotations:
alb.ingress.kubernetes.io/vpc-id: <vpc-id>
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/target-type: ip
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]'
alb.ingress.kubernetes.io/load-balancer-name: <lb-name>
alb.ingress.kubernetes.io/tags: Name=<lb-name>
annotations: ~
# alb.ingress.kubernetes.io/vpc-id: vpc_id
# alb.ingress.kubernetes.io/scheme: internet-facing
# alb.ingress.kubernetes.io/target-type: ip
# alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]'
# alb.ingress.kubernetes.io/load-balancer-name: lb_name
# alb.ingress.kubernetes.io/tags: Name=lb_name
alb.ingress.kubernetes.io/certificate-arn: <arn-id>
alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-2016-08
# # alb.ingress.kubernetes.io/certificate-arn: arn_id
# alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-2016-08
kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
alb.ingress.kubernetes.io/healthcheck-port: traffic-port
# kubernetes.io/ingress.class: alb
# alb.ingress.kubernetes.io/healthcheck-protocol: HTTP
# alb.ingress.kubernetes.io/healthcheck-port: traffic-port
alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15'
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5'
alb.ingress.kubernetes.io/success-codes: '200'
alb.ingress.kubernetes.io/healthy-threshold-count: '2'
alb.ingress.kubernetes.io/unhealthy-threshold-count: '2'
# alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15'
# alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5'
# alb.ingress.kubernetes.io/success-codes: '200'
# alb.ingress.kubernetes.io/healthy-threshold-count: '2'
# alb.ingress.kubernetes.io/unhealthy-threshold-count: '2'
alb.ingress.kubernetes.io/backend-protocol: HTTP
alb.ingress.kubernetes.io/target-type: instance
alb.ingress.kubernetes.io/ip-address-type: ipv4
alb.ingress.kubernetes.io/ssl-redirect: '443'
alb.ingress.kubernetes.io/actions.ssl-redirect: |
{
"Type": "redirect",
"RedirectConfig": {
"Protocol": "HTTPS",
"Port": "443",
"StatusCode": "HTTP_301"
}}
}
alb.ingress.kubernetes.io/actions.default: |
{
"type": "forward",
"forwardConfig": {
"targetGroups": [
{
"serviceName": "<lb-name>",
"servicePort": 80,
"weight": 100
}
],
"targetGroupStickinessConfig": {
"enabled": false
}
}
}
# alb.ingress.kubernetes.io/backend-protocol: HTTP
# alb.ingress.kubernetes.io/target-type: instance
# alb.ingress.kubernetes.io/ip-address-type: ipv4
# alb.ingress.kubernetes.io/ssl-redirect: '443'
# alb.ingress.kubernetes.io/actions.ssl-redirect: |
# {
# "Type": "redirect",
# "RedirectConfig": {
# "Protocol": "HTTPS",
# "Port": "443",
# "StatusCode": "HTTP_301"
# }}
# }
# alb.ingress.kubernetes.io/actions.default: |
# {
# "type": "forward",
# "forwardConfig": {
# "targetGroups": [
# {
# "serviceName": "lb_name",
# "servicePort": 80,
# "weight": 100
# }
# ],
# "targetGroupStickinessConfig": {
# "enabled": false
# }
# }
# }
alb.ingress.kubernetes.io/actions.<lb-name>: |
{
"type": "forward",
"forwardConfig": {
"targetGroups": [
{
"serviceName": "<lb-name>",
"servicePort": 80,
"weight": 100
}
],
"targetGroupStickinessConfig": {
"enabled": false
}
}
}
# alb.ingress.kubernetes.io/actions.lb_name: |
# {
# "type": "forward",
# "forwardConfig": {
# "targetGroups": [
# {
# "serviceName": "lb_name",
# "servicePort": 80,
# "weight": 100
# }
# ],
# "targetGroupStickinessConfig": {
# "enabled": false
# }
# }
# }
spec:
selector: ~
@ -124,7 +112,7 @@ persistVolume:
size: 1Gi
volumemode: FileSystem
accessmode: ReadWriteMany
persistentvolumereclaimpolicy: Retain
persistentVolumeReclaimPolicy: Retain
storageClass: efs-sc
csi:
driver: efs.csi.aws.com