Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kaws: Deploying Kubernetes Clusters using AWS, CoreOS, Terraform, and Rust

8893e2e206c0377ff776d2535887d23f?s=47 Jimmy Cuadra
November 12, 2015

kaws: Deploying Kubernetes Clusters using AWS, CoreOS, Terraform, and Rust

kaws is a tool for deploying Kubernetes that provides production-grade clusters in a predictable, repeatable way.

8893e2e206c0377ff776d2535887d23f?s=128

Jimmy Cuadra

November 12, 2015
Tweet

Transcript

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

    @jimmycuadra
  2. KUBERNETES IS THE FUTURE

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

  4. None
  5. Reproducible infrastructure

  6. None
  7. 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" }
  8. $ terraform plan

  9. + 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>"
  10. $ terraform apply

  11. Provisioning

  12. Workflow

  13. INTRODUCING KAWS

  14. Goals

  15. Infrastructure as code

  16. Production grade Kubernetes clusters

  17. Secure access credentials

  18. Shell scripts

  19. None
  20. $ kaws init my-companys-infrastructure $ cd my-companys-infrastructure $ git init

  21. $ tree . !"" clusters !"" pubkeys #"" terraform #""

    main.tf
  22. $ cat terraform/main.tf module "kaws" { source = "github.com/InQuicker/kaws//terraform?ref=v0.1.0" ...

    }
  23. $ kaws key export jimmy@example.com

  24. $ tree . !"" clusters !"" pubkeys $ #"" jimmy@example.com.asc

    #"" terraform #"" main.tf
  25. $ 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
  26. $ 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
  27. $ kaws cluster apply staging

  28. kubernetes.example.com

  29. $ kaws admin create $ kaws admin sign $ kaws

    admin install
  30. OPEN SOURCED TODAY

  31. github.com/InQuicker/kaws

  32. THANK YOU @jimmycuadra

  33. QUESTIONS? @jimmycuadra