Below should be the prerequisites:
- K8s Cluster
- Default StorageClass (optional, only if using persistent storage)
- Helm client/server version =>2.13.1
- Assumes BOSH knowledge
Steps to Deploy Prometheus Operator on Enterprise PKS:
Login to a VM where you can run bosh commands:
- Get the IP of Master node:
bosh vms
- Get ETCD certs from Master(s)
bosh scp -d service-instance_<####> master/0:/var/vcap/jobs/etcd/config/etcd-ca.crt .
bosh scp -d service-instance_<####> master/0:/var/vcap/jobs/etcd/config/etcdctl.* .
Note: Login to a VM where you can authenticate to your clusters so that you can run kubectl commands to interact with the K8s clusters.
- Create a monitoring namespace for the operator to live in
kubectl create ns monitoring
- Create ETCD certs secret in K8s using the certs copied from the Master
kubectl create secret -n monitoring generic etcd-client \
--from-file=etcd-ca.crt \
--from-file=etcdctl.crt \
--from-file=etcdctl.key
- Create a file named override.yaml with the following content
prometheus:
prometheusSpec:
secrets:
- etcd-client
kubelet:
serviceMonitor:
https: true
kubeControllerManager:
endpoints:
- 172.15.0.2 ## Change to the Master IP(s) recorded from "bosh vms" command
kubeScheduler:
endpoints:
- 172.15.0.2 ## Change to the Master IP(s) recorded from "bosh vms" command
kubeEtcd:
endpoints:
- 172.15.0.2 ## Change to the Master IP(s) recorded from "bosh vms" command
serviceMonitor:
insecureSkipVerify: true
scheme: https
caFile: "/etc/prometheus/secrets/etcd-client/etcd-ca.crt"
certFile: "/etc/prometheus/secrets/etcd-client/etcdctl.crt"
keyFile: "/etc/prometheus/secrets/etcd-client/etcdctl.key"
- Install the prometheus-operator using the following command:
helm install -f override.yaml --name prom-operator stable/prometheus-operator