prometheus-operator
Kubernetes 호환성
설치
Reference
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update prometheus-community \
&& helm search repo prometheus-community/kube-prometheus-stack -l | head -n 10
helm pull prometheus-community/kube-prometheus-stack --version 66.3.0
helm show values prometheus-community/kube-prometheus-stack \
--version 66.3.0 \
> kube-prometheus-stack-66.3.0.yaml
kube-prometheus-stack-values.yaml
fullnameOverride: prometheus-stack
commonLabels: {}
defaultRules:
# Chart가 제공하는 기본 alert and record rules의 집합
# https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack/templates/prometheus/rules-1.14
create: false
windowsMonitoring:
enabled: false
alertmanager:
enabled: false
grafana:
enabled: false
kubernetesServiceMonitors:
enabled: false
kubeApiServer:
enabled: false
kubelet:
# -kubelet 설치, cAdvisor: 실행중인 컨테이너의 정보
enabled: false
kubeControllerManager:
enabled: false
coreDns:
enabled: false
kubeDns:
enabled: false
kubeEtcd:
enabled: false
kubeScheduler:
enabled: false
kubeProxy:
enabled: false
kubeStateMetrics:
enabled: false
nodeExporter:
# -node-exporter 설치, Node의 Hardware, kernel 관련 정보
enabled: false
prometheusOperator:
# -operator 설치
enabled: true
tls:
enabled: false
admissionWebhooks:
# PrometheusRules의 형식이 올바른지 확인해주는 기능인데 control plane이 webhook 서비스에
# 접근할 수 있어야하는 문제가 있습니다.
enabled: true
patch:
tolerations: []
serviceMonitor:
selfMonitor: false
tolerations: []
prometheus:
enabled: false
thanosRuler:
enabled: false
helm template prometheus-stack kube-prometheus-stack-66.3.0.tgz \
-n prometheus-stack \
-f kube-prometheus-stack-values.yaml \
> kube-prometheus-stack.yaml
helm upgrade prometheus-stack kube-prometheus-stack-66.3.0.tgz \
--install \
--history-max 5 \
-n prometheus-stack \
-f kube-prometheus-stack-values.yaml
삭제
helm uninstall -n prometheus-stack prometheus-operator
helm으로 삭제한 후 CRDs 삭제를 위해 아래 명령어를 실행해줍니다.
kubectl get crd -oname | grep --color=never 'monitoring.coreos.com' | xargs kubectl delete