Secure Kubernetes Container Workloads
with Production-Grade Networking
Cynthia Thomas Irena Berezovsky Tim Hockin
Secure Kubernetes Container Workloads with Production-Grade - - PowerPoint PPT Presentation
Secure Kubernetes Container Workloads with Production-Grade Networking Cynthia Thomas Irena Berezovsky Tim Hockin CIA IT operations have top secret apps for their agents, most of which require isolation Antoni is in Ops and wants to help CIA
Cynthia Thomas Irena Berezovsky Tim Hockin
CIA IT operations have top secret apps for their agents, most of which require isolation
embrace DevOps
efficiently and deliver excellent apps
Antoni Berta
1. New project defined: Developer needs an environment 2. Dev asks SysAdmin for some resources 3. SysAdmin installs Server OS and asks Network people for a VLAN (ewww!) 4. Network people ask Security team to
∞. Someone plugs into wrong port or wrong requirements: start over!
The world before Neutron: can I plug in your cable?
The CIA IT takes weeks, even months to deliver isolated resources for the various projects at CIA. Servers and VLANs and firewalls, oh my!
Antoni & Berta were doing it the hard way
Folsom
agnostic API
topologies (vendor extensions)
LBaaS, VPNaaS, FWaaS
Neutron for higher layer network services
Operator (networking, security, etc) versus App Developer
the time to deliver compute resources
CIA to keep business units separate
can manage its own resources
OpenStack Networking on the fly at CIA
Guest OS App Libs Guest OS App Libs OS Hardware Hypervisor Guest OS App Libs
Can we do better?
Hypervisor If only there was a way to virtualize an OS to enable multiple workloads to run on a single OS...
container container container
Along came Docker
Containers are an alternative to VMs
Faster and lower overhead than VMs
Developer-focused
Ridiculously simple UX It’s the technology of the decade!
OS Hardware Libs App Libs App Libs App
CIA developers demand containers
Launch in milliseconds! Dev-Prod parity, on my laptop! MUST HAVE! But it is very chaotic -- they need need help managing it all...
Kubernetes changed everything
The Kubernetes API is app-centric
concerns
but don’t replace it
Networking is infrastructure, security is ops We still need to address the concerns of ops!
Kubernetes network model
Assumes a single, shared network space
Network plugins decide what technology
All connectivity is enabled by default Implicitly single tenant
Compare to Docker model:
“No, no, no! I can’t have my apps be reachable by Carlos’s team!”
Tension between dev and ops
Namespaces: Kubernetes
Scopes for named objects within a cluster
Logical grouping of related things
No relationship to nodes or networks
Seems like an obvious hook for networking
Kubernetes NetworkPolicy
API to lock down the network
Applies per Namespace
Network infrastructure can enforce it
Does not cover egress (yet?)
Kubernetes NetworkPolicy
apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: front-to-mid namespace: cia-spy-app spec: podSelector: matchLabels: role: middleware ingress:
port: 6379 from:
matchLabels: role: frontend apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: mid-to-db namespace: cia-spy-app spec: podSelector: matchLabels: role: db ingress:
port: 3306 from:
matchLabels: role: middleware
Kubernetes NetworkPolicy
apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: front-to-mid namespace: cia-spy-app spec: podSelector: matchLabels: role: middleware ingress:
port: 6379 from:
matchLabels: role: frontend apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: mid-to-db namespace: cia-spy-app spec: podSelector: matchLabels: role: db ingress:
port: 3306 from:
matchLabels: role: middleware
Kubernetes NetworkPolicy
apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: front-to-mid namespace: cia-spy-app spec: podSelector: matchLabels: role: middleware ingress:
port: 6379 from:
matchLabels: role: frontend apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: mid-to-db namespace: cia-spy-app spec: podSelector: matchLabels: role: db ingress:
port: 3306 from:
matchLabels: role: middleware
Kubernetes NetworkPolicy
apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: front-to-mid namespace: cia-spy-app spec: podSelector: matchLabels: role: middleware ingress:
port: 6379 from:
matchLabels: role: frontend apiVersion: extensions/v1beta1 kind: NetworkPolicy metadata: name: mid-to-db namespace: cia-spy-app spec: podSelector: matchLabels: role: db ingress:
port: 3306 from:
matchLabels: role: middleware
Where Neutron is ahead of k8s
Neutron Kubernetes
Multi Tenant environment Single Tenant Rich network topologies with overlapping IPs Flat, shared network with IP per pod Security Groups, Port Security (ARP Spoofing) Network Policy (ingress only) Port Quality of Service
Primarily application-centric API
Containers Challenges
emerged in the container orchestration and integration ecosystem
environment, networking becomes critical
and security
network
What is Kuryr?
networking abstraction that containers need
entities, performs API calls and manages the response to the
Kuryr as a translator between k8s and Neutron
to the Neutron API
networking under the same API
Neutron vendors, allowing them to provide advanced container networking by just having a binding script
Kubernetes Neutron Namespace Network, Subnet Pod Port Service Load Balancer External IP Floating IP Network Policy Security Groups
Example: CIA Security
Antoni can satisfy CIA security requirements with Kubernetes & Kuryr:
the application in terms of required deployment
application connectivity
Neutron constructs, and NetworkPolicy realization by Neutron security groups, true isolation and security is achieved via the Kubernetes API
Kubernetes + Kuryr + MidoNet: Scalable Neutron
Neutron plugin scaling with ease, and flexible API for fine-grain security policies
k8s-api)
python 3.4 library
How is MidoNet a Scalable Neutron Solution?
Example: CIA MidoNet deployment
Antoni uses MidoNet for his OpenStack Neutron plugin for production-grade networking
for the CIA with confidence with an HA solution
Antoni with every single network flow and each security policy applied
Example: CIA MidoNet deployment with kuryr-k8s
solution with MidoNet: https://docs.midonet.org/
deploy the k8s-master and k8s-worker to try MidoNet with k8s
while using the same operator tools
MidoNet-enhanced Security
Neutron Security Groups
MidoNet implements SG+:
and rules
matching/filtering and actions
Future of networking in Kubernetes
Multi-tenancy is probably unavoidable
Possible evolution:
Kuryr-Kubernetes status
○ Early stage ○ CNI Driver and k8s API watcher in progress
○ K8s Network Policy support ○ High Availability ○ Kuryr-openshift ○ Bridging OpenStack VMs and kuryr-k8s
MidoNet
Community Site www.midonet.org Project Git Repo https://github.com/midonet/midonet Join Slack slack.midonet.org
Try MidoNet with one command: $> curl -sL quickstart.midonet.org | sudo bash
Get Involved!
Kuryr
Community Site https://wiki.openstack.org/wiki/Kuryr Project Git Repo https://github.com/openstack/kuryr IRC weekly meeting https://wiki.openstack.org/wiki/Meetings/Kuryr
Kubernetes
Community Site http://kubernetes.io/community/ Project Git Repo https://github.com/kubernetes Join Slack slack.k8s.io/