Prometheus Installation with Prometheus Operator: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 39: Line 39:


=Removal=
=Removal=
<syntaxhighlight lang='bash'>
for n in $(kubectl get namespaces -o jsonpath={..metadata.name}); do
  kubectl delete --all --namespace=$n prometheus,servicemonitor,podmonitor,alertmanager
done
kubectl delete -f bundle.yaml
</syntaxhighlight>

Revision as of 03:51, 14 October 2020

External

Internal

Installation

Go to https://github.com/prometheus-operator/prometheus-operator, locate the latest release (Tags → v0.42.1) and download bundle.yaml.

https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.42.1/bundle.yaml

If deploying in a namespace other than the default namespace, adjust the namespace in:

  • ClusterRoleBinding (ServiceAccount)
  • Deployment
  • ServiceAccount
  • Service
kubectl -n prometheus apply -f bundle.yaml

customresourcedefinition.apiextensions.k8s.io/alertmanagers.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/podmonitors.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/probes.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/prometheuses.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/prometheusrules.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/servicemonitors.monitoring.coreos.com created
customresourcedefinition.apiextensions.k8s.io/thanosrulers.monitoring.coreos.com created
clusterrolebinding.rbac.authorization.k8s.io/prometheus-operator created
clusterrole.rbac.authorization.k8s.io/prometheus-operator created
deployment.apps/prometheus-operator created
serviceaccount/prometheus-operator created
service/prometheus-operator created

Removal

for n in $(kubectl get namespaces -o jsonpath={..metadata.name}); do
  kubectl delete --all --namespace=$n prometheus,servicemonitor,podmonitor,alertmanager
done
kubectl delete -f bundle.yaml