github.com/alibaba/sealer@v0.8.6-0.20220430115802-37a2bdaa8173/applications/loki-stack-promtail/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 dashboard,then open `http://localhost:3000` in your browser and log on with the default username and password. 19 20 To get the admin user and password for the Grafana pod, run the following command: 21 22 ```shell 23 kubectl get secret -n promtail-loki-stack-system promtail-grafana -o jsonpath="{.data.admin-user}" | base64 --decode ; echo 24 kubectl get secret -n promtail-loki-stack-system promtail-grafana -o jsonpath="{.data.admin-password}" | base64 --decode ; echo 25 ``` 26 27 To access the Grafana UI, run the following command: 28 29 ```shell 30 kubectl port-forward -n promtail-loki-stack-system svc/promtail-grafana 3000:80 31 ``` 32 33 ## How to rebuild it use helm 34 35 Kubefile: 36 37 ```shell 38 FROM longhorn:v1.2.3 39 40 CMD helm repo add grafana https://grafana.github.io/helm-charts && helm repo update 41 42 CMD helm install --create-namespace --namespace fluentbit-loki-stack-system fluent-bit grafana/loki-stack --set fluent-bit.enabled=true,promtail.enabled=false,grafana.enabled=true,prometheus.enabled=true,prometheus.alertmanager.persistentVolume.enabled=false,prometheus.server.persistentVolume.enabled=false,loki.persistence.enabled=true,loki.persistence.storageClassName=longhorn,loki.persistence.size=50Gi 43 ``` 44 45 run below command to build it 46 47 ```shell 48 sealer build -t {Your Image Name} -f Kubefile -m cloud . 49 ``` 50 51 More parameters see [official document here](https://grafana.github.io/helm-charts)