Giter Club home page Giter Club logo

gke-nat-example's Introduction

GKE Cluster routing internet traffic through basic NAT

This set of scripts creates a Google Cloud Container Engine cluster that routes all outbound internet traffic. Traffic heading for the kubernetes master is routed at a higher priority through the default internet gateway. through a NAT instance.

How it works in a nutshell

  1. Creates a network
  2. Creates a subnet for the cluster
  3. Creates a subnet for the nat instance
  4. Creates a NAT compute instance
  5. Creates Firewall rules for NAT instance
  6. Creates the GKE cluster in the cluster's subnet created from step 2 with tag route-through-nat
  7. Creates the route from the cluster to the master for instances with tag, route-through-nat
  8. Creates the NAT route from the cluster to the NAT for all destinations at a lower priority than the master route above for instances with tag route-through-nat

Creating the cluster

Prerequisites
  1. Updated gcloud sdk
  2. Updated kubectl cli
  3. A Project in Google Cloud in which you want to deploy this cluster
  4. Authenticated to google cloud
Creating the network, subnets, nat, routes, firewall rules and gke cluster
$ git clone https://www.github.com/johnlabarge/gke-nat-example.git
$ cd gke-nat-example
$ ./create

This also runs a quick test for you by

  1. installing curl on the machine
  2. curling a well known website
  3. copying the captured traffic (tcpdump) logs from the Nat computer to the local directory.

Deleting the Cluster

Deleting the network, subnets, nat, routes, firewall rules and gke cluster

$ ./delete

gke-nat-example's People

Contributors

johnlabarge avatar

Watchers

James Cloos avatar Maksim Martianov 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.