github.com/looshlee/cilium@v1.6.12/examples/kubernetes/addons/prometheus/README.md (about)

     1  # Deploying Prometheus & Grafana for Cilium
     2  
     3  This is an example deployment that includes Prometheus and Grafana in a single
     4  deployment.
     5  
     6  The default installation contains:
     7  
     8  - Grafana: A visualization dashboard with Cilium Dashboard pre-loaded.
     9  - Prometheus: a time series database and monitoring system.
    10  
    11  ## Enable Metrics in Cilium & Cilium-operator
    12  
    13  Enable prometheus metrics on all Cilium agents, be aware this will open the
    14  port `9090` in all nodes of your cluster where a cilium-agent is running.
    15  
    16  ```
    17  $ kubectl patch -n kube-system configmap cilium-config --type merge --patch '{"data":{"prometheus-serve-addr":":9090"}}'
    18  configmap/cilium-config patched
    19  ```
    20  
    21  Make sure you restart all Cilium agents so they can get the new ConfigMap with
    22  `prometheus-serve-addr` option set.
    23  
    24  Next, install all monitoring tools and configurations by running:
    25  
    26  ```
    27  $ kubectl create -f examples/kubernetes/addons/prometheus/monitoring-example.yaml
    28  namespace/monitoring created
    29  configmap/prometheus created
    30  deployment.extensions/prometheus created
    31  service/prometheus created
    32  service/prometheus-open created
    33  clusterrolebinding.rbac.authorization.k8s.io/prometheus created
    34  clusterrole.rbac.authorization.k8s.io/prometheus created
    35  serviceaccount/prometheus-k8s created
    36  configmap/grafana-config created
    37  deployment.extensions/grafana created
    38  service/grafana created
    39  configmap/grafana-dashboards created
    40  job.batch/grafana-dashboards-import created
    41  ```
    42  
    43  ## How to access Grafana
    44  
    45  Expose the port on your local machine
    46  
    47  ```
    48  kubectl -n cilium-monitoring port-forward service/grafana 3000:3000
    49  ```
    50  
    51  Access it via your browser: `https://localhost:3000`
    52  
    53  ## How to access Prometheus
    54  
    55  Expose the port on your local machine
    56  
    57  ```
    58  kubectl -n cilium-monitoring port-forward service/prometheus 9090:9090
    59  ```
    60  
    61  Access it via your browser: `https://localhost:9090`