项目作者: sagittaros

项目描述 :
HA, Private DNS, Private Topology Kops Cluster
高级语言: HCL
项目地址: git://github.com/sagittaros/kubernetes-aws-vpc-terraform.git
创建时间: 2018-05-04T16:57:20Z
项目社区:https://github.com/sagittaros/kubernetes-aws-vpc-terraform

开源协议:Apache License 2.0

下载


Kops-Terraform Starter on AWS VPC

HA, Private DNS, Private Topology Kubernetes Kops Cluster

Customize terraform/variables.tf, terraform/main.tf and kops/02_create_cluster to suit your need.

Project uses 3 AZs, each AZ has a private and public subnet for kops private subnet and kops utility subnet respectively. More details please see Subnet Design Document

Usage

The steps to create a kops cluster using this starter project:

  1. Setup IAM user and make sure AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY is present
  2. Create a S3 bucket as Kops state store, refer my script here
  3. Create a S3 bucket as Terraform Backend, then customize it at main.tf
  4. Customize terraform using variables.tf
  5. Create a private hosted zone (optional) on Route53
  6. Create a public hosted zone on Route53 Details
  7. Follow numbered kops/*.sh to create kops cluster and save to terraform/k8s
  8. Go to terraform and run terraform init; terraform plan; terraform apply;
  9. Make sure you have api.DOMAIN and bastion.DOMAIN in your public DNS zone.
  10. run kops validate cluster

Check the pods running in kube_system by running kubectl get pod --namespace kube-system

  1. NAME READY STATUS RESTARTS AGE
  2. dns-controller-7954c48879-qxlfv 1/1 Running 0 48m
  3. etcd-server-events-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 4 47m
  4. etcd-server-events-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 4 48m
  5. etcd-server-events-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 5 47m
  6. etcd-server-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 1 48m
  7. etcd-server-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
  8. etcd-server-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 2 46m
  9. kube-apiserver-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 2 48m
  10. kube-apiserver-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 47m
  11. kube-apiserver-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
  12. kube-controller-manager-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
  13. kube-controller-manager-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
  14. kube-controller-manager-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
  15. kube-dns-7785f4d7dc-sw8sr 3/3 Running 0 46m
  16. kube-dns-7785f4d7dc-vd8fm 3/3 Running 0 48m
  17. kube-dns-autoscaler-787d59df8f-rb5g2 1/1 Running 0 48m
  18. kube-proxy-ip-10-1-136-100.ap-southeast-1.compute.internal 1/1 Running 0 47m
  19. kube-proxy-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
  20. kube-proxy-ip-10-1-144-200.ap-southeast-1.compute.internal 1/1 Running 0 46m
  21. kube-proxy-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
  22. kube-proxy-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
  23. kube-proxy-ip-10-1-174-66.ap-southeast-1.compute.internal 1/1 Running 0 47m
  24. kube-scheduler-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
  25. kube-scheduler-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
  26. kube-scheduler-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 47m
  27. weave-net-4h5t7 2/2 Running 0 47m
  28. weave-net-9drwh 2/2 Running 0 48m
  29. weave-net-bnzjt 2/2 Running 2 47m
  30. weave-net-fnmrs 2/2 Running 0 48m
  31. weave-net-l2spt 2/2 Running 0 47m
  32. weave-net-l8tpf 2/2 Running 0 47m

WeaveNet is baked in! Now you have a fully functional kops cluster!

Versions

Terraform v0.11.7

Kops v1.9.0

Kubernetes v1.9.3

Credits

This starter project is inspired by an article written by Kasper Nissen

Terraform syntax is inspired by ryane