feat: add elk

This commit is contained in:
JJGadgets
2023-06-11 11:50:19 +08:00
parent 81561b8efd
commit 3fb8625e90
6 changed files with 137 additions and 0 deletions

View File

@@ -0,0 +1,64 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: &app elk
namespace: default
spec:
chart:
spec:
chart: app-template
version: 1.5.1
sourceRef:
name: bjw-s
kind: HelmRepository
namespace: flux-system
values:
global:
fullnameOverride: *app
automountServiceAccountToken: false
controller:
type: deployment
replicas: 1
image:
repository: ghcr.io/elk-zone/elk
tag: v0.9.7@sha256:923ee71ef83026c8c0a5cb82b9c6460455e92d7a27a2af1204f8711150889d70
podLabels:
ingress.home.arpa/nginx: "allow"
env:
TZ: "${CONFIG_TZ}"
service:
main:
ports:
http:
port: 5314
ingress:
main:
enabled: true
primary: true
ingressClassName: nginx
hosts:
- host: &host "elk.${DNS_SHORT}"
paths:
- path: /
pathType: Prefix
tls:
- hosts:
- *host
podSecurityContext:
runAsUser: &uid 911
runAsGroup: *uid
fsGroup: *uid
fsGroupChangePolicy: Always
persistence:
config:
enabled: true
type: pvc
existingClaim: elk-config
mountPath: /elk/data
resources:
requests:
cpu: 10m
memory: 128Mi
limits:
memory: 512Mi

View File

@@ -0,0 +1,17 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elk-config
namespace: default
labels:
app.kubernetes.io/name: &app elk
app.kubernetes.io/instance: *app
snapshot.home.arpa/enabled: "true"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 1Gi
storageClassName: file

View File

@@ -0,0 +1,36 @@
---
apiVersion: v1
kind: Secret
metadata:
name: elk-restic
namespace: default
type: Opaque
stringData:
RESTIC_REPOSITORY: ${SECRET_VOLSYNC_R2_REPO}/elk
RESTIC_PASSWORD: ${SECRET_VOLSYNC_PASSWORD}
AWS_ACCESS_KEY_ID: ${SECRET_VOLSYNC_R2_ID}
AWS_SECRET_ACCESS_KEY: ${SECRET_VOLSYNC_R2_KEY}
---
apiVersion: volsync.backube/v1alpha1
kind: ReplicationSource
metadata:
name: elk-restic
namespace: default
spec:
sourcePVC: elk-config
trigger:
schedule: "0 6 * * *"
restic:
copyMethod: Snapshot
pruneIntervalDays: 14
repository: elk-restic
cacheCapacity: 1Gi
volumeSnapshotClassName: file
storageClassName: file
moverSecurityContext:
runAsUser: &uid 911
runAsGroup: *uid
fsGroup: *uid
retain:
daily: 14
within: 7d

View File

@@ -0,0 +1,14 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: elk-app
namespace: flux-system
labels:
wait.flux.home.arpa/disabled: "true"
spec:
path: ./kube/3-deploy/2-apps/elk/app
dependsOn:
- name: ${CLUSTER_NAME_LOWER}-1-core-02-storage-rook-ceph
- name: ${CLUSTER_NAME_LOWER}-1-core-05-ingress-nginx
- name: ${CLUSTER_NAME_LOWER}-2-apps-volsync

View File

@@ -0,0 +1,5 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ks.yaml

View File

@@ -9,6 +9,7 @@ resources:
# - flux-repo.yaml
- ../../../3-deploy/2-apps/atuin/
- ../../../3-deploy/2-apps/miniflux/
- ../../../3-deploy/2-apps/elk/
# - ceph-rgw-ext-users.yaml
# - ../../../3-deploy/1-core/05-ingress/cloudflare/
# - ../../../3-deploy/1-core/05-ingress/external-proxy-x/