SlideShare a Scribd company logo
1 of 29
Kubernetes Configuration
Management
Lee Briggs
Principle Infrastructure Engineer
07/11/2018
© 2016 Apptio, All rights reserved (v2.5)2
$(whoami)
 Based in Seattle (formerly London)
 Work for Apptio
 We are hiring! (remote US, remote EMEA, remote APAC)
 Using Kubernetes since 2015
 We tried out v1.0. It was a bad idea.
 Multiple cluster over many environments/regions
 Github:
https://github.com/jaxxstorm
https://github.com/apptio
 Twitter:
https://twitter.com/briggsl
 Blog:
https://www.leebriggs.co.uk
What is Config Management?
© 2016 Apptio, All rights reserved (v2.5)4
Quick Overview
 Remove “snowflakes”
 Hand crafted servers in your environment
 Provision New Servers
 Version control of Server configuration
 Replication of server environments
© 2016 Apptio, All rights reserved (v2.5)5
Cfg Mgmt Players
Enter Kubernetes
Or insert your fav orchestrator here
© 2016 Apptio, All rights reserved (v2.5)7
Configuration Layer
 With the classic tools, the configuration layer is the server
 Apps, config and resources are managed at the individual server level
 K8s provides an abstraction layer above many servers
 API Driven
 Idempotent
 Convergent
 Lots of orgs run only a few clusters
 Configuring the clusters relatively straightforward.
 K8s solves a lot of the server config mgmt. problem
 DaemonSets are a good example here
© 2016 Apptio, All rights reserved (v2.5)8
“Components”
 Components is a term we use to describe a thing that runs on
Kubernetes that is needed for a cluster to be useful
 Examples of components:
 Ingress Controller: https://github.com/kubernetes/ingress-nginx
 Cluster Autoscaler: https://github.com/kubernetes/autoscaler
 Sealed Secrets: https://github.com/bitnami-labs/sealed-secrets
 RBAC Config: https://kubernetes.io/docs/reference/access-authn-authz/rbac/
 Prometheus: https://prometheus.io/
 These components are vital for an operating cluster
 We need to install them on all clusters!
© 2016 Apptio, All rights reserved (v2.5)9
Components: What’s the problem?
 A lot of the config for these components is the same
 But, a lot is slightly different:
 Path to the SSL certificate for the Ingress Controller
 List of endpoints to scrape for Prometheus
 RBAC config between dev and prod
 ASG names for cluster autoscaler
 Different namespaces on different clusters
 How can you manage this using the traditional config management tools?
 Spoiler Alert: You can’t!
The Contenders
© 2016 Apptio, All rights reserved (v2.5)11
Helm
 Helm seems to be the #1 tool for this
 Lots of helm charts written by the community
 Allows you to set “values” for config in manifests
 You can specify these values via the cmdline or via a yaml based “values” file
 Templated Golang
 Relatively shallow learning curve
© 2016 Apptio, All rights reserved (v2.5)12
Helm: The downsides
 Helm is a security nightmare
 Cluster admin access for tiller!
 Helm 3 addressing this
 Managing values files doesn’t help
 You end up with lots of <dc>-values.yml for each DC
 Templated Golang is a not fun
 Having to range through values with templates became a chore
 Once you have all the config, how do you apply it to multiple clusters?
 You need to specify the right values file for each cluster
 We tried to use ansible and puppet for this, but it didn’t work
© 2016 Apptio, All rights reserved (v2.5)13
Helm: The downsides
© 2016 Apptio, All rights reserved (v2.5)14
Ansible
 Ansible supports using clusters as endpoints
 You simply define the API endpoint when using kubernetes manifests
 Has a k8s_raw module which can be used
 This allows you to hit specific endpoints when running ansible
 Also has a helm module
 Unfortunately it’s very broken
© 2016 Apptio, All rights reserved (v2.5)15
Ansible: The downsides
 Ansible uses yaml
 K8s already has us in yaml hell 
 You’re changing one yaml templating tool (Golang) with another (jinja2)
 Templating yaml is not fun
 Using the k8s_raw module meant fully writing all deployments
 You can’t easily make use of existing helm charts
 You would need to write and then retemplate all the config you’d need 
 Anecdotally, setting up python for the required libraries wasn’t very fun
© 2016 Apptio, All rights reserved (v2.5)16
Terraform
 Terraform has a nice HCL language construct
 Makes writing JSON much easier
 Has a Kubernetes & Helm Provider
 The Kubernetes provider is ”official”
 The Helm provider is community based
 Is easily extensible
© 2016 Apptio, All rights reserved (v2.5)17
Terraform: The downsides
 Both the helm and kubernetes provider weren’t very active
 No merges for a long time
 Seemed extremely buggy
 Often would error hitting APIs
 Because the k8s API changes slightly with each release, issues occurred
 For example, as APIs moved from beta to stable, the provider needs updating
 It needs to be continuously updated for each k8s release
© 2016 Apptio, All rights reserved (v2.5)18
Some other options:
 Ksonnet
 Seemed promising
 Dramatically overcomplicated
 You have to use the ksonnet ecosystem and way of deploying
 Kapitan
 Jinja2 templates 
 Was very promising conceptually
 Has to be pure jsonnet, no support for existing helm templates etc ]
 Pulumi
 Relatively new player in this space
 Terraform based
 Requires subscription to use now 
© 2016 Apptio, All rights reserved (v2.5)19
Jsonnet
 It became clear very quickly that using jsonnet was desirable
 Language written by Google specifically for interacting with JSON
 Used in both ksonnet and kapitan
 Has Golang wrappers, easy to embed into Go apps
 External variables mean ability to template JSON
 Pass in a variable at compile time, it changes the JSON
kr8
© 2016 Apptio, All rights reserved (v2.5)21
Design Goals
 Simple
 As few moving parts as possible
 Only write parts we can’t find
 We are a very small team, we don’t want to manage a large codebase
 Opinionated
 We wanted to enforce a structure that works for us
 Helps when fixing bugs
 Flexible
 Ability to render components based on Helm or any other yaml source input
© 2016 Apptio, All rights reserved (v2.5)22
What is kr8?
 Attempt to leverage the power of jsonnet
 Render jsonnet and other things into usable manifests for each cluster
 Written in Go
 Open Source!
 Features:
 Automatic population of jsonnet external variables
 Automatic concatenation of jsonnet files
 Ability to patch helm charts
 Uses jsonnet to render yaml, then patches the json on top of that
 Ability to leverage other config tools like Kasane and Kustomize
© 2016 Apptio, All rights reserved (v2.5)23
Other Automation Components
 Task: https://github.com/go-task/task
 Like Make. Written in Go. Takes yaml/json config
 Instead of writing makefiles, we make templated jsonnet taskfiles
 Helm: https://helm.sh/
 We use helm charts, render them locally and then patch them with jsonnet
 Kubecfg: https://github.com/ksonnet/kubecfg
 Applies manifests in a sane way
 Can use ”garbage collection” to remove unused manifests
Kr8 Walkthrough
Enhancements
© 2016 Apptio, All rights reserved (v2.5)26
Future Tasks
 Split components into separate repos
 Allow them to be downloaded like Terraform modules
 Unit Tests
 Documentation
 Pull requests welcome!
© 2016 Apptio, All rights reserved (v2.5)27
Links
 Introductory Blogpost: https://leebriggs.co.uk/blog/2018/11/07/kr8-
kubernetes-config-mgmt.html
 kr8: https://github.com/apptio/kr8
 Example Configs: https://github.com/apptio/kr8-configs
 My Configs! https://github.com/jaxxstorm/cluster_config
Thankyou!
Colin Spargo
Sanyu Melwani
Shawn Xue
THANK YOU

More Related Content

What's hot

GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)Weaveworks
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDSunnyvale
 
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)DataWorks Summit
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondRamon Ribeiro Rabello
 
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019Jarek Potiuk
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Nisheed Jagadish
 
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesJenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesTed Won
 
From java monolith to kubernetes microservices - an open source journey with ...
From java monolith to kubernetes microservices - an open source journey with ...From java monolith to kubernetes microservices - an open source journey with ...
From java monolith to kubernetes microservices - an open source journey with ...Ryan Dawson
 
Spring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCFSpring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCFLars Rosenquist
 
Visual Studio로 Kubernetes 사용하기
Visual Studio로 Kubernetes 사용하기Visual Studio로 Kubernetes 사용하기
Visual Studio로 Kubernetes 사용하기충섭 김
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profilingjoncham
 
Handling Kubernetes Resources
Handling Kubernetes ResourcesHandling Kubernetes Resources
Handling Kubernetes ResourcesOlivier Boukili
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJSFestUA
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull RequestKasper Nissen
 
Openstack benelux 2015
Openstack benelux 2015Openstack benelux 2015
Openstack benelux 2015Microsoft
 
老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具Shengyou Fan
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene GroeschkeCodeFest
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitWeaveworks
 
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin ServerlessShengyou Fan
 

What's hot (20)

GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)GitOps Toolkit (Cloud Native Nordics Tech Talk)
GitOps Toolkit (Cloud Native Nordics Tech Talk)
 
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCDKubernetes GitOps featuring GitHub, Kustomize and ArgoCD
Kubernetes GitOps featuring GitHub, Kustomize and ArgoCD
 
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)
Introducing Kubeflow (w. Special Guests Tensorflow and Apache Spark)
 
Android Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyondAndroid Jetpack + Coroutines: To infinity and beyond
Android Jetpack + Coroutines: To infinity and beyond
 
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019
What's Coming in Apache Airflow 2.0 - PyDataWarsaw 2019
 
Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0Brief introduction to Angular 2.0 & 4.0
Brief introduction to Angular 2.0 & 4.0
 
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on KubernetesJenkins X - automated CI/CD solution for cloud native applications on Kubernetes
Jenkins X - automated CI/CD solution for cloud native applications on Kubernetes
 
From java monolith to kubernetes microservices - an open source journey with ...
From java monolith to kubernetes microservices - an open source journey with ...From java monolith to kubernetes microservices - an open source journey with ...
From java monolith to kubernetes microservices - an open source journey with ...
 
Spring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCFSpring Boot & Spring Cloud on k8s and PCF
Spring Boot & Spring Cloud on k8s and PCF
 
Visual Studio로 Kubernetes 사용하기
Visual Studio로 Kubernetes 사용하기Visual Studio로 Kubernetes 사용하기
Visual Studio로 Kubernetes 사용하기
 
IL2CPP: Debugging and Profiling
IL2CPP: Debugging and ProfilingIL2CPP: Debugging and Profiling
IL2CPP: Debugging and Profiling
 
Handling Kubernetes Resources
Handling Kubernetes ResourcesHandling Kubernetes Resources
Handling Kubernetes Resources
 
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for RustJS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
JS Fest 2019/Autumn. Алексей Орленко. Node.js N-API for Rust
 
GitOps - Operation By Pull Request
GitOps - Operation By Pull RequestGitOps - Operation By Pull Request
GitOps - Operation By Pull Request
 
JFall 2018 k8s patterns
JFall 2018 k8s patternsJFall 2018 k8s patterns
JFall 2018 k8s patterns
 
Openstack benelux 2015
Openstack benelux 2015Openstack benelux 2015
Openstack benelux 2015
 
老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具老派浪漫:用 Kotlin 寫 Command Line 工具
老派浪漫:用 Kotlin 寫 Command Line 工具
 
Rene Groeschke
Rene GroeschkeRene Groeschke
Rene Groeschke
 
The Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps ToolkitThe Power of GitOps with Flux & GitOps Toolkit
The Power of GitOps with Flux & GitOps Toolkit
 
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
[Kotlin Serverless 工作坊] 單元 2 - 簡介 Kotlin Serverless
 

Similar to Kube cfg-mgmt

Sensu and Kubernetes 1.x
Sensu and Kubernetes 1.xSensu and Kubernetes 1.x
Sensu and Kubernetes 1.xSensu Inc.
 
Sensu 1.x & kubernetes
Sensu 1.x & kubernetesSensu 1.x & kubernetes
Sensu 1.x & kubernetesLee Briggs
 
Syncevolution: Open Source and Funambol
Syncevolution: Open Source and FunambolSyncevolution: Open Source and Funambol
Syncevolution: Open Source and FunambolFunambol
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kuberneteskloia
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegelermfrancis
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetesGabriel Carro
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateAdam John
 
Heroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyHeroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyJérémy Wimsingues
 
AOT(Ahead Of Time)
AOT(Ahead Of Time)AOT(Ahead Of Time)
AOT(Ahead Of Time)Questpond
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on OpenstackOpen Stack
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Diego Zuluaga
 
Web componenet using angular element
Web componenet using angular elementWeb componenet using angular element
Web componenet using angular elementHimanshu Tamrakar
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...Amazon Web Services
 
Node.js primer for ITE students
Node.js primer for ITE studentsNode.js primer for ITE students
Node.js primer for ITE studentsQuhan Arunasalam
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트Amazon Web Services Korea
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Puppet
 

Similar to Kube cfg-mgmt (20)

Sensu and Kubernetes 1.x
Sensu and Kubernetes 1.xSensu and Kubernetes 1.x
Sensu and Kubernetes 1.x
 
Sensu 1.x & kubernetes
Sensu 1.x & kubernetesSensu 1.x & kubernetes
Sensu 1.x & kubernetes
 
Syncevolution: Open Source and Funambol
Syncevolution: Open Source and FunambolSyncevolution: Open Source and Funambol
Syncevolution: Open Source and Funambol
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
AKS: k8s e azure
AKS: k8s e azureAKS: k8s e azure
AKS: k8s e azure
 
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten ZiegelerNew and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
New and cool in OSGi R7 - David Bosschaert & Carsten Ziegeler
 
Introduction to kubernetes
Introduction to kubernetesIntroduction to kubernetes
Introduction to kubernetes
 
Microsoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New UpdateMicrosoft .NET 6 -What's All About The New Update
Microsoft .NET 6 -What's All About The New Update
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Heroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success storyHeroku to Kubernetes & Gihub to Gitlab success story
Heroku to Kubernetes & Gihub to Gitlab success story
 
AOT(Ahead Of Time)
AOT(Ahead Of Time)AOT(Ahead Of Time)
AOT(Ahead Of Time)
 
PaaS on Openstack
PaaS on OpenstackPaaS on Openstack
PaaS on Openstack
 
Sst hackathon express
Sst hackathon expressSst hackathon express
Sst hackathon express
 
Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0Apigee deploy grunt plugin.1.0
Apigee deploy grunt plugin.1.0
 
Web componenet using angular element
Web componenet using angular elementWeb componenet using angular element
Web componenet using angular element
 
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
AWS Greengrass, Containers, and Your Dev Process for Edge Apps (GPSWS404) - A...
 
Node.js primer for ITE students
Node.js primer for ITE studentsNode.js primer for ITE students
Node.js primer for ITE students
 
resume
resumeresume
resume
 
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
AWS 고객사를 위한 ‘AWS 컨테이너 교육’ - 유재석, AWS 솔루션즈 아키텍트
 
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
Scalable Cloud-Native Masterless Puppet, with PuppetDB and Bolt, Craig Watson...
 

Recently uploaded

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Recently uploaded (20)

Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Kube cfg-mgmt

  • 1. Kubernetes Configuration Management Lee Briggs Principle Infrastructure Engineer 07/11/2018
  • 2. © 2016 Apptio, All rights reserved (v2.5)2 $(whoami)  Based in Seattle (formerly London)  Work for Apptio  We are hiring! (remote US, remote EMEA, remote APAC)  Using Kubernetes since 2015  We tried out v1.0. It was a bad idea.  Multiple cluster over many environments/regions  Github: https://github.com/jaxxstorm https://github.com/apptio  Twitter: https://twitter.com/briggsl  Blog: https://www.leebriggs.co.uk
  • 3. What is Config Management?
  • 4. © 2016 Apptio, All rights reserved (v2.5)4 Quick Overview  Remove “snowflakes”  Hand crafted servers in your environment  Provision New Servers  Version control of Server configuration  Replication of server environments
  • 5. © 2016 Apptio, All rights reserved (v2.5)5 Cfg Mgmt Players
  • 6. Enter Kubernetes Or insert your fav orchestrator here
  • 7. © 2016 Apptio, All rights reserved (v2.5)7 Configuration Layer  With the classic tools, the configuration layer is the server  Apps, config and resources are managed at the individual server level  K8s provides an abstraction layer above many servers  API Driven  Idempotent  Convergent  Lots of orgs run only a few clusters  Configuring the clusters relatively straightforward.  K8s solves a lot of the server config mgmt. problem  DaemonSets are a good example here
  • 8. © 2016 Apptio, All rights reserved (v2.5)8 “Components”  Components is a term we use to describe a thing that runs on Kubernetes that is needed for a cluster to be useful  Examples of components:  Ingress Controller: https://github.com/kubernetes/ingress-nginx  Cluster Autoscaler: https://github.com/kubernetes/autoscaler  Sealed Secrets: https://github.com/bitnami-labs/sealed-secrets  RBAC Config: https://kubernetes.io/docs/reference/access-authn-authz/rbac/  Prometheus: https://prometheus.io/  These components are vital for an operating cluster  We need to install them on all clusters!
  • 9. © 2016 Apptio, All rights reserved (v2.5)9 Components: What’s the problem?  A lot of the config for these components is the same  But, a lot is slightly different:  Path to the SSL certificate for the Ingress Controller  List of endpoints to scrape for Prometheus  RBAC config between dev and prod  ASG names for cluster autoscaler  Different namespaces on different clusters  How can you manage this using the traditional config management tools?  Spoiler Alert: You can’t!
  • 11. © 2016 Apptio, All rights reserved (v2.5)11 Helm  Helm seems to be the #1 tool for this  Lots of helm charts written by the community  Allows you to set “values” for config in manifests  You can specify these values via the cmdline or via a yaml based “values” file  Templated Golang  Relatively shallow learning curve
  • 12. © 2016 Apptio, All rights reserved (v2.5)12 Helm: The downsides  Helm is a security nightmare  Cluster admin access for tiller!  Helm 3 addressing this  Managing values files doesn’t help  You end up with lots of <dc>-values.yml for each DC  Templated Golang is a not fun  Having to range through values with templates became a chore  Once you have all the config, how do you apply it to multiple clusters?  You need to specify the right values file for each cluster  We tried to use ansible and puppet for this, but it didn’t work
  • 13. © 2016 Apptio, All rights reserved (v2.5)13 Helm: The downsides
  • 14. © 2016 Apptio, All rights reserved (v2.5)14 Ansible  Ansible supports using clusters as endpoints  You simply define the API endpoint when using kubernetes manifests  Has a k8s_raw module which can be used  This allows you to hit specific endpoints when running ansible  Also has a helm module  Unfortunately it’s very broken
  • 15. © 2016 Apptio, All rights reserved (v2.5)15 Ansible: The downsides  Ansible uses yaml  K8s already has us in yaml hell   You’re changing one yaml templating tool (Golang) with another (jinja2)  Templating yaml is not fun  Using the k8s_raw module meant fully writing all deployments  You can’t easily make use of existing helm charts  You would need to write and then retemplate all the config you’d need   Anecdotally, setting up python for the required libraries wasn’t very fun
  • 16. © 2016 Apptio, All rights reserved (v2.5)16 Terraform  Terraform has a nice HCL language construct  Makes writing JSON much easier  Has a Kubernetes & Helm Provider  The Kubernetes provider is ”official”  The Helm provider is community based  Is easily extensible
  • 17. © 2016 Apptio, All rights reserved (v2.5)17 Terraform: The downsides  Both the helm and kubernetes provider weren’t very active  No merges for a long time  Seemed extremely buggy  Often would error hitting APIs  Because the k8s API changes slightly with each release, issues occurred  For example, as APIs moved from beta to stable, the provider needs updating  It needs to be continuously updated for each k8s release
  • 18. © 2016 Apptio, All rights reserved (v2.5)18 Some other options:  Ksonnet  Seemed promising  Dramatically overcomplicated  You have to use the ksonnet ecosystem and way of deploying  Kapitan  Jinja2 templates   Was very promising conceptually  Has to be pure jsonnet, no support for existing helm templates etc ]  Pulumi  Relatively new player in this space  Terraform based  Requires subscription to use now 
  • 19. © 2016 Apptio, All rights reserved (v2.5)19 Jsonnet  It became clear very quickly that using jsonnet was desirable  Language written by Google specifically for interacting with JSON  Used in both ksonnet and kapitan  Has Golang wrappers, easy to embed into Go apps  External variables mean ability to template JSON  Pass in a variable at compile time, it changes the JSON
  • 20. kr8
  • 21. © 2016 Apptio, All rights reserved (v2.5)21 Design Goals  Simple  As few moving parts as possible  Only write parts we can’t find  We are a very small team, we don’t want to manage a large codebase  Opinionated  We wanted to enforce a structure that works for us  Helps when fixing bugs  Flexible  Ability to render components based on Helm or any other yaml source input
  • 22. © 2016 Apptio, All rights reserved (v2.5)22 What is kr8?  Attempt to leverage the power of jsonnet  Render jsonnet and other things into usable manifests for each cluster  Written in Go  Open Source!  Features:  Automatic population of jsonnet external variables  Automatic concatenation of jsonnet files  Ability to patch helm charts  Uses jsonnet to render yaml, then patches the json on top of that  Ability to leverage other config tools like Kasane and Kustomize
  • 23. © 2016 Apptio, All rights reserved (v2.5)23 Other Automation Components  Task: https://github.com/go-task/task  Like Make. Written in Go. Takes yaml/json config  Instead of writing makefiles, we make templated jsonnet taskfiles  Helm: https://helm.sh/  We use helm charts, render them locally and then patch them with jsonnet  Kubecfg: https://github.com/ksonnet/kubecfg  Applies manifests in a sane way  Can use ”garbage collection” to remove unused manifests
  • 26. © 2016 Apptio, All rights reserved (v2.5)26 Future Tasks  Split components into separate repos  Allow them to be downloaded like Terraform modules  Unit Tests  Documentation  Pull requests welcome!
  • 27. © 2016 Apptio, All rights reserved (v2.5)27 Links  Introductory Blogpost: https://leebriggs.co.uk/blog/2018/11/07/kr8- kubernetes-config-mgmt.html  kr8: https://github.com/apptio/kr8  Example Configs: https://github.com/apptio/kr8-configs  My Configs! https://github.com/jaxxstorm/cluster_config

Editor's Notes

  1. “Server config mgmt” mainly Talk about days of servers being managed by hand/shell scripts
  2. You still need cfg mgmt. to deploy kubernetes components! Kubeadm etc Once deployed, there are k8s resources like DaemonSets for deploying container services to many nodes Why might you have lots of clusters?
  3. Why would we have multiple clusters?
  4. If you thought about the last problem, you probably thought about helm
  5. It didn’t work because puppet isn’t cluster aware, only machine aware Ansible’s helm module doesn’t work at all  Golang templates/helm3/lua Helm only solves the packaging of the app, it doesn’t solve the problem of which components to which clusters
  6. It’s ansible :trollface:
  7. If you haven’t accidentally destroyed all your infra with terraform, are you really using it at all?
  8. Heptio Quote: I have no idea what they’re doing with ksonnet
  9. Kasane is another deployment tool by Google Helm chart merge time is high
  10. Kasane is another deployment tool by Google Helm chart merge time is high
  11. Colin: Inventor* Sanyu: Contributor Shawn: Contributor