github.com/imran-kn/cilium-fork@v1.6.9/Documentation/gettingstarted/grafana.rst (about)

     1  .. only:: not (epub or latex or html)
     2  
     3      WARNING: You are looking at unreleased Cilium documentation.
     4      Please use the official rendered version released here:
     5      http://docs.cilium.io
     6  
     7  .. _install_metrics:
     8  
     9  ****************************
    10  Running Prometheus & Grafana
    11  ****************************
    12  
    13  Installation
    14  ============
    15  
    16  This is an example deployment that includes Prometheus and Grafana in a single
    17  deployment.
    18  
    19  The default installation contains:
    20  
    21  - **Grafana**: A visualization dashboard with Cilium Dashboard pre-loaded.
    22  - **Prometheus**: a time series database and monitoring system.
    23  
    24  
    25   .. parsed-literal::
    26  
    27      $ kubectl apply -f \ |SCM_WEB|\/examples/kubernetes/addons/prometheus/monitoring-example.yaml
    28      configmap/cilium-metrics-config created
    29      namespace/cilium-monitoring created
    30      configmap/prometheus created
    31      deployment.extensions/prometheus created
    32      clusterrolebinding.rbac.authorization.k8s.io/prometheus created
    33      clusterrole.rbac.authorization.k8s.io/prometheus created
    34      serviceaccount/prometheus-k8s created
    35      service/prometheus created
    36      deployment.extensions/grafana created
    37      service/grafana created
    38      configmap/grafana-config created
    39  
    40  Deploy Cilium with metrics enabled
    41  ==================================
    42  
    43  Both ``cilium-agent`` and ``cilium-operator`` do not expose metrics by
    44  default. Enabling metrics for these services will open ports ``9090``
    45  and ``6942`` on all nodes of your cluster where these components are running.
    46  
    47  To deploy Cilium with metrics enabled, set the ``global.prometheus.enabled=true`` Helm
    48  value:
    49  
    50  .. include:: k8s-install-download-release.rst
    51  
    52  Generate the required YAML file and deploy it:
    53  
    54  .. code:: bash
    55  
    56     helm template cilium \
    57        --namespace kube-system \
    58        --set global.prometheus.enabled=true \
    59        > cilium.yaml
    60     kubectl create -f cilium.yaml
    61  
    62  .. note::
    63  
    64     You can combine the ``global.prometheus.enabled=true`` option with any of
    65     the other installation guides.
    66  
    67  How to access Grafana
    68  =====================
    69  
    70  Expose the port on your local machine
    71  
    72  .. code:: bash
    73  
    74      kubectl -n cilium-monitoring port-forward service/grafana 3000:3000
    75  
    76  Access it via your browser: ``https://localhost:3000``
    77  
    78  How to access Prometheus
    79  ========================
    80  
    81  Expose the port on your local machine
    82  
    83  .. code:: bash
    84  
    85      kubectl -n cilium-monitoring port-forward service/prometheus 9090:9090
    86  
    87  Access it via your browser: ``https://localhost:9090``
    88  
    89  Examples
    90  ========
    91  
    92  Generic
    93  -------
    94  
    95  .. image:: images/grafana_generic.png
    96  
    97  Network
    98  -------
    99  
   100  .. image:: images/grafana_network.png
   101  
   102  Policy
   103  -------
   104  
   105  .. image:: images/grafana_policy.png
   106  .. image:: images/grafana_policy2.png
   107  
   108  Endpoints
   109  ---------
   110  
   111  .. image:: images/grafana_endpoints.png
   112  
   113  Controllers
   114  -----------
   115  
   116  .. image:: images/grafana_controllers.png
   117  
   118  Kubernetes
   119  ----------
   120  
   121  .. image:: images/grafana_k8s.png
   122