GithubHelp home page GithubHelp logo

walmartdigital / k8s-lb-module Goto Github PK

View Code? Open in Web Editor NEW
0.0 11.0 2.0 54 KB

[DEPRECATED] An Azure Load Balancer Terraform module for K8s Cluster.

HCL 100.00%
azure terraform rke terraform-modules k8s-cluster

k8s-lb-module's Introduction

Azure Load Balancer Module

This module create all required resources for deploy a public and a private load balancer on Azure. If more tnah one ip and load balancer its needed ** USE STANDARD SKU**.

Usage

Create a public load balancer

module "az_lb" {
  source = "git::https://github.com/walmartdigital/k8s-lb-module.git?ref=0.1.0"

  resource_group = "my-resource-group"
  cluster_name   = "my-cluster-name"
  environment    = "staging"
  name_suffix    = "abc123"

  lb_ports = {
    http  = ["80", "Tcp", "80", "80"]
    https = ["443", "Tcp", "443", "443"]
  }
}

Create a private load balancer with public and private ips

First its needed define the ips that will be used by the load balancer rules. They can be as many public and private ips as are needed:

  public_ips = {
    cockroach = {
      name = "cockroach"
      target = "workers"
    }
  }

  private_ips = {
    dns = {
      name = "dns"
      target = "workers"
      address_allocation = "Dynamic"
      ip_address = ""
    }
  }

The must be added the load balancer rules and set the visibility and the ip (frontend) that will be used:

  lb_ports = [
    {
      name = "dns"
      port = "53"
      protocol = "Udp"
      lb_rule_port_kube_dns = data.consul_keys.input.var.lb_rule_port_kube_dns
      lb_rule_port_kube_dns_probe = data.consul_keys.input.var.lb_rule_port_kube_dns_probe
      health = ""
      target = "workers"
      frontend = "dns"
      visibility = "private"
    },
    {
      name = "grpc"
      port = "26257"
      protocol = "Tcp"
      lb_rule_port_kube_dns = data.consul_keys.input.var.lb_rule_port_grpc
      lb_rule_port_kube_dns_probe = data.consul_keys.input.var.lb_rule_port_grpc
      health = ""
      target = "workers"
      frontend = "cockroach"
      visibility = "public"
    },
    {
      name = "http"
      port = "8080"
      protocol = "Tcp"
      lb_rule_port_kube_dns = data.consul_keys.input.var.lb_rule_port_http
      lb_rule_port_kube_dns_probe = data.consul_keys.input.var.lb_rule_port_http
      health =  "/health"
      target = "workers"
      frontend = "cockroach"
      visibility = "public"
    }
  ]

Arguments

  • resource_group: A string representing the resource group where all resources will be provisioned, this resource group needs to be previously created (required).

  • cluster_name: A string used as the cluster name.

  • environment: A string used as environment where the cluster is deployed.

  • name_suffix: A string used as name suffix.

  • lb_type: A string used as the load balancer type. Default is public. If the load balancer type is private, you need to provide the following string variables: subnet_id (required), frontend_private_ip_address_allocation (optional) and frontend_private_ip_address (optional).

  • lb_ports: A list of map used to provide the load balancer rules, each item is a list, and the value is a map with the following fields:

    • name
    • port
    • protocol
    • lb_rule_port_kube_dns
    • lb_rule_port_kube_dns_probe
    • health
    • target
    • frontend
    • visibility

Outputs

  • load_balancer_public_ip: The load balancer public IP.
  • load_balancer_private_ip: The load balancer private IP.
  • lb_address_pool_id: The load balancer address pool ID.

k8s-lb-module's People

Contributors

chindou77 avatar maxguzman avatar maximilianoguzman avatar raestrada avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

rvsramkumar

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.