Prometheus
1. Run this script
If needed step 2 to 6
2. change "--bind-address" value from 127.0.0.1 to 0.0.0.0 in below two files
/etc/kubernetes/manifests/kube-controller-manager.yaml
/etc/kubernetes/manifests/kube-scheduler.yaml
3. Run below two commands (optional)
k delete pod kube-controller-manager-minikube -n kube-system
KUBEADM_SYSTEMD_CONF=/etc/systemd/system/kubelet.service.d/10-kubeadm.conf
sed -e "/cadvisor-port=0/d" -i "$KUBEADM_SYSTEMD_CONF"
if ! grep -q "authentication-token-webhook=true" "$KUBEADM_SYSTEMD_CONF"; then
sed -e "s/--authorization-mode=Webhook/--authentication-token-webhook=true --authorization-mode=Webhook/" -i "$KUBEADM_SYSTEMD_CONF"
fi
systemctl daemon-reload
systemctl restart kubelet
2. change "--bind-address" value from 127.0.0.1 to 0.0.0.0 in below two files
/etc/kubernetes/manifests/kube-controller-manager.yaml
/etc/kubernetes/manifests/kube-scheduler.yaml
3. Run below two commands (optional)
k delete pod kube-controller-manager-minikube -n kube-system
k delete pod kube-scheduler-minikube -n kube-system
4. run command
kubectl api-resources | grep deployment
do require changes in deployment section of YAML as per https://stackoverflow.com/questions/58481850/no-matches-for-kind-deployment-in-version-extensions-v1beta1
5. run command
kubectl api-resources | grep DaemonSet
Do require changes
6. kubectl edit clusterrole system:node
add following section in - apiGroups:
- apiGroups:
- ""
resources:
- nodes/proxy
verbs:
- get
if needed step 7
7 k edit clusterrole prometheus
6. kubectl edit clusterrole system:node
add following section in - apiGroups:
- apiGroups:
- ""
resources:
- nodes/proxy
verbs:
- get
if needed step 7
7 k edit clusterrole prometheus
add "nodes/metrics"
URLs
http://127.0.0.1:30990/ Prometheus
http://127.0.0.1:31400/ Grafana
http://127.0.0.1:30993/ Prometheus Alert Manager
=========================
The Prometheus resource declaratively describes the desired state of a Prometheus deployment, while a ServiceMonitor describes the set of targets to be monitored by Prometheus.
Reference :
https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md
The Prometheus Operator reconciles
URLs
http://127.0.0.1:30990/ Prometheus
http://127.0.0.1:31400/ Grafana
http://127.0.0.1:30993/ Prometheus Alert Manager
=========================
The Prometheus resource declaratively describes the desired state of a Prometheus deployment, while a ServiceMonitor describes the set of targets to be monitored by Prometheus.
Reference :
https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/getting-started.md
The Prometheus Operator reconciles
services
called prometheus-operated
and alertmanager-operated
, which are used as governing Service
s for the StatefulSet
s. To perform this reconciliation
The custom resources that the Prometheus Operator introduces are:
Prometheus
ServiceMonitor
PodMonitor
Alertmanager
PrometheusRule
0 comments:
Post a Comment