# Ref:- /kra-data/setup/downloads/services # cd /kra-data/ndml-kra.devops/setup/services/dev/prometheus # container image download url - prom/prometheus - https://hub.docker.com/layers/prom/prometheus/v2.47.0/images/sha256-db03207fa305e4232ae907f04e51fac42ea4c7ca8359812562ed5c8bcc8e34e5?context=explore - busybox:1.28 - https://hub.docker.com/layers/library/busybox/1.28/images/sha256-2d8967e4a68583a4bb2d7e236c60a1d72a585439b41e7a77555edad8df0f2bf4?context=explore # push docker image to private registry - docker pull prom/prometheus:v2.47.0 - docker pull busybox:1.28 - docker tag prom/prometheus:v2.47.0 private-repo:5000/prom/prometheus:v2.47.0 - docker tag busybox:1.28 private-repo:5000/busybox:1.28 - docker push private-repo:5000/prom/prometheus:v2.47.0 - docker push private-repo:5000/busybox:1.28 # check namespaces kubectl get ns # create namespace e-search kubectl create ns prom/prometheus # open the prometheus-deployment.yaml file and update mount path inside container, container port, replicas, nodeSelector, and container image. # open the prometheus-service.yaml file and check service ports. # open the prometheus-pv-pvc.yaml and update storage and host path. # open the cluster-role.yaml and check the node resource urls. # open the cluster-role-binding.yaml and check the binding of cluster role and service account. # open and check the service account file. # open the prometheus-configmap.yaml and check the configuration of differnt services such as jenkins, elasticsearch. check the metric path and target. # deploy the file by below command kubectl apply -f '*.yaml' -n prometheus # output clusterrolebinding.rbac.authorization.k8s.io/prometheus configured clusterrole.rbac.authorization.k8s.io/prometheus configured configmap/prometheus-config configured deployment.apps/prometheus configured service/prometheus-service configured persistentvolume/pv-prometheus configured persistentvolumeclaim/pvc-prometheus configured serviceaccount/prometheus configured # confirmed deployment by running below command kubectl get all -n pometheus --------------------- (will give pods, deployment and service data) # check whether pods are in running state or not NAME READY STATUS RESTARTS AGE pod/prometheus-74ddcc75f9-gz7sz 1/1 Running 0 3h54m NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/prometheus-service NodePort 10.102.96.39 8081:30909/TCP 19d NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/prometheus 1/1 1 1 15d NAME DESIRED CURRENT READY AGE replicaset.apps/prometheus-74ddcc75f9 1 1 1 15d # check logs using below command kubectl logs -n prometheus # check description of pod using below command kubectl describe pod -n prometheus e.g. kubectl describe pod -n pod/prometheus-74ddcc75f9-gz7sz # exec into pod kubectl exec -it -n prometheus -- /bin/bash