Skip to content

Commit

Permalink
feat(kubernetes): deploy kromgo
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Dec 15, 2023
1 parent 968dae5 commit 4582f80
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kubernetes/apps/default/kromgo/app/configs/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
metrics:
- name: node_cpu_usage
query: round(cluster:node_cpu:ratio_rate5m * 100, 0.1)
suffix: "%"
colors:
- { color: "green", min: 0, max: 35 }
- { color: "orange", min: 36, max: 75 }
- { color: "red", min: 76, max: 1000 }
95 changes: 95 additions & 0 deletions kubernetes/apps/default/kromgo/app/helmrelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &app kromgo
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 2.4.0
sourceRef:
kind: HelmRepository
name: bjw-s-charts
namespace: flux-system
maxHistory: 2
install:
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
controllers:
main:
replicas: 2
strategy: RollingUpdate
annotations:
reloader.stakater.com/auto: "true"
containers:
main:
image:
repository: ghcr.io/kashalls/kromgo
tag: 0.2.0@sha256:1e887453f6d15f90fa9c1ed75e7b6a3f590e30030eb364b9ed2dd02b807d55c0
env:
PROMETHEUS_URL: http://thanos-query-frontend.monitoring.svc.cluster.local:9090
PORT: &port 80
resources:
requests:
cpu: 5m
memory: 10M
limits:
memory: 64M
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
pod:
securityContext:
runAsUser: 568
runAsGroup: 568
runAsNonRoot: true
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
app.kubernetes.io/name: *app
ingress:
main:
enabled: true
className: external
annotations:
gatus.io/enabled: "true"
hajimari.io/enable: "false"
external-dns.alpha.kubernetes.io/target: external.${PUBLIC_DOMAIN}
hosts:
- host: &host "{{ .Release.Name }}.${PUBLIC_DOMAIN}"
paths:
- path: /
service:
name: main
port: http
tls:
- hosts:
- *host
persistence:
config-file:
type: configMap
name: kromgo-configmap
globalMounts:
- path: /config/config.yaml
subPath: config.yaml
readOnly: true
service:
main:
ports:
http:
port: *port
13 changes: 13 additions & 0 deletions kubernetes/apps/default/kromgo/app/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./helmrelease.yaml
configMapGenerator:
- name: kromgo-configmap
files:
- ./configs/config.yaml
generatorOptions:
disableNameSuffixHash: true
annotations:
kustomize.toolkit.fluxcd.io/substitute: disabled
17 changes: 17 additions & 0 deletions kubernetes/apps/default/kromgo/ks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: cluster-apps-kromgo
namespace: flux-system
spec:
targetNamespace: default
path: ./kubernetes/apps/default/kromgo/app
prune: true
sourceRef:
kind: GitRepository
name: k8s-gitops
wait: true
interval: 30m
retryInterval: 1m
timeout: 5m
1 change: 1 addition & 0 deletions kubernetes/apps/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./namespace.yaml
- ./kromgo/ks.yaml
- ./libreddit/ks.yaml
- ./nostr-relay/ks.yaml

0 comments on commit 4582f80

Please sign in to comment.