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 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: dep-{{ default .Chart.Name .Values.nameOverride }} name: {{ default .Chart.Name .Values.nameOverride }}
namespace: {{ default .Chart.Name .Values.namespaceOverride }} namespace: {{ default .Chart.Name .Values.namespaceOverride }}
labels:
app: {{ default .Chart.Name .Values.nameOverride }}
spec: spec:
replicas: {{ .Values.deployment.spec.replicas }} replicas: {{ .Values.deployment.spec.replicas }}
@ -27,27 +29,9 @@ spec:
ports: ports:
- containerPort: {{ default "3001" .Values.deployment.port }} - containerPort: {{ default "3001" .Values.deployment.port }}
volumeMounts: volumeMounts:
- name: app_data - name: pvc-{{ default .Chart.Name .Values.nameOverride }}
mountPath: /app/data 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: resources:
requests: requests:
memory: "{{ default "256Mi" .Values.deployment.request.memory }}" memory: "{{ default "256Mi" .Values.deployment.request.memory }}"

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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