// This assembly is included in the following assemblies:
//
// metrics/assembly_metrics-prometheus-deploy.adoc/

[id='proc-metrics-deploying-prometheus-operator-{context}']

= Deploying the Prometheus Operator

To deploy the Prometheus Operator to your Kafka cluster, apply the YAML bundle resources file from the https://github.com/coreos/prometheus-operator[Prometheus CoreOS repository].

.Procedure

. Download the resource file from the repository and replace the example `namespace` with your own:
+
On Linux, use:
+
[source,shell,subs=+quotes]
curl -s https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yaml | sed -e 's/namespace: .*/namespace: _my-namespace_/' > prometheus-operator-deployment.yaml
+
On MacOS, use:
+
[source,shell,subs=+quotes]
curl -s https://raw.githubusercontent.com/coreos/prometheus-operator/master/bundle.yaml | sed -e '' 's/namespace: .*/namespace: _my-namespace_/' > prometheus-operator-deployment.yaml
+
NOTE: If it is not required, you can manually remove the `spec.template.spec.securityContext` property from the `prometheus-operator-deployment.yaml` file.

. Deploy the Prometheus Operator:
+
[source,shell,subs="+attributes"]
kubectl apply -f prometheus-operator-deployment.yaml
+
NOTE: The Prometheus Operator installation works with Kubernetes 1.18+. To check which version to use with a different Kubernetes version, refer to the https://github.com/coreos/kube-prometheus#kubernetes-compatibility-matrix[Kubernetes compatibility matrix].
