Giter VIP home page Giter VIP logo

kube-whitelist-ingress-traffic's Introduction

Whitelist ingress traffic to Kubernetes

Example of a Jenkins deployment with ClusterIP using Traefik ingress controller to whitelist specific IP's

These instructions enable to create a Jenkins deployment with ClusterIP (Not exposed via LoadBalancer) and expose it to selected public IP's via Traefik ingress controller.

Install Jenkins with ClusterIP service

$ helm install jenkins-release --set Master.ServiceType=ClusterIP stable/jenkins

Install Traefik

$ helm install stable/traefik --name traefik-release --namespace kube-system

Patch Traefik service to enable X-Forwarded public IP's

$ kubectl patch service traefik-release-traefik -n kube-system --patch $'spec:\n externalTrafficPolicy: Local\n'

Edit ingress.yaml

Set the public ip's or range to whitelist.

Single IP: ingress.kubernetes.io/whitelist-source-range: "64.18.13.199/32"

Multiple IP ranges (Cloudflare for example): ingress.kubernetes.io/whitelist-source-range: "103.21.244.0/22,103.22.200.0/22,103.31.4.0/22,104.16.0.0/12,108.162.192.0/18,131.0.72.0/22,141.101.64.0/18,162.158.0.0/15,172.64.0.0/13,173.245.48.0/20,188.114.96.0/20,190.93.240.0/20,197.234.240.0/22,198.41.128.0/17"

Create Ingress controller with whitelist IP's

$ kubectl create -f ingress.yaml

kube-whitelist-ingress-traffic's People

Contributors

torosent 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.