SlideShare a Scribd company logo
Deep dive into
Kubernetes Networking
Sreenivas Makam
Partner Engineer @Google Cloud
@Container conference, 3rd Aug 2018
Agenda
● Single pod networking
● Pod to pod Networking(East-West traffic)
● Service discovery and load balancing
● External access(North-South traffic)
● Network policy
● Istio service mesh
● Multi-cluster and hybrid cloud
● Best practises
Pods
● Small group of tightly-coupled
containers
● Every pod has a unique IP
● Share same namespace and
volume
● Share same lifecycle
● Use cases for multi-container pods -
Sidecars, proxies/adapters
Example: File puller & web server
Consumers
Content
Manager
File
Puller
Web
Server
Volume
Pod
Single Pod Networking
Communication across pods in different nodes
Kubernetes supports different networking approaches to do pod networking
Plugins can be added using CNI
Type/Features L2 L3 Overlay Cloud
Summary Pods
communicate
using L2
Pod traffic is
routed in underlay
network
Pod traffic is
encapsulated and uses
underlay for reachability
Pod traffic is routed
in cloud virtual
network
Underlying
technology
L2 arp, broadcast Routing protocol
like BGP
VXLAN Pre-programmed
fabric using
controller(eg: GKE)
Encapsulation No double
encapsulation
No double
encapsulation
Double encapsulation No double
encapsulation
Examples Calico Flannel, Weave GKE, ACS, EKS
L2 approach
L3 approach
Overlay approach
Services
● A service is a group of endpoints (usually pods)
grouped by selector
● Services provide a stable VIP (except Headless)
● VIP automatically routes to backend pods
● VIP to backend pod mapping is managed by
kube-proxy, implemented using iptables
Client
Virtual IP
apiVersion: v1
kind: Service
metadata:
name: productpage
spec:
selector:
app: productpage
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
DNS
● Service Discovery achieved by SkyDNS
● SkyDNS runs as a pod in the cluster
apiserverwatch
etcd
kube2skyskyDNS
Service communication
● Service IP is accessible only from within the cluster
● Type “ClusterIP” is used for internal communication within the cluster
● Traffic sent to Service IP gets load balanced to pods that belong to service IP
● Source NAT is used for pods to communicate to external world
● IPtables are used extensively for load balancing and NAT
● Nodeport, Network load balancer and Ingress controller are service types for
external world to reach services inside the cluster.
Service external reachability options
Feature Nodeport Load balancer Ingress
Summary Service is exposed
using a reserved port in
all nodes of
cluster(Default:
32000-32767)
Typically implemented
as network load
balancer
Typically implemented
as http load balancer
IP address Node IP is used for
external communication
Each service needs to
have own external IP
Many services can
share same external IP,
uses path based demux
Use Case Demo purposes L3 services L7 services
Examples GKE Network load
balancer
GKE http load balancer,
nginx, Istio
Nodeport
apiVersion: v1
kind: Service
metadata:
name: productpage
labels:
app: productpage
spec:
type: NodePort
ports:
- port: 30000
targetPort: 9080
selector:
app: productpage
Load balancer
apiVersion: v1
kind: Service
metadata:
name: productpage
labels:
app: productpage
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 9080
selector:
app: productpage
Ingress apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gateway
spec:
backend:
serviceName: productpage
servicePort: 9080
rules:
- host: mydomain.com
http:
paths:
- path: /productpage
backend:
serviceName: productpage
servicePort: 9080
- path: /login
backend:
serviceName: productpage
servicePort: 9080
- path: /*
backend:
serviceName: productpage
servicePort: 9080
Network control policy
Controls communication between Pods and Services
● Traffic is by default allowed without network policy
● Kubernetes network policies are allow policies, there is no deny policy
● Empty pod selector selects all pods
● Ingress and egress rules are available to control traffic
● Traffic is allowed if atleast 1 policy allows traffic
● Network plugins like Calico, Weavenet support network policies. GKE uses
calico
Network control policy example1
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: hello-allow-from-product
spec:
policyTypes:
- Ingress
podSelector:
matchLabels:
app: reviews
ingress:
- from:
- podSelector:
matchLabels:
app: productpage
Product Reviews
Details Ratings
Network control policy example2
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: hello-allow-from-product
spec:
policyTypes:
- Ingress
podSelector:
matchLabels:
app: reviews
ingress: []
Product Reviews
Details Ratings
Book review App
Istio is an open framework for connecting,
securing, managing and monitoring
services
Traffic control Observability Fault-injectionSecurity Hybrid cloud
What is Istio?
What can Istio do?
Istio Architecture
Traffic transparently proxied —
unaware of proxies
Pilot Mixer
Discovery & config
data to proxies
TLS certs
to proxies
Policy checks,
telemetry
Proxy
Frontend
Proxy
Payments
Citadel
Istio Control Plane
Book review App(with Istio)
Compare Network control policy with Istio
Multi-cluster
Use- cases:
● 1 cluster serving as DR for another cluster
● CI/CD between Dev and production clusters
● Global load balancing across multiple clusters
● Ability for 1 cluster to consume services from another cluster
Requirements:
● Common control plane across clusters
● Service discovery across clusters
● Load balancing traffic across replicas in different clusters
● Common policy management across clusters - RBAC, Quota etc
Multicluster/Hybrid cloud use cases
S1 S2 S1 S2
Disaster Recovery
S1 S2 S1 S2
Dev/Prod setup
CI/CD
S1 S2 S1 S2
Load balance across regions
LB
Region1 Region2
S1 S2 S1 S2
Cloud bursting
Consume services across cluster
S4
S3
Multi-cluster deployment options
● Kubernetes Federated cluster
○ Have a single Kubernetes control plane that spans multiple clusters
○ Controlled using Kubefed
○ Service discovery works across clusters
● Istio Multicluster
○ Istio control plane that spans across multiple clusters
○ Kubernetes control plane limited to single cluster
○ Service discovery works across clusters
○ Istio ingress takes care of load balancing external traffic across clusters
● Managed service from cloud providers (eg: GCP Cloud services platform)
GCP Hybrid cloud Kubernetes solution
Kubernetes Networking - Best practises
● Use namespaces for multi-tenancy
● Use Ingress rather than Load balancer to expose
services. This is to preserve resources
● Do not expose cluster to outside world if its not needed
● Create security policies like IAM, RBAC, Network control
in the beginning rather than later
● Put emphasis on resource control including quotas,
priorities/preemption etc
Demo
Demo code and instructions:
https://github.com/smakam/gcp/tree/master/gke/containerconfbglr18
References
● The Ins and Outs of Kubernetes and GKE networking presentation
● Understanding Kubernetes Networking
● Kubernetes networking concepts
● Enforcing network policies with Kubernetes
● Building hybrid clouds with Istio
● Kubernetes Nodeport vs Loadbalancer vs Ingress
● https://github.com/thesandlord/Istio101
Note:
Some pictures used were borrowed from above blog posts

More Related Content

What's hot (20)

PPTX
Introduction to the Container Network Interface (CNI)
Weaveworks
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Kubernetes Networking 101
Weaveworks
 
PDF
Kubernetes 101
Crevise Technologies
 
PDF
Kubernetes Networking
CJ Cullen
 
PDF
Kubernetes Basics
Eueung Mulyana
 
PDF
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
PDF
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
PDF
An Introduction to Kubernetes
Imesh Gunaratne
 
PPTX
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
PPTX
Kubernetes Basics
Rishabh Kumar
 
PDF
Helm 3
Matthew Farina
 
PPTX
Kubernetes Workshop
loodse
 
PDF
Kubernetes - introduction
Sparkbit
 
PPTX
Introduction to CNI (Container Network Interface)
HungWei Chiu
 
PPTX
Service Discovery In Kubernetes
Knoldus Inc.
 
PPTX
DevOps with Kubernetes
EastBanc Tachnologies
 
PDF
Kubernetes Deployment Strategies
Abdennour TM
 
PDF
An overview of the Kubernetes architecture
Igor Sfiligoi
 
PPTX
Kubernetes 101 for Beginners
Oktay Esgul
 
Introduction to the Container Network Interface (CNI)
Weaveworks
 
Introduction to Kubernetes Workshop
Bob Killen
 
Kubernetes Networking 101
Weaveworks
 
Kubernetes 101
Crevise Technologies
 
Kubernetes Networking
CJ Cullen
 
Kubernetes Basics
Eueung Mulyana
 
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
SlideTeam
 
An Introduction to Kubernetes
Imesh Gunaratne
 
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
Kubernetes Basics
Rishabh Kumar
 
Kubernetes Workshop
loodse
 
Kubernetes - introduction
Sparkbit
 
Introduction to CNI (Container Network Interface)
HungWei Chiu
 
Service Discovery In Kubernetes
Knoldus Inc.
 
DevOps with Kubernetes
EastBanc Tachnologies
 
Kubernetes Deployment Strategies
Abdennour TM
 
An overview of the Kubernetes architecture
Igor Sfiligoi
 
Kubernetes 101 for Beginners
Oktay Esgul
 

Similar to Deep dive into Kubernetes Networking (20)

PDF
Kubernetes Networking 101 kubecon EU 2022
ssuser1490e8
 
PDF
Meetup 2023 - Gateway API.pdf
Red Hat
 
PDF
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
Ambassador Labs
 
PPTX
DevOps Fest 2019. Stanislav Kolenkin. Сonnecting pool Kubernetes clusters: Fe...
DevOps_Fest
 
PDF
Container network security
Daisuke Nakajima
 
PPTX
Nynog-K8s-networking-101.pptx
DanielHertzberg4
 
PDF
Networking in Kubernetes
Minhan Xia
 
PPTX
Open stackaustinmeetupsept21
Brent Doncaster
 
PPTX
Kubernetes from the ground up
Sander Knape
 
PDF
Cncf k8s_network_02
Erhwen Kuo
 
PDF
Deep dive in container service discovery
Docker, Inc.
 
PPTX
KuberNETes - meetup
Nathan Ness
 
PPTX
KubernetSADASDASDASDSADASDASDASDASDes.pptx
MuhamedAhmed35
 
PDF
prodops.io k8s presentation
Prodops.io
 
PDF
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
Quinton Hoole
 
PDF
Intro to Kubernetes
Joonathan Mägi
 
PDF
LISA2017 Kubernetes: Hit the Ground Running
Chris McEniry
 
PDF
Services in kubernetes-KnolX .pdf
Knoldus Inc.
 
PDF
Builders' Day- Mastering Kubernetes on AWS
Amazon Web Services LATAM
 
PDF
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Kubernetes Networking 101 kubecon EU 2022
ssuser1490e8
 
Meetup 2023 - Gateway API.pdf
Red Hat
 
The Simply Complex Task of Implementing Kubernetes Ingress - Velocity NYC
Ambassador Labs
 
DevOps Fest 2019. Stanislav Kolenkin. Сonnecting pool Kubernetes clusters: Fe...
DevOps_Fest
 
Container network security
Daisuke Nakajima
 
Nynog-K8s-networking-101.pptx
DanielHertzberg4
 
Networking in Kubernetes
Minhan Xia
 
Open stackaustinmeetupsept21
Brent Doncaster
 
Kubernetes from the ground up
Sander Knape
 
Cncf k8s_network_02
Erhwen Kuo
 
Deep dive in container service discovery
Docker, Inc.
 
KuberNETes - meetup
Nathan Ness
 
KubernetSADASDASDASDSADASDASDASDASDes.pptx
MuhamedAhmed35
 
prodops.io k8s presentation
Prodops.io
 
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
Quinton Hoole
 
Intro to Kubernetes
Joonathan Mägi
 
LISA2017 Kubernetes: Hit the Ground Running
Chris McEniry
 
Services in kubernetes-KnolX .pdf
Knoldus Inc.
 
Builders' Day- Mastering Kubernetes on AWS
Amazon Web Services LATAM
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
Ad

More from Sreenivas Makam (20)

PDF
GKE Tip Series - Usage Metering
Sreenivas Makam
 
PDF
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
Sreenivas Makam
 
PDF
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam
 
PDF
My kubernetes toolkit
Sreenivas Makam
 
PDF
Top 3 reasons why you should run your Enterprise workloads on GKE
Sreenivas Makam
 
PDF
How Kubernetes helps Devops
Sreenivas Makam
 
PPTX
Docker Networking Tip - Load balancing options
Sreenivas Makam
 
PPTX
Docker Networking Tip - Macvlan driver
Sreenivas Makam
 
PPTX
Docker Networking Overview
Sreenivas Makam
 
PPTX
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
PPTX
Compare Docker deployment options in the public cloud
Sreenivas Makam
 
PPTX
Docker Mentorweek beginner workshop notes
Sreenivas Makam
 
PPTX
Devops in Networking
Sreenivas Makam
 
PPTX
Docker Security Overview
Sreenivas Makam
 
PPTX
Docker 1.11 Presentation
Sreenivas Makam
 
PPTX
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
PPTX
CoreOS Overview and Current Status
Sreenivas Makam
 
PPTX
Container Monitoring with Sysdig
Sreenivas Makam
 
PPTX
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
PPTX
Docker 1.9 Feature Overview
Sreenivas Makam
 
GKE Tip Series - Usage Metering
Sreenivas Makam
 
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
Sreenivas Makam
 
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam
 
My kubernetes toolkit
Sreenivas Makam
 
Top 3 reasons why you should run your Enterprise workloads on GKE
Sreenivas Makam
 
How Kubernetes helps Devops
Sreenivas Makam
 
Docker Networking Tip - Load balancing options
Sreenivas Makam
 
Docker Networking Tip - Macvlan driver
Sreenivas Makam
 
Docker Networking Overview
Sreenivas Makam
 
Docker Networking - Common Issues and Troubleshooting Techniques
Sreenivas Makam
 
Compare Docker deployment options in the public cloud
Sreenivas Makam
 
Docker Mentorweek beginner workshop notes
Sreenivas Makam
 
Devops in Networking
Sreenivas Makam
 
Docker Security Overview
Sreenivas Makam
 
Docker 1.11 Presentation
Sreenivas Makam
 
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
CoreOS Overview and Current Status
Sreenivas Makam
 
Container Monitoring with Sysdig
Sreenivas Makam
 
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
Docker 1.9 Feature Overview
Sreenivas Makam
 
Ad

Recently uploaded (20)

PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 

Deep dive into Kubernetes Networking

  • 1. Deep dive into Kubernetes Networking Sreenivas Makam Partner Engineer @Google Cloud @Container conference, 3rd Aug 2018
  • 2. Agenda ● Single pod networking ● Pod to pod Networking(East-West traffic) ● Service discovery and load balancing ● External access(North-South traffic) ● Network policy ● Istio service mesh ● Multi-cluster and hybrid cloud ● Best practises
  • 3. Pods ● Small group of tightly-coupled containers ● Every pod has a unique IP ● Share same namespace and volume ● Share same lifecycle ● Use cases for multi-container pods - Sidecars, proxies/adapters Example: File puller & web server Consumers Content Manager File Puller Web Server Volume Pod
  • 5. Communication across pods in different nodes Kubernetes supports different networking approaches to do pod networking Plugins can be added using CNI Type/Features L2 L3 Overlay Cloud Summary Pods communicate using L2 Pod traffic is routed in underlay network Pod traffic is encapsulated and uses underlay for reachability Pod traffic is routed in cloud virtual network Underlying technology L2 arp, broadcast Routing protocol like BGP VXLAN Pre-programmed fabric using controller(eg: GKE) Encapsulation No double encapsulation No double encapsulation Double encapsulation No double encapsulation Examples Calico Flannel, Weave GKE, ACS, EKS
  • 9. Services ● A service is a group of endpoints (usually pods) grouped by selector ● Services provide a stable VIP (except Headless) ● VIP automatically routes to backend pods ● VIP to backend pod mapping is managed by kube-proxy, implemented using iptables Client Virtual IP apiVersion: v1 kind: Service metadata: name: productpage spec: selector: app: productpage type: ClusterIP ports: - port: 80 targetPort: 8080 protocol: TCP
  • 10. DNS ● Service Discovery achieved by SkyDNS ● SkyDNS runs as a pod in the cluster apiserverwatch etcd kube2skyskyDNS
  • 11. Service communication ● Service IP is accessible only from within the cluster ● Type “ClusterIP” is used for internal communication within the cluster ● Traffic sent to Service IP gets load balanced to pods that belong to service IP ● Source NAT is used for pods to communicate to external world ● IPtables are used extensively for load balancing and NAT ● Nodeport, Network load balancer and Ingress controller are service types for external world to reach services inside the cluster.
  • 12. Service external reachability options Feature Nodeport Load balancer Ingress Summary Service is exposed using a reserved port in all nodes of cluster(Default: 32000-32767) Typically implemented as network load balancer Typically implemented as http load balancer IP address Node IP is used for external communication Each service needs to have own external IP Many services can share same external IP, uses path based demux Use Case Demo purposes L3 services L7 services Examples GKE Network load balancer GKE http load balancer, nginx, Istio
  • 13. Nodeport apiVersion: v1 kind: Service metadata: name: productpage labels: app: productpage spec: type: NodePort ports: - port: 30000 targetPort: 9080 selector: app: productpage
  • 14. Load balancer apiVersion: v1 kind: Service metadata: name: productpage labels: app: productpage spec: type: LoadBalancer ports: - port: 80 targetPort: 9080 selector: app: productpage
  • 15. Ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: name: gateway spec: backend: serviceName: productpage servicePort: 9080 rules: - host: mydomain.com http: paths: - path: /productpage backend: serviceName: productpage servicePort: 9080 - path: /login backend: serviceName: productpage servicePort: 9080 - path: /* backend: serviceName: productpage servicePort: 9080
  • 16. Network control policy Controls communication between Pods and Services ● Traffic is by default allowed without network policy ● Kubernetes network policies are allow policies, there is no deny policy ● Empty pod selector selects all pods ● Ingress and egress rules are available to control traffic ● Traffic is allowed if atleast 1 policy allows traffic ● Network plugins like Calico, Weavenet support network policies. GKE uses calico
  • 17. Network control policy example1 kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: hello-allow-from-product spec: policyTypes: - Ingress podSelector: matchLabels: app: reviews ingress: - from: - podSelector: matchLabels: app: productpage Product Reviews Details Ratings
  • 18. Network control policy example2 kind: NetworkPolicy apiVersion: networking.k8s.io/v1 metadata: name: hello-allow-from-product spec: policyTypes: - Ingress podSelector: matchLabels: app: reviews ingress: [] Product Reviews Details Ratings
  • 20. Istio is an open framework for connecting, securing, managing and monitoring services Traffic control Observability Fault-injectionSecurity Hybrid cloud What is Istio? What can Istio do?
  • 21. Istio Architecture Traffic transparently proxied — unaware of proxies Pilot Mixer Discovery & config data to proxies TLS certs to proxies Policy checks, telemetry Proxy Frontend Proxy Payments Citadel Istio Control Plane
  • 23. Compare Network control policy with Istio
  • 24. Multi-cluster Use- cases: ● 1 cluster serving as DR for another cluster ● CI/CD between Dev and production clusters ● Global load balancing across multiple clusters ● Ability for 1 cluster to consume services from another cluster Requirements: ● Common control plane across clusters ● Service discovery across clusters ● Load balancing traffic across replicas in different clusters ● Common policy management across clusters - RBAC, Quota etc
  • 25. Multicluster/Hybrid cloud use cases S1 S2 S1 S2 Disaster Recovery S1 S2 S1 S2 Dev/Prod setup CI/CD S1 S2 S1 S2 Load balance across regions LB Region1 Region2 S1 S2 S1 S2 Cloud bursting Consume services across cluster S4 S3
  • 26. Multi-cluster deployment options ● Kubernetes Federated cluster ○ Have a single Kubernetes control plane that spans multiple clusters ○ Controlled using Kubefed ○ Service discovery works across clusters ● Istio Multicluster ○ Istio control plane that spans across multiple clusters ○ Kubernetes control plane limited to single cluster ○ Service discovery works across clusters ○ Istio ingress takes care of load balancing external traffic across clusters ● Managed service from cloud providers (eg: GCP Cloud services platform)
  • 27. GCP Hybrid cloud Kubernetes solution
  • 28. Kubernetes Networking - Best practises ● Use namespaces for multi-tenancy ● Use Ingress rather than Load balancer to expose services. This is to preserve resources ● Do not expose cluster to outside world if its not needed ● Create security policies like IAM, RBAC, Network control in the beginning rather than later ● Put emphasis on resource control including quotas, priorities/preemption etc
  • 29. Demo Demo code and instructions: https://github.com/smakam/gcp/tree/master/gke/containerconfbglr18
  • 30. References ● The Ins and Outs of Kubernetes and GKE networking presentation ● Understanding Kubernetes Networking ● Kubernetes networking concepts ● Enforcing network policies with Kubernetes ● Building hybrid clouds with Istio ● Kubernetes Nodeport vs Loadbalancer vs Ingress ● https://github.com/thesandlord/Istio101 Note: Some pictures used were borrowed from above blog posts