Prometheus Installation with Prometheus Operator: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
=External=
=External=
* https://coreos.com/operators/prometheus/docs/0.17.0/index.html
* https://coreos.com/operators/prometheus/docs/0.17.0/index.html
* https://github.com/prometheus-operator/prometheus-operator
* https://github.com/prometheus-operator/prometheus-operator


=Internal=
=Internal=
* [[Prometheus#Subjects|Prometheus]]
* [[Prometheus_Operations#Installation|Prometheus Operations]]
 
=Overview=
<font color=darkgray>Incomplete. I installed the operator then I did not know what to do with it.</font>
 
=Installation=
 
Go to https://github.com/prometheus-operator/prometheus-operator, locate the latest release (Tags → v0.42.1) and download bundle.yaml.
 
<syntaxhighlight lang='bash'>
https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.42.1/bundle.yaml
</syntaxhighlight>
 
If deploying in a namespace other than the default namespace, adjust the namespace in:
* ClusterRoleBinding (ServiceAccount)
* Deployment
* ServiceAccount
* Service
 
<syntaxhighlight lang='bash'>
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
</syntaxhighlight>
 
=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>

Latest revision as of 21:42, 14 October 2020

External

Internal

Overview

Incomplete. I installed the operator then I did not know what to do with it.

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