Kubernetes in production – how to avoid the pitfalls!

A presentation at Cloud Connect in February 2021 in by Horacio Gonzalez

Slide 1

Slide 1

Kubernetes in production: avoiding the pitfalls Horacio Gonzalez

Slide 2

Slide 2

Who are we? Introducing ourselves and introducing OVHcloud

Slide 3

Slide 3

Horacio Gonzalez @LostInBrittany Spaniard lost in Brittany, developer, dreamer and all-around geek Flutter

Slide 4

Slide 4

OVHcloud: A Global Leader 200k Private cloud VMs running Dedicated 1 IaaS Europe Hosting capacity : 1.3M Physical Servers 360k Servers already deployed 30 Datacenters Own 20Tbps Netwok with 35 PoPs

1.4M Customers in 138 Countries

Slide 5

Slide 5

OVHcloud: 4 Universes of Products WebCloud Domain / Email Baremetal Cloud Compute Standalone, Cluster VM Domain names, DNS, SSL, Redirect General Purpose Email, Open-Xchange, Exchange Collaborative Tools, NextCloud Baremetal SuperPlan Game T2 >20e Virtualization Mutu, CloudWeb Plesk, CPanel Database T4 >300e Bigdata T5 >600e HCI AI 12KVA /32KVA VDI Cloud Game PaaS with Platform.sh Network VPS aaS MarketPlace Storage File, Block, Object, Archive VMware SDDC, vSAN 1AZ / 2AZ vCD, Tanzu, Horizon, DBaaS, DRaaS Nutanix HCI 1AZ / 2AZ, Databases, DRaaS, VDI Databases SQL, noSQL, Messaging, Dashboard IP FO, NAT, LB, VPN, Router, DNS, DHCP, TCP/SSL Offload Virtuozzo Cloud Security Wordpress, Magento, Prestashop CRM, Billing, Payment, Stats PaaS for DevOps Network pCC DC SaaS K8S, IA IaaS OpenStack IAM, Compute (VM, K8S) Stortage, Network, Databases Storage Ontap Select, Nutanix File Virtual servers VPS, Dedicated Server Hosted Private Cloud Hosted Private Cloud T3 >80e Storage PaaS for Web Public Cloud Wholesales IAM, MFA, Encrypt, KMS Support, Managed High Intensive CPU/GPU, Support Basic Encrypt Support thought Partners KMS, HSM Managed services Encrypt (SGX, Network, Storage) AI ElementAI, HuggingFace, Deepopmatic, Systran, EarthCube Bigdata / Analitics / ML Cloudera over S3, Dataiku, Saagie, Tableau, IT Integrators, Cloud Storage, CDN, Database, ISV, WebHosting OpenIO, MinIO, CEPH Zerto, Veeam, Atempo IA, DL Hybrid Cloud Standard Tools for AI, AI Studio, vRack Connect, Edge-DC, Private DC IA IaaS, Hosting API AI Dell, HP, Cisco, OCP, MultiCloud Bigdata, ML, Analytics Datalake, ML, Dashboard Secured Cloud GOV, FinTech, Retail, HealtCare

Slide 6

Slide 6

Orchestrating containers Like herding cats… but in hard mode!

Slide 7

Slide 7

From bare metal to containers Another paradigm shift

Slide 8

Slide 8

Containers are easy… For developers

Slide 9

Slide 9

Less simple if you must operate them Like in a production context

Slide 10

Slide 10

And what about microservices? Are you sure you want to operate them by hand?

Slide 11

Slide 11

Taming microservices with Kubernetes

Slide 12

Slide 12

Desired State Management

Slide 13

Slide 13

Having identical, software defined environments

Slide 14

Slide 14

I have deployed on Minikube, woah! A great fastlane into Kubernetes

Slide 15

Slide 15

Running a full K8s in your laptop A great learning tool

Slide 16

Slide 16

Your laptop isn’t a true cluster Don’t expect real performances

Slide 17

Slide 17

Beyond the first deployment So I’ve deployed my distributed architecture on K8s, everything is good now, isn’t it?

Slide 18

Slide 18

Minikube is only the beginning

Slide 19

Slide 19

From Minikube to prod A journey not for the faint of heart

Slide 20

Slide 20

Kubernetes can be wonderful For both developers and devops

Slide 21

Slide 21

But it comes with a price…

Slide 22

Slide 22

An example among many others

Slide 23

Slide 23

An example among many others

Slide 24

Slide 24

An example among many others

Slide 25

Slide 25

An example among many others

Slide 26

Slide 26

An example among many others

Slide 27

Slide 27

The truth is somewhere inside…

Slide 28

Slide 28

A network example: KubeProxy KubeProxy: 3 proxy modes ● Userspace ● IPTables ● IPVS

Slide 29

Slide 29

A network example: KubeProxy iptables by default

Slide 30

Slide 30

A network example: KubeProxy

Slide 31

Slide 31

A network example: KubeProxy Cluster networking will be slower and slower

Slide 32

Slide 32

A network example: KubeProxy IPVS to the rescue!

Slide 33

Slide 33

Kubernetes networking is complex…

Slide 34

Slide 34

The storage dilemma

Slide 35

Slide 35

The storage dilemma Volumes are handle through CSI CSI provide an interface between Kubernetes and storage technologie

Slide 36

Slide 36

The storage dilemma Most CSI assume perfect sync between Kubernetes and the storage backend

Slide 37

Slide 37

The storage dilemma Storage backend are subject to errors or maintenance Potential state shifts between storage and Kubernetes

Slide 38

Slide 38

The ETCD vulnerability

Slide 39

Slide 39

Security Hardening your Kubernetes

Slide 40

Slide 40

The security journey

Slide 41

Slide 41

Kubernetes is insecure by design* It’s a feature, not a bug. Up to K8s admin to secure it according to needs

Slide 42

Slide 42

Not everybody has the same security needs

Slide 43

Slide 43

Kubernetes allows to enforce security practices as needed

Slide 44

Slide 44

Listing some good practices

Slide 45

Slide 45

Close open access Close all by default, open only the needed ports Follow the least privileged principle

Slide 46

Slide 46

Define and implement RBAC According to your needs

Slide 47

Slide 47

Define and implement network policies

Slide 48

Slide 48

Use RBAC and Network Policies to isolate your sensitive workload

Slide 49

Slide 49

Always keep up to date Both Kubernetes and plugins

Slide 50

Slide 50

Because Kubernetes is a big target

Slide 51

Slide 51

And remember, even the best can get hacked Remain attentive, don’t get too confident

Slide 52

Slide 52

Extensibility Enhance your Kubernetes

Slide 53

Slide 53

Kubernetes is modular Let’s see how some of those plugins can help you

Slide 54

Slide 54

Helm A package management for K8s

Slide 55

Slide 55

Complex deployments

Slide 56

Slide 56

Using static YAML files

Slide 57

Slide 57

Complex deployments

Slide 58

Slide 58

Istio A service mesh for Kubernetes… and much more!

Slide 59

Slide 59

Istio: A service mesh… but not only

Slide 60

Slide 60

Service discovery

Slide 61

Slide 61

Traffic control

Slide 62

Slide 62

Encrypting internal communications

Slide 63

Slide 63

Routing and load balancing

Slide 64

Slide 64

Rolling upgrades

Slide 65

Slide 65

Rolling upgrades

Slide 66

Slide 66

A/B testing

Slide 67

Slide 67

Monitoring your cluster

Slide 68

Slide 68

Velero Backing up your Kubernetes

Slide 69

Slide 69

Kubernetes: Desired State Management

Slide 70

Slide 70

YAML files allows to clone a cluster

Slide 71

Slide 71

But what about the data?

Slide 72

Slide 72

Velero Backup and migrate Kubernetes applications and their persistent volumes

Slide 73

Slide 73

S3 based backup On any S3 protocol compatible store

Slide 74

Slide 74

Backup all or part of a cluster

Slide 75

Slide 75

Schedule backups

Slide 76

Slide 76

Backups hooks

Slide 77

Slide 77

Conclusion And one more thing…

Slide 78

Slide 78

Kubernetes is easy to begin with Minikube, K3s…

Slide 79

Slide 79

Kubernetes is powerful It can make Developers’ and DevOps’ lives easier

Slide 80

Slide 80

But there is a price: operating it Lot of things to think about

Slide 81

Slide 81

We have seen some of them

Slide 82

Slide 82

Different roles Each role asks for very different knowledge and skill sets

Slide 83

Slide 83

Operating a Kubernetes cluster is hard But we have a good news…

Slide 84

Slide 84

Most companies don’t need to do it! As they don’t build and rack their own servers!

Slide 85

Slide 85

If you don’t need to build it, choose a certified managed solution You get the cluster, the operator get the problems

Slide 86

Slide 86

Like our OVH Managed Kubernetes Made with 💗 by the Platform team

Slide 87

Slide 87

Thank you for listening!