Compare commits
84 Commits
9aff02ea24
...
11538db808
| Author | SHA1 | Date | |
|---|---|---|---|
| 11538db808 | |||
| 8f00abdf28 | |||
| d8fe8796c2 | |||
| d5a097793f | |||
| 529a73d932 | |||
| 262bc9b810 | |||
| d077a2945e | |||
| 1d75289cfe | |||
| 11050a71b2 | |||
| 9da194cb69 | |||
| 0e007eed23 | |||
| 975ea5b9d2 | |||
| e2cc315694 | |||
| 5107c79885 | |||
| ffcc046e38 | |||
| 89f75af049 | |||
| 9784fa10c4 | |||
| ab52e540b5 | |||
| 6f35053842 | |||
| 6ae9a99b8a | |||
| 25793b75f1 | |||
| 2904ec7aca | |||
| 8fd615eb68 | |||
| 515998e708 | |||
| 89d529def1 | |||
| 703933a222 | |||
| 0a97af35a0 | |||
| a7716a912c | |||
| 4b5a5f9885 | |||
| 033c3a2694 | |||
| 196023b1fa | |||
| 35cdd062df | |||
| 4941c7bb15 | |||
| 85a4e06740 | |||
| 93adac3a24 | |||
| 3f736dd3b2 | |||
| 0af30526ba | |||
| 8090c382fd | |||
| 76a11c16eb | |||
| a118ca9102 | |||
| c90c2015d7 | |||
| 20ca563537 | |||
| 107dba9bf8 | |||
| 7bfa2d54a4 | |||
| 18e8bb4db8 | |||
| c8dd48b104 | |||
| 04c1de1467 | |||
| 17f2acedbf | |||
| e1dce09027 | |||
| 66c17604c6 | |||
| 187403470a | |||
| 8f9b299c46 | |||
| c17d3d77d2 | |||
| 731ac3d7d5 | |||
| 2ccc680abc | |||
| ad73ae43a1 | |||
| 2c6c85df47 | |||
| 6a5d02b21b | |||
| b96697689e | |||
| a7b26bbe6f | |||
| 0b74f8f246 | |||
| 8ba289e248 | |||
| 386591401b | |||
| 34730f5407 | |||
| 0799662bd7 | |||
| 137225aae2 | |||
| dbbb78b2b1 | |||
| f2b5a734d6 | |||
| 0599402bdf | |||
| 1872b234b8 | |||
| 3fcba505ed | |||
| ba81692477 | |||
| d77ca493bc | |||
| b9e041e09a | |||
| 668a62585e | |||
| 53cb75335e | |||
| 3736bdc92a | |||
| b64ed0bef5 | |||
| c210ee222f | |||
| 224b310b71 | |||
| cbb1e367af | |||
| fbc2b73f49 | |||
| 1ef3600b56 | |||
| 84902910cc |
@@ -25,12 +25,14 @@ spec:
|
|||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
volumeName: jellyfin-config
|
volumeName: jellyfin-config
|
||||||
|
storageClassName: local-path
|
||||||
data:
|
data:
|
||||||
enabled: true
|
enabled: true
|
||||||
volumeClaimSpec:
|
volumeClaimSpec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteOnce
|
- ReadWriteOnce
|
||||||
volumeName: jellyfin-data
|
volumeName: jellyfin-data
|
||||||
|
storageClassName: local-path
|
||||||
jellyfin:
|
jellyfin:
|
||||||
mediaVolumes:
|
mediaVolumes:
|
||||||
- name: movies
|
- name: movies
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ resources:
|
|||||||
- ./nexus/nexus.yaml
|
- ./nexus/nexus.yaml
|
||||||
- ./podinfo/podinfo.yaml
|
- ./podinfo/podinfo.yaml
|
||||||
- ./qbittorrent/qbittorrent.yaml
|
- ./qbittorrent/qbittorrent.yaml
|
||||||
- ./redis/redis.yaml
|
|
||||||
- ./snippet-box/snippet-box.yaml
|
- ./snippet-box/snippet-box.yaml
|
||||||
- ./sonarqube/sonarqube.yaml
|
- ./sonarqube/sonarqube.yaml
|
||||||
- ./uptime-kuma/uptime-kuma.yaml
|
- ./uptime-kuma/uptime-kuma.yaml
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: redis-master-pvc
|
|
||||||
namespace: redis
|
|
||||||
labels:
|
|
||||||
name: redis-master-pvc
|
|
||||||
spec:
|
|
||||||
storageClassName: local-path
|
|
||||||
volumeMode: Filesystem
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 8Gi
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: PersistentVolumeClaim
|
|
||||||
metadata:
|
|
||||||
name: redis-replica-pvc
|
|
||||||
namespace: redis
|
|
||||||
labels:
|
|
||||||
name: redis-replica-pvc
|
|
||||||
spec:
|
|
||||||
storageClassName: local-path
|
|
||||||
volumeMode: Filesystem
|
|
||||||
accessModes:
|
|
||||||
- ReadWriteOnce
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: 8Gi
|
|
||||||
@@ -34,7 +34,7 @@ spec:
|
|||||||
elastic: 30091
|
elastic: 30091
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
storageClass: "local-path"
|
storageClass: local-path
|
||||||
size: "32Gi"
|
size: "32Gi"
|
||||||
existingClaim: "sonarqube-pvc"
|
existingClaim: "sonarqube-pvc"
|
||||||
postgresql:
|
postgresql:
|
||||||
|
|||||||
16
kubernetes/infrastructure/consul/app/service.yaml
Normal file
16
kubernetes/infrastructure/consul/app/service.yaml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
protocol: TCP
|
||||||
|
port: 8500
|
||||||
|
targetPort: 8500
|
||||||
|
selector:
|
||||||
|
app: consul
|
||||||
|
type: ClusterIP
|
||||||
46
kubernetes/infrastructure/consul/app/statefulset.yaml
Normal file
46
kubernetes/infrastructure/consul/app/statefulset.yaml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: consul
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: consul
|
||||||
|
image: 'consul:1.15.4'
|
||||||
|
args:
|
||||||
|
- agent
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8500
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Australia/Sydney
|
||||||
|
volumeMounts:
|
||||||
|
- name: consul-data
|
||||||
|
mountPath: /consul/data
|
||||||
|
- name: consul-config
|
||||||
|
mountPath: /consul/config
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
volumes:
|
||||||
|
- name: consul-data
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/consul/data
|
||||||
|
type: Directory
|
||||||
|
- name: consul-config
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/consul/config
|
||||||
|
type: Directory
|
||||||
|
restartPolicy: Always
|
||||||
|
serviceName: consul
|
||||||
18
kubernetes/infrastructure/consul/consul.yaml
Normal file
18
kubernetes/infrastructure/consul/consul.yaml
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
|
namespace: consul
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
path: ./kubernetes/infrastructure/consul/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: flux-system
|
||||||
|
dependsOn:
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: flask-consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: flask-consul
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: flask-consul
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: flask-consul
|
||||||
|
spec:
|
||||||
|
initContainers:
|
||||||
|
- name: wait-for-consul
|
||||||
|
image: busybox
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- '-c'
|
||||||
|
- >-
|
||||||
|
for i in \$(seq 1 60); do nc -z -w3 consul 8500 && exit 0 ||
|
||||||
|
sleep 5; done; exit 1
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
containers:
|
||||||
|
- name: flask-consul
|
||||||
|
image: 'edeedeeed/flask_consul:v0.1.0'
|
||||||
|
ports:
|
||||||
|
- name: http-2026
|
||||||
|
containerPort: 2026
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: admin_passwd
|
||||||
|
value: ${dashboard_8919_admin_passwd}
|
||||||
|
- name: consul_token
|
||||||
|
value: ${dashboard_8919_consul_token}
|
||||||
|
- name: consul_url
|
||||||
|
value: 'http://consul:8500/v1'
|
||||||
|
- name: log_level
|
||||||
|
value: INFO
|
||||||
|
- name: TZ
|
||||||
|
value: Australia/Sydney
|
||||||
|
imagePullPolicy: Always
|
||||||
|
restartPolicy: Always
|
||||||
|
---
|
||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: flask-consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: flask-consul
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: http-2026
|
||||||
|
protocol: TCP
|
||||||
|
port: 2026
|
||||||
|
targetPort: 2026
|
||||||
|
selector:
|
||||||
|
app: flask-consul
|
||||||
|
type: ClusterIP
|
||||||
|
---
|
||||||
|
kind: Deployment
|
||||||
|
apiVersion: apps/v1
|
||||||
|
metadata:
|
||||||
|
name: nginx-consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: nginx-consul
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: nginx-consul
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: nginx-consul
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: nginx-consul
|
||||||
|
image: 'nicholasjackson/nginx-consul:v0.1.0'
|
||||||
|
ports:
|
||||||
|
- name: http-1026
|
||||||
|
containerPort: 1026
|
||||||
|
protocol: TCP
|
||||||
|
env:
|
||||||
|
- name: TZ
|
||||||
|
value: Australia/Sydney
|
||||||
|
imagePullPolicy: Always
|
||||||
|
restartPolicy: Always
|
||||||
|
---
|
||||||
|
kind: Service
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: nginx-consul
|
||||||
|
namespace: consul
|
||||||
|
labels:
|
||||||
|
app: consul
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: nginx-consul
|
||||||
|
protocol: TCP
|
||||||
|
port: 1026
|
||||||
|
targetPort: 1026
|
||||||
|
nodePort: 31026
|
||||||
|
selector:
|
||||||
|
app: nginx-consul
|
||||||
|
type: NodePort
|
||||||
|
externalTrafficPolicy: Cluster
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: grafana-dashboards-secrets
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
targetNamespace: prometheus
|
||||||
|
path: ./grafana-dashboards
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: home-cluster-ops-secrets
|
||||||
|
dependsOn:
|
||||||
|
- name: repositories
|
||||||
|
namespace: flux-system
|
||||||
|
decryption:
|
||||||
|
provider: sops
|
||||||
|
secretRef:
|
||||||
|
name: sops-age
|
||||||
|
---
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: grafana-dashboards
|
||||||
|
namespace: prometheus
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
path: ./kubernetes/infrastructure/grafana-dashboards/dashboards
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: flux-system
|
||||||
|
dependsOn:
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
|
- name: grafana-dashboards-secrets
|
||||||
|
namespace: flux-system
|
||||||
|
postBuild:
|
||||||
|
substituteFrom:
|
||||||
|
- kind: Secret
|
||||||
|
name: grafana-dashboards-secrets
|
||||||
@@ -3,11 +3,16 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- ./cert-manager/cert-manager.yaml
|
- ./cert-manager/cert-manager.yaml
|
||||||
# - ./cilium/cilium.yaml
|
# - ./cilium/cilium.yaml
|
||||||
- ./minio/minio.yaml
|
- ./consul/consul.yaml
|
||||||
|
- ./grafana-dashboards/grafana-dashboards.yaml
|
||||||
- ./ingress-nginx/ingress-nginx.yaml
|
- ./ingress-nginx/ingress-nginx.yaml
|
||||||
- ./ingress-nginx/ingress-nginx-config.yaml
|
- ./ingress-nginx/ingress-nginx-config.yaml
|
||||||
|
- ./local-path-provisioner/local-path-provisioner.yaml
|
||||||
|
- ./minio/minio.yaml
|
||||||
- ./namespaces/namespaces.yaml
|
- ./namespaces/namespaces.yaml
|
||||||
- ./postgresql/postgresql.yaml
|
- ./postgresql/postgresql.yaml
|
||||||
- ./prometheus/prometheus.yaml
|
- ./prometheus/prometheus.yaml
|
||||||
- ./prometheus-alertmanager/prometheus-alertmanager.yaml
|
- ./prometheus-alertmanager/prometheus-alertmanager.yaml
|
||||||
|
- ./prometheus-exporters/prometheus-exporters.yaml
|
||||||
|
- ./redis/redis.yaml
|
||||||
- ./repositories/repositories.yaml
|
- ./repositories/repositories.yaml
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner
|
||||||
|
namespace: local-path-storage
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
driftDetection:
|
||||||
|
mode: enabled
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: local-path-provisioner
|
||||||
|
version: master-head
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: local-path-provisioner
|
||||||
|
interval: 24h
|
||||||
|
values:
|
||||||
|
storageClass:
|
||||||
|
reclaimPolicy: Retain
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/source.toolkit.fluxcd.io/gitrepository_v1.json
|
||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner
|
||||||
|
namespace: local-path-storage
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
path: ./kubernetes/infrastructure/local-path-provisioner/app
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: flux-system
|
||||||
|
dependsOn:
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
@@ -42,6 +42,8 @@ spec:
|
|||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
- name: minio-secrets
|
- name: minio-secrets
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
|
- name: local-path-provisioner
|
||||||
|
namespace: local-path-storage
|
||||||
postBuild:
|
postBuild:
|
||||||
substituteFrom:
|
substituteFrom:
|
||||||
- kind: Secret
|
- kind: Secret
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: consul
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: local-path-storage
|
||||||
@@ -42,6 +42,10 @@ spec:
|
|||||||
dependsOn:
|
dependsOn:
|
||||||
- name: postgresql-secrets
|
- name: postgresql-secrets
|
||||||
namespace: flux-system
|
namespace: flux-system
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
|
- name: local-path-provisioner
|
||||||
|
namespace: local-path-storage
|
||||||
postBuild:
|
postBuild:
|
||||||
substituteFrom:
|
substituteFrom:
|
||||||
- kind: Secret
|
- kind: Secret
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ spec:
|
|||||||
runAsGroup: 0
|
runAsGroup: 0
|
||||||
containers:
|
containers:
|
||||||
- name: prometheus-alertmanager
|
- name: prometheus-alertmanager
|
||||||
image: prom/prometheus-alertmanager:v0.27.0
|
image: prom/alertmanager:v0.27.0
|
||||||
args:
|
args:
|
||||||
- "--config.file=/etc/prometheus/prometheus-alertmanager.yaml"
|
- "--config.file=/etc/prometheus/prometheus-alertmanager.yaml"
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: kubernetes-event-exporter
|
||||||
|
namespace: prometheus
|
||||||
|
spec:
|
||||||
|
releaseName: kubernetes-event-exporter
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: kubernetes-event-exporter
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: bitnami
|
||||||
|
interval: 60m
|
||||||
|
values:
|
||||||
|
config:
|
||||||
|
receivers:
|
||||||
|
- name: "dump"
|
||||||
|
file:
|
||||||
|
layout:
|
||||||
|
message: "{{ .Message }}"
|
||||||
|
reason: "{{ .Reason }}"
|
||||||
|
type: "{{ .Type }}"
|
||||||
|
count: "{{ .Count }}"
|
||||||
|
kind: "{{ .InvolvedObject.Kind }}"
|
||||||
|
name: "{{ .InvolvedObject.Name }}"
|
||||||
|
namespace: "{{ .Namespace }}"
|
||||||
|
component: "{{ .Source.Component }}"
|
||||||
|
host: "{{ .Source.Host }}"
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: prometheus-node-exporter
|
||||||
|
namespace: prometheus
|
||||||
|
labels:
|
||||||
|
app: prometheus-node-exporter
|
||||||
|
spec:
|
||||||
|
replicas: 3
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: prometheus-node-exporter
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: prometheus-node-exporter
|
||||||
|
spec:
|
||||||
|
hostNetwork: true
|
||||||
|
hostPID: true
|
||||||
|
hostIPC: true
|
||||||
|
topologySpreadConstraints:
|
||||||
|
- maxSkew: 1
|
||||||
|
topologyKey: kubernetes.io/hostname
|
||||||
|
whenUnsatisfiable: DoNotSchedule
|
||||||
|
labelSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: prometheus-node-exporter
|
||||||
|
containers:
|
||||||
|
- name: prometheus-node-exporter
|
||||||
|
image: prom/node-exporter
|
||||||
|
args:
|
||||||
|
- "--path.rootfs=/host"
|
||||||
|
volumeMounts:
|
||||||
|
- name: node-volume
|
||||||
|
mountPath: /host
|
||||||
|
readOnly: true
|
||||||
|
mountPropagation: HostToContainer
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- name: node-volume
|
||||||
|
hostPath:
|
||||||
|
path: /
|
||||||
|
type: Directory
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: prometheus-exporters
|
||||||
|
namespace: prometheus
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
timeout: 1m30s
|
||||||
|
retryInterval: 30s
|
||||||
|
path: ./kubernetes/infrastructure/prometheus-exporters/exporters
|
||||||
|
prune: true
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
namespace: flux-system
|
||||||
|
name: flux-system
|
||||||
|
dependsOn:
|
||||||
|
- name: namespaces
|
||||||
|
namespace: flux-system
|
||||||
@@ -41,6 +41,21 @@ spec:
|
|||||||
mountPath: /etc/prometheus/
|
mountPath: /etc/prometheus/
|
||||||
- name: prometheus-storage-volume
|
- name: prometheus-storage-volume
|
||||||
mountPath: /prometheus/
|
mountPath: /prometheus/
|
||||||
|
- name: grafana
|
||||||
|
image: grafana/grafana:11.0.1
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
volumeMounts:
|
||||||
|
- name: grafana-config-volume
|
||||||
|
mountPath: /etc/grafana
|
||||||
|
- name: grafana-data-volume
|
||||||
|
mountPath: /var/lib/grafana
|
||||||
|
- name: grafana-logs-volume
|
||||||
|
mountPath: /var/log/grafana
|
||||||
|
- name: grafana-plugins-volume
|
||||||
|
mountPath: /var/lib/grafana/plugins
|
||||||
|
- name: grafana-provisioning-volume
|
||||||
|
mountPath: /etc/grafana/provisioning
|
||||||
volumes:
|
volumes:
|
||||||
- name: prometheus-config-volume
|
- name: prometheus-config-volume
|
||||||
hostPath:
|
hostPath:
|
||||||
@@ -49,4 +64,24 @@ spec:
|
|||||||
- name: prometheus-storage-volume
|
- name: prometheus-storage-volume
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /mnt/nfs/AppData/prometheus/storage
|
path: /mnt/nfs/AppData/prometheus/storage
|
||||||
|
type: Directory
|
||||||
|
- name: grafana-config-volume
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/grafana/config
|
||||||
|
type: Directory
|
||||||
|
- name: grafana-data-volume
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/grafana/data
|
||||||
|
type: Directory
|
||||||
|
- name: grafana-logs-volume
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/grafana/logs
|
||||||
|
type: Directory
|
||||||
|
- name: grafana-plugins-volume
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/grafana/plugins
|
||||||
|
type: Directory
|
||||||
|
- name: grafana-provisioning-volume
|
||||||
|
hostPath:
|
||||||
|
path: /mnt/nfs/AppData/grafana/provisioning
|
||||||
type: Directory
|
type: Directory
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -9,9 +9,14 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: prometheus
|
app: prometheus
|
||||||
type: ClusterIP
|
type: NodePort
|
||||||
ports:
|
ports:
|
||||||
- port: 9999
|
- port: 9999
|
||||||
targetPort: 9090
|
targetPort: 9090
|
||||||
|
nodePort: 30999
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: http
|
name: http
|
||||||
|
- name: grafana-port
|
||||||
|
port: 3030
|
||||||
|
nodePort: 30303
|
||||||
|
targetPort: 3000
|
||||||
@@ -21,6 +21,7 @@ spec:
|
|||||||
password: ${password}
|
password: ${password}
|
||||||
master:
|
master:
|
||||||
persistence:
|
persistence:
|
||||||
|
storageClass: local-path
|
||||||
existingClaim: redis-master-pvc
|
existingClaim: redis-master-pvc
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
@@ -30,6 +31,7 @@ spec:
|
|||||||
replica:
|
replica:
|
||||||
replicaCount: 1
|
replicaCount: 1
|
||||||
persistence:
|
persistence:
|
||||||
|
storageClass: local-path
|
||||||
existingClaim: redis-replica-pvc
|
existingClaim: redis-replica-pvc
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
93
kubernetes/infrastructure/redis/app/volume.yaml
Normal file
93
kubernetes/infrastructure/redis/app/volume.yaml
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: redis-master-pv
|
||||||
|
namespace: redis
|
||||||
|
labels:
|
||||||
|
type: local
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
capacity:
|
||||||
|
storage: 8Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
local:
|
||||||
|
path: "/mnt/nfs/AppData/redis/master"
|
||||||
|
claimRef:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
name: redis-master-pvc
|
||||||
|
namespace: redis
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi5-cluster-node-3
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: redis-master-pvc
|
||||||
|
namespace: redis
|
||||||
|
labels:
|
||||||
|
name: redis-master-pvc
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 8Gi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolume
|
||||||
|
metadata:
|
||||||
|
name: redis-replica-pv
|
||||||
|
namespace: redis
|
||||||
|
labels:
|
||||||
|
type: local
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
capacity:
|
||||||
|
storage: 8Gi
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
persistentVolumeReclaimPolicy: Retain
|
||||||
|
local:
|
||||||
|
path: "/mnt/nfs/AppData/redis/replica"
|
||||||
|
claimRef:
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
name: redis-replica-pvc
|
||||||
|
namespace: redis
|
||||||
|
nodeAffinity:
|
||||||
|
required:
|
||||||
|
nodeSelectorTerms:
|
||||||
|
- matchExpressions:
|
||||||
|
- key: kubernetes.io/hostname
|
||||||
|
operator: In
|
||||||
|
values:
|
||||||
|
- rpi5-cluster-node-3
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: redis-replica-pvc
|
||||||
|
namespace: redis
|
||||||
|
labels:
|
||||||
|
name: redis-replica-pvc
|
||||||
|
spec:
|
||||||
|
storageClassName: local-path
|
||||||
|
volumeMode: Filesystem
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 8Gi
|
||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
interval: 10m
|
interval: 10m
|
||||||
timeout: 1m30s
|
timeout: 1m30s
|
||||||
retryInterval: 30s
|
retryInterval: 30s
|
||||||
path: ./kubernetes/apps/redis/app
|
path: ./kubernetes/infrastructure/redis/app
|
||||||
prune: true
|
prune: true
|
||||||
sourceRef:
|
sourceRef:
|
||||||
kind: GitRepository
|
kind: GitRepository
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: GitRepository
|
||||||
|
metadata:
|
||||||
|
name: local-path-provisioner
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 5m
|
||||||
|
ref:
|
||||||
|
branch: main
|
||||||
|
secretRef:
|
||||||
|
name: flux-system
|
||||||
|
timeout: 60s
|
||||||
|
url: https://github.com/rancher/local-path-provisioner.git
|
||||||
Reference in New Issue
Block a user