mirror of
				https://github.com/optim-enterprises-bv/homelab.git
				synced 2025-11-03 19:37:55 +00:00 
			
		
		
		
	feat(monitoring): Installing kube-prometheus-stack from prometheus-community Helm chart
This commit is contained in:
		@@ -1,6 +1,3 @@
 | 
				
			|||||||
#
 | 
					 | 
				
			||||||
# Auth Ingress
 | 
					 | 
				
			||||||
#
 | 
					 | 
				
			||||||
apiVersion: traefik.containo.us/v1alpha1
 | 
					apiVersion: traefik.containo.us/v1alpha1
 | 
				
			||||||
kind: IngressRoute
 | 
					kind: IngressRoute
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
@@ -25,7 +22,7 @@ spec:
 | 
				
			|||||||
          port: 80
 | 
					          port: 80
 | 
				
			||||||
      middlewares:
 | 
					      middlewares:
 | 
				
			||||||
        - name: traefik-forward-auth
 | 
					        - name: traefik-forward-auth
 | 
				
			||||||
    - match: Host(`test.stonegarden.dev`)
 | 
					    - match: Host(`whoami-open.stonegarden.dev`)
 | 
				
			||||||
      kind: Rule
 | 
					      kind: Rule
 | 
				
			||||||
      services:
 | 
					      services:
 | 
				
			||||||
        - name: whoami
 | 
					        - name: whoami
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,10 +8,10 @@ metadata:
 | 
				
			|||||||
spec:
 | 
					spec:
 | 
				
			||||||
  tls:
 | 
					  tls:
 | 
				
			||||||
    - hosts:
 | 
					    - hosts:
 | 
				
			||||||
        - cert.stonegarden.dev
 | 
					        - whoami-cert.stonegarden.dev
 | 
				
			||||||
      secretName: tls-whoami-ingress-http
 | 
					      secretName: tls-whoami-ingress-http
 | 
				
			||||||
  rules:
 | 
					  rules:
 | 
				
			||||||
    - host: cert.stonegarden.dev
 | 
					    - host: whoami-cert.stonegarden.dev
 | 
				
			||||||
      http:
 | 
					      http:
 | 
				
			||||||
        paths:
 | 
					        paths:
 | 
				
			||||||
          - path: /
 | 
					          - path: /
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,7 @@ spec:
 | 
				
			|||||||
    email: veghag@gmail.com
 | 
					    email: veghag@gmail.com
 | 
				
			||||||
    server: https://acme-v02.api.letsencrypt.org/directory
 | 
					    server: https://acme-v02.api.letsencrypt.org/directory
 | 
				
			||||||
    privateKeySecretRef:
 | 
					    privateKeySecretRef:
 | 
				
			||||||
      # if not existing, it will register a new account and stores it
 | 
					      # if not existing, register a new account and stores it
 | 
				
			||||||
      name: whoami-issuer-account-key
 | 
					      name: whoami-issuer-account-key
 | 
				
			||||||
    solvers:
 | 
					    solvers:
 | 
				
			||||||
      - http01:
 | 
					      - http01:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,7 @@ metadata:
 | 
				
			|||||||
spec:
 | 
					spec:
 | 
				
			||||||
  sourceRepos:
 | 
					  sourceRepos:
 | 
				
			||||||
    - 'https://github.com/vehagn/homelab'
 | 
					    - 'https://github.com/vehagn/homelab'
 | 
				
			||||||
 | 
					    - 'https://prometheus-community.github.io/helm-charts'
 | 
				
			||||||
    - 'https://helm.traefik.io/*'
 | 
					    - 'https://helm.traefik.io/*'
 | 
				
			||||||
    - 'https://helm.cilium.io/*'
 | 
					    - 'https://helm.cilium.io/*'
 | 
				
			||||||
  destinations:
 | 
					  destinations:
 | 
				
			||||||
@@ -17,6 +18,8 @@ spec:
 | 
				
			|||||||
      server: '*'
 | 
					      server: '*'
 | 
				
			||||||
    - namespace: 'metallb-system'
 | 
					    - namespace: 'metallb-system'
 | 
				
			||||||
      server: '*'
 | 
					      server: '*'
 | 
				
			||||||
 | 
					    - namespace: 'monitoring'
 | 
				
			||||||
 | 
					      server: '*'
 | 
				
			||||||
    - namespace: 'traefik-system'
 | 
					    - namespace: 'traefik-system'
 | 
				
			||||||
      server: '*'
 | 
					      server: '*'
 | 
				
			||||||
    - namespace: 'kube-system'
 | 
					    - namespace: 'kube-system'
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,8 +12,8 @@ spec:
 | 
				
			|||||||
    repoURL: https://github.com/vehagn/homelab
 | 
					    repoURL: https://github.com/vehagn/homelab
 | 
				
			||||||
    targetRevision: HEAD
 | 
					    targetRevision: HEAD
 | 
				
			||||||
  destination:
 | 
					  destination:
 | 
				
			||||||
    namespace: cert-manager
 | 
					 | 
				
			||||||
    name: in-cluster
 | 
					    name: in-cluster
 | 
				
			||||||
 | 
					    namespace: cert-manager
 | 
				
			||||||
  syncPolicy:
 | 
					  syncPolicy:
 | 
				
			||||||
    automated:
 | 
					    automated:
 | 
				
			||||||
      selfHeal: true
 | 
					      selfHeal: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,8 +32,6 @@ serviceAccounts:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
tunnel: vxlan
 | 
					tunnel: vxlan
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
hubble:
 | 
					hubble:
 | 
				
			||||||
  enabled: true
 | 
					  enabled: true
 | 
				
			||||||
  peerService:
 | 
					  peerService:
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										25
									
								
								infra/monitoring.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								infra/monitoring.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
				
			|||||||
 | 
					apiVersion: argoproj.io/v1alpha1
 | 
				
			||||||
 | 
					kind: Application
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: monitoring
 | 
				
			||||||
 | 
					  namespace: argocd
 | 
				
			||||||
 | 
					  finalizers:
 | 
				
			||||||
 | 
					    - resources-finalizer.argocd.argoproj.io
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  project: infrastructure
 | 
				
			||||||
 | 
					  source:
 | 
				
			||||||
 | 
					    plugin:
 | 
				
			||||||
 | 
					      name: kustomize-build-with-helm
 | 
				
			||||||
 | 
					    path: infra/monitoring
 | 
				
			||||||
 | 
					    repoURL: https://github.com/vehagn/homelab
 | 
				
			||||||
 | 
					    targetRevision: HEAD
 | 
				
			||||||
 | 
					  destination:
 | 
				
			||||||
 | 
					    namespace: monitoring
 | 
				
			||||||
 | 
					    name: in-cluster
 | 
				
			||||||
 | 
					  syncPolicy:
 | 
				
			||||||
 | 
					    automated:
 | 
				
			||||||
 | 
					      selfHeal: true
 | 
				
			||||||
 | 
					      prune: true
 | 
				
			||||||
 | 
					    syncOptions:
 | 
				
			||||||
 | 
					      - ServerSideApply=true
 | 
				
			||||||
 | 
					      - CreateNamespace=true
 | 
				
			||||||
							
								
								
									
										37
									
								
								infra/monitoring/ingress-route.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										37
									
								
								infra/monitoring/ingress-route.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,37 @@
 | 
				
			|||||||
 | 
					apiVersion: traefik.containo.us/v1alpha1
 | 
				
			||||||
 | 
					kind: IngressRoute
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: monitoring
 | 
				
			||||||
 | 
					  namespace: monitoring
 | 
				
			||||||
 | 
					  labels:
 | 
				
			||||||
 | 
					    app: traefik
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  entryPoints:
 | 
				
			||||||
 | 
					    - websecure
 | 
				
			||||||
 | 
					  routes:
 | 
				
			||||||
 | 
					    - match: Host(`prometheus.stonegarden.dev`)
 | 
				
			||||||
 | 
					      kind: Rule
 | 
				
			||||||
 | 
					      services:
 | 
				
			||||||
 | 
					        - name: kube-prometheus-stack-prometheus
 | 
				
			||||||
 | 
					          port: http-web # 9090
 | 
				
			||||||
 | 
					      middlewares:
 | 
				
			||||||
 | 
					        - name: traefik-forward-auth
 | 
				
			||||||
 | 
					          namespace: kube-system
 | 
				
			||||||
 | 
					    - match: Host(`grafana.stonegarden.dev`)
 | 
				
			||||||
 | 
					      kind: Rule
 | 
				
			||||||
 | 
					      services:
 | 
				
			||||||
 | 
					        - name: kube-prometheus-stack-grafana
 | 
				
			||||||
 | 
					          port: http-web # 80
 | 
				
			||||||
 | 
					      middlewares:
 | 
				
			||||||
 | 
					        - name: traefik-forward-auth
 | 
				
			||||||
 | 
					          namespace: kube-system
 | 
				
			||||||
 | 
					    - match: Host(`alertmanager.stonegarden.dev`)
 | 
				
			||||||
 | 
					      kind: Rule
 | 
				
			||||||
 | 
					      services:
 | 
				
			||||||
 | 
					        - name: kube-prometheus-stack-alertmanager
 | 
				
			||||||
 | 
					          port: http-web # 9093
 | 
				
			||||||
 | 
					      middlewares:
 | 
				
			||||||
 | 
					        - name: traefik-forward-auth
 | 
				
			||||||
 | 
					          namespace: kube-system
 | 
				
			||||||
 | 
					  tls:
 | 
				
			||||||
 | 
					    certResolver: letsencrypt
 | 
				
			||||||
							
								
								
									
										28
									
								
								infra/monitoring/kube-prometheus-stack.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								infra/monitoring/kube-prometheus-stack.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,28 @@
 | 
				
			|||||||
 | 
					apiVersion: argoproj.io/v1alpha1
 | 
				
			||||||
 | 
					kind: Application
 | 
				
			||||||
 | 
					metadata:
 | 
				
			||||||
 | 
					  name: kube-prometheus-stack
 | 
				
			||||||
 | 
					  namespace: argocd
 | 
				
			||||||
 | 
					  finalizers:
 | 
				
			||||||
 | 
					    - resources-finalizer.argocd.argoproj.io
 | 
				
			||||||
 | 
					spec:
 | 
				
			||||||
 | 
					  project: infrastructure
 | 
				
			||||||
 | 
					  source:
 | 
				
			||||||
 | 
					    chart: kube-prometheus-stack
 | 
				
			||||||
 | 
					    helm:
 | 
				
			||||||
 | 
					      values: |-
 | 
				
			||||||
 | 
					        prometheus-node-exporter:
 | 
				
			||||||
 | 
					           hostRootFsMount:
 | 
				
			||||||
 | 
					             enabled: false
 | 
				
			||||||
 | 
					        prometheusOperator:
 | 
				
			||||||
 | 
					           admissionWebhooks:
 | 
				
			||||||
 | 
					             failurePolicy: Ignore
 | 
				
			||||||
 | 
					    repoURL: https://prometheus-community.github.io/helm-charts
 | 
				
			||||||
 | 
					    targetRevision: 44.3.0
 | 
				
			||||||
 | 
					  destination:
 | 
				
			||||||
 | 
					    name: in-cluster
 | 
				
			||||||
 | 
					    namespace: monitoring
 | 
				
			||||||
 | 
					  syncPolicy:
 | 
				
			||||||
 | 
					    syncOptions:
 | 
				
			||||||
 | 
					      - ServerSideApply=true
 | 
				
			||||||
 | 
					      - CreateNamespace=true
 | 
				
			||||||
							
								
								
									
										6
									
								
								infra/monitoring/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								infra/monitoring/kustomization.yaml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					apiVersion: kustomize.config.k8s.io/v1beta1
 | 
				
			||||||
 | 
					kind: Kustomization
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					resources:
 | 
				
			||||||
 | 
					  - kube-prometheus-stack.yaml
 | 
				
			||||||
 | 
					  - ingress-route.yaml
 | 
				
			||||||
		Reference in New Issue
	
	Block a user