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
The steps to create a kops cluster using this starter project:
- Setup IAM user and make sure
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
is present - Create a S3 bucket as Kops state store, refer my script here
- Create a S3 bucket as Terraform Backend, then customize it at
main.tf
- Customize
terraform
usingvariables.tf
- Create a private hosted zone (optional) on Route53
- Create a public hosted zone on Route53 Details
- Follow numbered kops/*.sh to create kops cluster and save to
terraform/k8s
- Go to
terraform
and runterraform init; terraform plan; terraform apply;
- Make sure you have api.DOMAIN and bastion.DOMAIN in your public DNS zone.
- run kops validate cluster
Check the pods running in kube_system by running kubectl get pod --namespace kube-system
NAME READY STATUS RESTARTS AGE
dns-controller-7954c48879-qxlfv 1/1 Running 0 48m
etcd-server-events-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 4 47m
etcd-server-events-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 4 48m
etcd-server-events-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 5 47m
etcd-server-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 1 48m
etcd-server-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
etcd-server-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 2 46m
kube-apiserver-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 2 48m
kube-apiserver-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-apiserver-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
kube-controller-manager-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-controller-manager-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
kube-controller-manager-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
kube-dns-7785f4d7dc-sw8sr 3/3 Running 0 46m
kube-dns-7785f4d7dc-vd8fm 3/3 Running 0 48m
kube-dns-autoscaler-787d59df8f-rb5g2 1/1 Running 0 48m
kube-proxy-ip-10-1-136-100.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-proxy-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-proxy-ip-10-1-144-200.ap-southeast-1.compute.internal 1/1 Running 0 46m
kube-proxy-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
kube-proxy-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 46m
kube-proxy-ip-10-1-174-66.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-scheduler-ip-10-1-142-70.ap-southeast-1.compute.internal 1/1 Running 0 47m
kube-scheduler-ip-10-1-147-202.ap-southeast-1.compute.internal 1/1 Running 0 48m
kube-scheduler-ip-10-1-164-244.ap-southeast-1.compute.internal 1/1 Running 0 47m
weave-net-4h5t7 2/2 Running 0 47m
weave-net-9drwh 2/2 Running 0 48m
weave-net-bnzjt 2/2 Running 2 47m
weave-net-fnmrs 2/2 Running 0 48m
weave-net-l2spt 2/2 Running 0 47m
weave-net-l8tpf 2/2 Running 0 47m
WeaveNet is baked in! Now you have a fully functional kops cluster!
Terraform v0.11.7
Kops v1.9.0
Kubernetes v1.9.3
This starter project is inspired by an article written by Kasper Nissen
Terraform syntax is inspired by ryane