- kubernetes cluster is ready
kubectl get nodes -o wideOUTPUT
NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME
kubmaster Ready control-plane 5h26m v1.28.15 192.168.10.6 <none> Debian GNU/Linux 12 (bookworm) 6.1.0-32-cloud-amd64 containerd://1.7.27
kubnode1 Ready <none> 5h3m v1.28.15 192.168.10.5 <none> Debian GNU/Linux 12 (bookworm) 6.1.0-35-cloud-amd64 containerd://1.7.27
kubnode2 Ready <none> 5h2m v1.28.15 192.168.10.7 <none> Debian GNU/Linux 12 (bookworm) 6.1.0-35-cloud-amd64 containerd://1.7.27
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.shhelm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo updatehelm upgrade --install prometheus prometheus-community/kube-prometheus-stack \
--namespace monitoring \
--create-namespace \
--set prometheus.prometheusSpec.maximumStartupDurationSeconds=60 \
--set prometheus.prometheusSpec.serviceMonitorSelectorNilUsesHelmValues=false \
--set prometheus.prometheusSpec.podMonitorSelectorNilUsesHelmValues=falsekubectl --namespace monitoring get pods -l "release=prometheus"kubectl --namespace monitoring get secrets prometheus-grafana -o jsonpath="{.data.admin-password}" | base64 -d ; echoexport POD_NAME=$(kubectl --namespace monitoring get pod -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=prometheus" -oname)
kubectl --namespace monitoring port-forward $POD_NAME 3000helm uninstall prometheus -n monitoringkubectl delete crd alertmanagerconfigs.monitoring.coreos.com
kubectl delete crd alertmanagers.monitoring.coreos.com
kubectl delete crd podmonitors.monitoring.coreos.com
kubectl delete crd probes.monitoring.coreos.com
kubectl delete crd prometheuses.monitoring.coreos.com
kubectl delete crd prometheusrules.monitoring.coreos.com
kubectl delete crd servicemonitors.monitoring.coreos.com
kubectl delete crd thanosrulers.monitoring.coreos.comkubectl delete ns monitoring