github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/loki-stack/promtail-loki-stack/README.md (about)

     1  # Overview
     2  
     3  This image chooses OpenEBS LocalPV as its persistence storage engine.
     4  
     5  Components included in this image:
     6  
     7  * 1 DaemonSet for promtail.
     8  * 1 DaemonSet for node-exporter.
     9  * 1 StatefulSet replica for loki server which requests "50Gi" storage.
    10  * 1 Deployment replica for grafana.
    11  * 1 Deployment replica for kube-state-metrics.
    12  * 1 Deployment replica for alertmanager.
    13  * 1 Deployment replica for pushgateway.
    14  * 1 Deployment replica for prometheus-server.
    15  
    16  ## How to use it
    17  
    18  Access the Grafana monitoring dashboard,you can run the kubectl port-forward command to access the Grafana monitoring
    19  dashboard,then open `http://localhost:3000` in your browser and log on with the default username and password.
    20  
    21  To get the admin user and password for the Grafana pod, run the following command:
    22  
    23  ```shell
    24  kubectl get secret -n promtail-loki-stack-system  loki-grafana -o jsonpath="{.data.admin-user}" | base64 --decode ; echo
    25  kubectl get secret -n promtail-loki-stack-system  loki-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo
    26  ```
    27  
    28  To access the Grafana UI, run the following command:
    29  
    30  `kubectl port-forward -n promtail-loki-stack-system svc/loki-grafana 3000:80`
    31  
    32  ## How to rebuild it use helm
    33  
    34  Kubefile:
    35  
    36  ```shell
    37  FROM registry.cn-qingdao.aliyuncs.com/sealer-apps/openebs-localpv:2.11.0
    38  # add helm repo and run helm install
    39  RUN helm repo add grafana https://grafana.github.io/helm-charts && helm repo update
    40  # set persistence.storageClass=local-hostpath, which is provided by base image openebs-localpv:2.11.0.
    41  CMD helm install --create-namespace --namespace promtail-loki-stack-system loki grafana/loki-stack --set grafana.enabled=true,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false,loki.persistence.enabled=true,loki.persistence.storageClassName=local-hostpath,loki.persistence.size=50Gi
    42  ```
    43  
    44  run below command to build it
    45  
    46  ```shell
    47  sealer build -t {Your Image Name} -f Kubefile -m cloud .
    48  ```
    49  
    50  More parameters see [official document here](https://grafana.github.io/helm-charts)