forked from k-space/kube
		
	Consolidate monitoring stack to Kube master nodes
This commit is contained in:
		@@ -5,10 +5,10 @@ and the corresponding AlertManager is accessible at [am.k-space.ee](https://am.k
 | 
			
		||||
Both are [deployed by ArgoCD](https://argocd.k-space.ee/applications/monitoring)
 | 
			
		||||
from this Git repo directory using Prometheus operator.
 | 
			
		||||
 | 
			
		||||
Note that Prometheus and other monitoring stack components should use the
 | 
			
		||||
`dedicated: monitoring` Kubernetes node selector to make sure the components
 | 
			
		||||
get scheduled on `mon[1-3]` nodes which are hosted in a privileged VLAN where
 | 
			
		||||
they have access to UPS SNMP targets, Mikrotik router/switch API-s etc.
 | 
			
		||||
Note that Prometheus and other monitoring stack components should appropriate
 | 
			
		||||
node selector to make sure the components get scheduled on nodes which are
 | 
			
		||||
hosted in a privileged VLAN where they have access to UPS SNMP targets,
 | 
			
		||||
Mikrotik router/switch API-s etc.
 | 
			
		||||
 | 
			
		||||
To add monitoring targets inside the Kubernetes cluster make use of
 | 
			
		||||
[PodMonitor](https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/getting-started.md#using-podmonitors) or ServiceMonitor custom
 | 
			
		||||
 
 | 
			
		||||
@@ -48,11 +48,11 @@ spec:
 | 
			
		||||
  secrets:
 | 
			
		||||
    - slack-secrets
 | 
			
		||||
  nodeSelector:
 | 
			
		||||
    dedicated: monitoring
 | 
			
		||||
    node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
  tolerations:
 | 
			
		||||
    - key: dedicated
 | 
			
		||||
    - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
      operator: Equal
 | 
			
		||||
      value: monitoring
 | 
			
		||||
      value: ''
 | 
			
		||||
      effect: NoSchedule
 | 
			
		||||
  replicas: 3
 | 
			
		||||
  serviceAccountName: alertmanager
 | 
			
		||||
 
 | 
			
		||||
@@ -180,13 +180,12 @@ spec:
 | 
			
		||||
        - name: blackbox-exporter-config
 | 
			
		||||
          configMap:
 | 
			
		||||
            name: blackbox-exporter-config
 | 
			
		||||
      # TODO: Results in odd 6s connection lag if scheduled in VLAN20
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        dedicated: monitoring
 | 
			
		||||
        node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
      tolerations:
 | 
			
		||||
        - key: dedicated
 | 
			
		||||
        - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
          operator: Equal
 | 
			
		||||
          value: monitoring
 | 
			
		||||
          value: ''
 | 
			
		||||
          effect: NoSchedule
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        - maxSkew: 1
 | 
			
		||||
 
 | 
			
		||||
@@ -85,12 +85,12 @@ spec:
 | 
			
		||||
            matchLabels:
 | 
			
		||||
              app: mikrotik-exporter
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        dedicated: monitoring
 | 
			
		||||
        node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
      tolerations:
 | 
			
		||||
      - key: dedicated
 | 
			
		||||
        operator: Equal
 | 
			
		||||
        value: monitoring
 | 
			
		||||
        effect: NoSchedule
 | 
			
		||||
        - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
          operator: Equal
 | 
			
		||||
          value: ''
 | 
			
		||||
          effect: NoSchedule
 | 
			
		||||
      affinity:
 | 
			
		||||
        podAntiAffinity:
 | 
			
		||||
          requiredDuringSchedulingIgnoredDuringExecution:
 | 
			
		||||
 
 | 
			
		||||
@@ -39,12 +39,12 @@ spec:
 | 
			
		||||
              - NET_ADMIN
 | 
			
		||||
              - NET_RAW
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        dedicated: monitoring
 | 
			
		||||
        node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
      tolerations:
 | 
			
		||||
      - key: dedicated
 | 
			
		||||
        operator: Equal
 | 
			
		||||
        value: monitoring
 | 
			
		||||
        effect: NoSchedule
 | 
			
		||||
        - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
          operator: Equal
 | 
			
		||||
          value: ''
 | 
			
		||||
          effect: NoSchedule
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        - maxSkew: 1
 | 
			
		||||
          topologyKey: topology.kubernetes.io/zone
 | 
			
		||||
 
 | 
			
		||||
@@ -24,11 +24,11 @@ spec:
 | 
			
		||||
          app.kubernetes.io/instance: prometheus
 | 
			
		||||
          app.kubernetes.io/name: prometheus
 | 
			
		||||
  nodeSelector:
 | 
			
		||||
    dedicated: monitoring
 | 
			
		||||
    node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
  tolerations:
 | 
			
		||||
    - key: dedicated
 | 
			
		||||
    - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
      operator: Equal
 | 
			
		||||
      value: monitoring
 | 
			
		||||
      value: ''
 | 
			
		||||
      effect: NoSchedule
 | 
			
		||||
  alerting:
 | 
			
		||||
    alertmanagers:
 | 
			
		||||
 
 | 
			
		||||
@@ -39,12 +39,12 @@ spec:
 | 
			
		||||
          configMap:
 | 
			
		||||
            name: snmp-exporter
 | 
			
		||||
      nodeSelector:
 | 
			
		||||
        dedicated: monitoring
 | 
			
		||||
        node-role.kubernetes.io/control-plane: ''
 | 
			
		||||
      tolerations:
 | 
			
		||||
      - key: dedicated
 | 
			
		||||
        operator: Equal
 | 
			
		||||
        value: monitoring
 | 
			
		||||
        effect: NoSchedule
 | 
			
		||||
        - key: node-role.kubernetes.io/control-plane
 | 
			
		||||
          operator: Equal
 | 
			
		||||
          value: ''
 | 
			
		||||
          effect: NoSchedule
 | 
			
		||||
      topologySpreadConstraints:
 | 
			
		||||
        - maxSkew: 1
 | 
			
		||||
          topologyKey: topology.kubernetes.io/zone
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user