Public repo to distribute scripts and config's
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

23 lignes
742 B

  1. #!/bin/sh -e
  2. # This script will setup docker to push all newly created container logs to https://int.loki.grid.tf
  3. # NOTE: existing containers will need to be recreated to send their logs to Loki
  4. ### Install docker plugin
  5. docker plugin install grafana/loki-docker-driver:2.9.2 --alias loki --grant-all-permissions
  6. ### Edit docker daemon config file
  7. cat << EOF > /etc/docker/daemon.json
  8. {
  9. "debug" : true,
  10. "log-driver": "loki",
  11. "log-opts": {
  12. "loki-url": "https://int.loki.grid.tf/loki/api/v1/push",
  13. "loki-batch-size": "400"
  14. }
  15. }
  16. EOF
  17. ### Restart docker
  18. systemctl restart docker
  19. echo "Don't forget to recreate all containers that should send their logs to Loki! This config does not apply to existing containers"