Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Consul use case

Consul use case

Share about Hashicorp Consul in our group.

F726c60218757a2e4b82a09c491af75a?s=128

k.yanagimoto

April 04, 2019
Tweet

More Decks by k.yanagimoto

Other Decks in Technology

Transcript

  1. Consul use case Apr 4, 2019 Koichi Yanagimoto EC Incubation

    Development Dept. Rakuten, Inc.
  2. Today’s Topic Today’s topic

  3. Who am I ? Koichi Yanagimoto @kyanagimoto Application Engineer Rakuten,

    Inc.
  4. 4 Consul? Service Discovery Service Segmentation Service Configuration

  5. 5 Consul?

  6. 6 Our use case

  7. 7 Our use case consul agent consul agent { "service":

    { "name": "varnish" } } consul_service.json consul agent -data-dir=/consul/data -retry-join=consul.server.ip -client=0.0.0.0
  8. 8 Our use case consul agent consul agent consul template

    consul-template \ -template "squid.ctmpl:/etc/squid.conf:/etc/squid/sbin/squid -f /etc/squid.conf -k reconfigure"
  9. 9 Squid.ctmpl http_port 80 accel http_port 81 accel vport=80 {{

    range service "varnish" }} cache_peer {{ .Address }} parent 8080 0 carp proxy-only no-digest no-query no-netdb-exchange weight=100 originserver {{ end }} include /etc/squid/image_space_common.conf cache_access_log /var/log/squid/access_image_space.log access_log_format cache_log /var/log/squid/response_image_space.log responce_log_format cache_swap_log /var/log/squid/cache_swap_image_space.log pid_filename /var/run/squid_image.pid
  10. 10 Our use case Kubernetes

  11. 11 DEMO

  12. None