Slide 1

Slide 1 text

@k2r2bai Vishwakarma: Terraform modules for deploying EKS and Self-hosting Kubernetes 1 ⽩凱仁(Kyle Bai)

Slide 2

Slide 2 text

@k2r2bai About Me ⽩凱仁(Kyle Bai) • Site Reliability Engineer at AMIS • Contributor to multiple OSS. • Certified Kubernetes Administrator/Developer. • Co-organizer of Cloud Native Taiwan User Group. • Interested in emerging technologies. @kairen https://k2r2bai.com

Slide 3

Slide 3 text

@k2r2bai Agenda Today I would like to talk about • Infrastructure as code • Vishwakarma • Live Demo

Slide 4

Slide 4 text

@k2r2bai Infrastructure as code

Slide 5

Slide 5 text

@k2r2bai "Infrastructure-as-code (IaC) is the concept of writing code to represent your infrastructure requirements and using an IaC tool to apply those changes to your cloud/on-prem environment."

Slide 6

Slide 6 text

@k2r2bai • Create/change/destroy infrastructure resources such as compute, storage, networking components or platform services like database, Kubernetes cluster etc. • Deploy/update applications on top of the infrastructure. • Manage the configurations used by the applications. • Versioning infrastructure. The problems IaC tools can solve

Slide 7

Slide 7 text

@k2r2bai

Slide 8

Slide 8 text

@k2r2bai

Slide 9

Slide 9 text

@k2r2bai

Slide 10

Slide 10 text

@k2r2bai Terraform is the only tool to focus solely on creating, destroying and managing infrastructure components. You use the Hashicorp Configuration Language (HCL) to describe the infrastructure resources you need. • Provider • Provisioner • Modules • Plan phase • Apply phase Terraform

Slide 11

Slide 11 text

@k2r2bai example

Slide 12

Slide 12 text

@k2r2bai

Slide 13

Slide 13 text

@k2r2bai CLI or Console Terraform CLI

Slide 14

Slide 14 text

@k2r2bai

Slide 15

Slide 15 text

@k2r2bai NGINX

Slide 16

Slide 16 text

@k2r2bai MyApp

Slide 17

Slide 17 text

@k2r2bai Vishwakarma

Slide 18

Slide 18 text

@k2r2bai Solutions on AWS Kubespray RKE Kops Kube-aws Typhoon Kubicorn CoreOS Tectonic LinuxKit Matchbox KubeNow Bootkube kubeadm-dind-cluster Minikube PKS Kubeadm KIND KRIB

Slide 19

Slide 19 text

@k2r2bai Challenges to build Kubrnetes

Slide 20

Slide 20 text

@k2r2bai Challenges to build Kubrnetes on AWS • Maintain all AWS resources(ex: EC2 instance, VPC). • Kubernetes node(worker) scalability. • Kubernetes components upgrade. • Logging and Monitoring. • Configuration management.

Slide 21

Slide 21 text

@k2r2bai • Network environment customize. • Align company compliance. • Audit. • Security. • Cost. • Clusters have difference topology. • Want more specific features. • .... Why build Kubernetes by ourselves?

Slide 22

Slide 22 text

@k2r2bai Vishwakarma can be used to create a Kubernetes cluster in AWS by leveraging HashiCorp Terraform and CoreOS. And there are two kind of Kubernetes master within vishwakarma, one leverages AWS EKS, the other one is ElastiKube (Self-Hosted). Vishwakarma

Slide 23

Slide 23 text

@k2r2bai ElastiKube is a highly configurable Terraform module with building blocks. The motivation to build ElastiKube is that we need: • Robust and HA Kubernetes master nodes. • Pluggable HA worker nodes with different instance types. • Configurable Kubernetes resources during bootstrapping. • Standalone and HA etcd. • Use CoreOS Container Linux on all host machines. • Use Ignition for provisioning Container Linux. What's ElastiKube?

Slide 24

Slide 24 text

@k2r2bai Ignition is the utility used by CoreOS Container Linux, Fedora CoreOS, and RHEL CoreOS to manipulate disks during the initramfs. This includes partitioning disks, formatting partitions, writing files (regular files, systemd units, etc.), and configuring users. Ignition

Slide 25

Slide 25 text

@k2r2bai

Slide 26

Slide 26 text

@k2r2bai Make sure that all resources are IMMUTABLE!

Slide 27

Slide 27 text

@k2r2bai Live demo

Slide 28

Slide 28 text

@k2r2bai What’s Going On?

Slide 29

Slide 29 text

@k2r2bai Q &A

Slide 30

Slide 30 text

@k2r2bai KAIREN OUT!! THANK YOU!!!