Git Product home page Git Product logo

k8s-thi_ingress_traefik_haproxy's Introduction

Traefik with K8s Onpremise

Build Status SemaphoreCI Docs Go Report Card License


Diagram

Diagram

Features

  • Continuously updates its configuration (No restarts!)
  • Supports multiple load balancing algorithms
  • Provides HTTPS to your microservices by leveraging Let's Encrypt (wildcard certificates support)
  • Circuit breakers, retry
  • High Availability with cluster mode (beta)
  • See the magic through its clean web UI
  • Websocket, HTTP/2, GRPC ready
  • Provides metrics (Rest, Prometheus, Datadog, Statsd, InfluxDB)
  • Keeps access logs (JSON, CLF)
  • Fast
  • Exposes a Rest API
  • Packaged as a single binary file (made with ❤️ with go) and available as a tiny official docker image

Install HAPROXY

  • Updating System Packages on CentOS & Install Haproxy
sudo yum update
sudo yum install haproxy
  • We are going to create a configuration file /etc/haproxy/haproxy.cfg containing the necessary settings and configurations.
sudo vi /etc/haproxy/haproxy.cfg
global
   log /dev/log local0
   log /dev/log local1 notice
   chroot /var/lib/haproxy
   stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy
    daemon

defaults
     log global
     mode http
     option httplog
     option dontlognull
     timeout connect 5000
     timeout client 50000
     timeout server 50000

frontend http_front
     bind *:80
     stats uri /haproxy?stats
     default_backend http_back

backend http_back
     balance roundrobin
     server my_server private_IP:80 check
     server my_server private_IP:80 check
  • Next: restart HAProxy
sudo systemctl restart haproxy
sudo systemctl enable haproxy

Status

Working with K8s and Traefik

I assumed that you installed K8s cluster normally on your onpremise system, if not, visit here Install K8s in our documentation (you will need Docker and Patient :) ).

  • Note: all my command use alias which is k = kubectl
  1. Deploy Traefik to K8s: You can install by many many ways, mine is just for old version and it was what I've learn.

    • We will have 2 files: traefik-rbac.yaml & traefik-ds.yaml
    • Install them by using
      k apply -f traefik-rbac.yaml
      k apply -f traefik-ds.yaml
      
      k get all -n kube-system | grep traefik
      

    Status

k8s-thi_ingress_traefik_haproxy's People

Contributors

dinhdobathi1992 avatar nehhen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.