Compare commits

...

29 Commits

Author SHA1 Message Date
a5f23660e7 Merge pull request #344 from 3dwardch3ng/infra/prometheus
use recreate strategy for prometheus
2024-06-26 17:20:37 +10:00
6278918f62 use recreate strategy for prometheus 2024-06-26 17:20:01 +10:00
d4aeacbc88 Merge pull request #343 from 3dwardch3ng/infra/prometheus
use default pod scraping path
2024-06-26 17:16:11 +10:00
a882d2b296 use default pod scraping path 2024-06-26 17:15:50 +10:00
e3f753b2d7 Merge pull request #342 from 3dwardch3ng/infra/prometheus
update ports
2024-06-26 17:10:31 +10:00
4958cbc794 update ports 2024-06-26 17:10:07 +10:00
933f05bbf4 Merge pull request #341 from 3dwardch3ng/infra/prometheus
fix namespaces of ingresses
2024-06-26 16:35:58 +10:00
754997d29f fix namespaces of ingresses 2024-06-26 16:35:26 +10:00
5a5d3272c1 Merge pull request #340 from 3dwardch3ng/infra/prometheus
use ClusterIP and ingress to handle the incoming requests
2024-06-26 16:24:32 +10:00
c7fd259ee4 use ClusterIP and ingress to handle the incoming requests 2024-06-26 16:24:12 +10:00
eaab0b917f Merge pull request #339 from 3dwardch3ng/infra/prometheus
fix resource limits for prometheus and nexus
2024-06-26 16:08:27 +10:00
ada80c434f fix resource limits for prometheus and nexus 2024-06-26 16:08:06 +10:00
afbc7f53b5 Merge pull request #338 from 3dwardch3ng/infra/prometheus
run docker with user root
2024-06-26 15:59:31 +10:00
0619a824e4 run docker with user root 2024-06-26 15:59:03 +10:00
0cab53df67 Merge pull request #337 from 3dwardch3ng/infra/prometheus
Infra/prometheus
2024-06-26 15:39:17 +10:00
d88e17efcd update cpu resource value 2024-06-26 15:38:57 +10:00
c5ecd5986d add versions of the docker images 2024-06-26 15:29:25 +10:00
45393e99e3 Merge pull request #336 from 3dwardch3ng/infra/prometheus
fix config file
2024-06-26 15:03:15 +10:00
64c7d13104 fix config file 2024-06-26 15:02:55 +10:00
0efd5341c8 Merge pull request #335 from 3dwardch3ng/infra/prometheus
update prometheus config and rules mounting method
2024-06-26 14:51:35 +10:00
923263f27e update prometheus config and rules mounting method 2024-06-26 14:51:13 +10:00
c3c7efa2ec Merge pull request #334 from 3dwardch3ng/infra/prometheus
add infra app prometheus
2024-06-26 14:41:38 +10:00
b6f00d0140 add infra app prometheus 2024-06-26 14:35:22 +10:00
9119f221ca Merge pull request #333 from 3dwardch3ng/misc
clean up some unused repos
2024-06-26 13:33:26 +10:00
feffc4a0dd clean up some unused repos 2024-06-26 13:33:08 +10:00
603be0fc8e Merge pull request #332 from 3dwardch3ng/misc
use version 2.18.1 for the uptime-kuma chart
2024-06-26 13:30:42 +10:00
a89b4e1678 use version 2.18.1 for the uptime-kuma chart 2024-06-26 13:29:36 +10:00
f28a8a87bb Merge pull request #331 from 3dwardch3ng/misc
move cert-manager and progresql from apps to infrastructure
2024-06-26 13:00:36 +10:00
e72a6e482e move cert-manager and progresql from apps to infrastructure 2024-06-26 13:00:08 +10:00
32 changed files with 174 additions and 39 deletions

View File

@@ -7,7 +7,6 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
targetNamespace: flux-system
path: ./kubernetes/apps/adguard-home/app
prune: true
sourceRef:

View File

@@ -7,7 +7,6 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
targetNamespace: flux-system
path: ./kubernetes/apps/capacitor/app
prune: true
sourceRef:

View File

@@ -7,7 +7,6 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
targetNamespace: flux-system
path: ./kubernetes/apps/homer/app
prune: true
sourceRef:

View File

@@ -20,7 +20,7 @@ spec:
app.kubernetes.io/instance: kavita
spec:
containers:
- image: jvmilazz0/kavita:latest
- image: jvmilazz0/kavita:0.8.1
imagePullPolicy: IfNotPresent
name: kavita
ports:

View File

@@ -3,7 +3,6 @@ kind: Kustomization
resources:
- ./adguard-home/adguard-home.yaml
- ./capacitor/capacitor.yaml
- ./cert-manager/cert-manager.yaml
- ./code-server/code-server.yaml
- ./dokuwiki/dokuwiki.yaml
- ./gitea/gitea.yaml
@@ -12,7 +11,6 @@ resources:
- ./kavita/kavita.yaml
- ./nexus/nexus.yaml
- ./podinfo/podinfo.yaml
- ./postgresql/postgresql.yaml
- ./qbittorrent/qbittorrent.yaml
- ./redis/redis.yaml
- ./snippet-box/snippet-box.yaml

View File

@@ -22,7 +22,7 @@ spec:
resources:
limits:
memory: "3Gi"
cpu: "500m"
cpu: "1"
requests:
memory: "2Gi"
cpu: "500m"

View File

@@ -7,7 +7,6 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
targetNamespace: flux-system
path: ./kubernetes/apps/snippet-box/app
prune: true
sourceRef:

View File

@@ -9,6 +9,7 @@ spec:
chart:
spec:
chart: uptime-kuma
version: 2.18.1
sourceRef:
kind: HelmRepository
name: irsigler

View File

@@ -7,7 +7,6 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
targetNamespace: flux-system
path: ./kubernetes/apps/weave-gitops/app
prune: true
sourceRef:

View File

@@ -8,12 +8,15 @@ spec:
timeout: 1m30s
retryInterval: 30s
targetNamespace: cert-manager
path: ./kubernetes/apps/cert-manager/app
path: ./kubernetes/infrastructure/cert-manager/app
prune: true
sourceRef:
kind: GitRepository
namespace: flux-system
name: flux-system
dependsOn:
- name: namespaces
namespace: flux-system
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
@@ -32,6 +35,8 @@ spec:
namespace: flux-system
name: home-cluster-ops-secrets
dependsOn:
- name: namespaces
namespace: flux-system
- name: repositories
namespace: flux-system
decryption:
@@ -49,7 +54,7 @@ spec:
timeout: 1m30s
retryInterval: 30s
targetNamespace: cert-manager
path: ./kubernetes/apps/cert-manager/clusterissuer
path: ./kubernetes/infrastructure/cert-manager/clusterissuer
prune: true
sourceRef:
kind: GitRepository
@@ -82,6 +87,8 @@ spec:
namespace: flux-system
name: home-cluster-ops-secrets
dependsOn:
- name: namespaces
namespace: flux-system
- name: repositories
namespace: flux-system
decryption:
@@ -99,7 +106,7 @@ spec:
timeout: 1m30s
retryInterval: 30s
targetNamespace: cert-manager
path: ./kubernetes/apps/cert-manager/certificates
path: ./kubernetes/infrastructure/cert-manager/certificates
prune: true
sourceRef:
kind: GitRepository

View File

@@ -1,9 +1,12 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./cert-manager/cert-manager.yaml
# - ./cilium/cilium.yaml
- ./minio/minio.yaml
- ./ingress-nginx/ingress-nginx.yaml
- ./ingress-nginx/ingress-nginx-config.yaml
- ./namespaces/namespaces.yaml
- ./postgresql/postgresql.yaml
- ./prometheus/prometheus.yaml
- ./repositories/repositories.yaml

View File

@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: prometheus

View File

@@ -15,6 +15,8 @@ spec:
namespace: flux-system
name: home-cluster-ops-secrets
dependsOn:
- name: namespaces
namespace: flux-system
- name: repositories
namespace: flux-system
decryption:
@@ -31,7 +33,7 @@ spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
path: ./kubernetes/apps/postgresql/app
path: ./kubernetes/infrastructure/postgresql/app
prune: true
sourceRef:
kind: GitRepository

View File

@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: prometheus
namespace: prometheus
labels:
app: prometheus
spec:
strategy:
rollingUpdate: null
type: Recreate
selector:
matchLabels:
app: prometheus
template:
metadata:
labels:
app: prometheus
spec:
securityContext:
runAsUser: 0
runAsGroup: 0
containers:
- name: prometheus
image: prom/prometheus:v2.53.0
args:
- "--storage.tsdb.retention.time=12h"
- "--config.file=/etc/prometheus/prometheus.yaml"
- "--storage.tsdb.path=/prometheus/"
ports:
- containerPort: 9090
resources:
requests:
cpu: 500m
memory: 500M
limits:
cpu: "1"
memory: 2Gi
volumeMounts:
- name: prometheus-config-volume
mountPath: /etc/prometheus/
- name: prometheus-storage-volume
mountPath: /prometheus/
volumes:
- name: prometheus-config-volume
hostPath:
path: /mnt/nfs/AppData/prometheus/conf
type: Directory
- name: prometheus-storage-volume
hostPath:
path: /mnt/nfs/AppData/prometheus/storage
type: Directory

View File

@@ -0,0 +1,31 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: prometheus-ingress
namespace: prometheus
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: "prometheus.cluster.edward.sydney"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: prometheus
port:
number: 9999
- host: "prometheus.cluster.local"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: prometheus
port:
number: 9999

View File

@@ -0,0 +1,33 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: prometheus
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- apiGroups:
- extensions
resources:
- ingresses
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: prometheus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: prometheus
subjects:
- kind: ServiceAccount
name: prometheus
namespace: prometheus

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: prometheus
namespace: prometheus
annotations:
prometheus.io/scrape: 'true'
prometheus.io/port: '9999'
spec:
selector:
app: prometheus
type: ClusterIP
ports:
- port: 9999
targetPort: 9090
protocol: TCP
name: http

View File

@@ -0,0 +1,18 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: prometheus
namespace: prometheus
spec:
interval: 10m
timeout: 1m30s
retryInterval: 30s
path: ./kubernetes/infrastructure/prometheus/app
prune: true
sourceRef:
kind: GitRepository
namespace: flux-system
name: flux-system
dependsOn:
- name: namespaces
namespace: flux-system

View File

@@ -1,9 +0,0 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: bjw-s
namespace: flux-system
spec:
interval: 6h
type: oci
url: oci://ghcr.io/bjw-s/helm

View File

@@ -1,8 +0,0 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: external-dns
namespace: flux-system
spec:
interval: 6h
url: https://kubernetes-sigs.github.io/external-dns/

View File

@@ -1,9 +0,0 @@
apiVersion: source.toolkit.fluxcd.io/v1
kind: HelmRepository
metadata:
name: gabe565
namespace: flux-system
spec:
interval: 6h
type: oci
url: oci://ghcr.io/gabe565/charts