Install Prometheus Operator

前言

最近看完2023 Google Cloud summit ,
看到一個新東西,OpenTelemetry,可以不用埋程式用sidecar的方式,
就能做到Observability的trace,
但在那之前,我要先在測試叢集裝一下Prometheus Operator,
不然資料傳不過去。

正文

  1. git clone
git clone https://github.com/prometheus-operator/kube-prometheus
  1. install
kubectl apply --server-side -f manifests/setup
kubectl wait \
	--for condition=Established \
	--all CustomResourceDefinition \
	--namespace=monitoring
kubectl apply -f manifests/
  1. 刪除
kubectl delete --ignore-not-found=true -f manifests/ -f manifests/setup

不過這個安裝方式,會包含

自定安裝的話,也可以利用helm

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update

自訂安裝,設定參考

helm install test prometheus-community/kube-prometheus-stack --namespace monitoring --create-namespace --values values.yaml

178-fig.1.jpg
上面指令使用test當關鍵字,所以部署時也會在上面增加

補充

如果不想自己架Prometheus,也不想用Google Cloud Monitor,
可以考慮Google自己出的 Google Managed Prometheus 官方文件

ref.