kaws - deploying kubernetes clusters using aws, coreos, terraform and rust

Post on 22-Jan-2018

1.069 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

KAWS Deploying Kubernetes Clusters using AWS, CoreOS, Terraform, and Rust

@jimmycuadra

KUBERNETES IS THE FUTURE

$ export KUBERNETES_PROVIDER=aws $ curl -sS https://get.k8s.io | bash

Reproducible infrastructure

resource "aws_elb" "frontend" { name = "frontend-load-balancer" listener { instance_port = 8000 instance_protocol = "http" lb_port = 80 lb_protocol = "http" } instances = ["${aws_instance.app.*.id}"] } resource "aws_instance" "app" { count = 5 ami = "ami-043a5034" instance_type = "m1.small" }

$ terraform plan

+ aws_instance.example ami: "" => "ami-043a5034" availability_zone: "" => "<computed>" instance_type: "" => "m1.small" key_name: "" => "<computed>" private_dns: "" => "<computed>" private_ip: "" => "<computed>" public_dns: "" => "<computed>" public_ip: "" => "<computed>" security_groups: "" => "<computed>" subnet_id: "" => "<computed>"

$ terraform apply

Provisioning

Workflow

INTRODUCING KAWS

Goals

Infrastructure as code

Production grade Kubernetes clusters

Secure access credentials

Shell scripts

$ kaws init my-companys-infrastructure $ cd my-companys-infrastructure $ git init

$ tree . !"" clusters !"" pubkeys #"" terraform #"" main.tf

$ cat terraform/main.tf

module "kaws" { source = "github.com/InQuicker/kaws//terraform?ref=v0.1.0"

... }

$ kaws key export jimmy@example.com

$ tree . !"" clusters !"" pubkeys $   #"" jimmy@example.com.asc #"" terraform #"" main.tf

$ kaws cluster create staging \ --ami ami-1234 \ --domain example.com \ --kubernetes-version 1.0.7 \ --instance-size m3.medium \ --ssh-key deployer \ --uid jimmy@example.com \ --zone-id Z1D633PJN98FT9

$ tree . !"" clusters $   #"" staging $   !"" apiserver-key.pem.asc $   !"" apiserver.pem $   !"" ca-key.pem.asc $   !"" ca.pem $   !"" ca.srl $   !"" node-key.pem.asc $   !"" node.pem $   !"" openssl.cnf $   !"" terraform.tfstate $   #"" terraform.tfvars !"" pubkeys $   #"" jimmy@example.com.asc #"" terraform #"" main.tf

$ kaws cluster apply staging

kubernetes.example.com

$ kaws admin create

$ kaws admin sign

$ kaws admin install

OPEN SOURCED TODAY

github.com/InQuicker/kaws

THANK YOU@jimmycuadra

QUESTIONS?@jimmycuadra

top related