All Projects → ryane → Kubernetes Aws Vpc Kops Terraform

ryane / Kubernetes Aws Vpc Kops Terraform

Code for Deploy Kubernetes in an Existing AWS VPC with Kops and Terraform blog post

Labels

Projects that are alternatives of or similar to Kubernetes Aws Vpc Kops Terraform

Terraform Aws Wireguard
Terraform module to deploy WireGuard on AWS
Stars: ✭ 72 (-15.29%)
Mutual labels:  hcl
Terraform
Terraform - Beginners | Intermediate | Advanced
Stars: ✭ 77 (-9.41%)
Mutual labels:  hcl
Terraform Ansible
Working on a webinar series on Terraform and Ansible on AWS
Stars: ✭ 84 (-1.18%)
Mutual labels:  hcl
Gitops Terraform Jenkins
GitOps Workflow with Jenkins and Terraform
Stars: ✭ 73 (-14.12%)
Mutual labels:  hcl
Dockeroverlays
Stars: ✭ 75 (-11.76%)
Mutual labels:  hcl
Proxy Benchmarks
Benchmarks for several proxies
Stars: ✭ 79 (-7.06%)
Mutual labels:  hcl
Terraform Aws Vpc Peering
Terraform module to create a peering connection between two VPCs in the same AWS account.
Stars: ✭ 70 (-17.65%)
Mutual labels:  hcl
Terraform Aws S3 Website
Terraform Module for Creating S3 backed Websites and Route53 DNS
Stars: ✭ 85 (+0%)
Mutual labels:  hcl
Gcp Terraform Workshop
Introduction to provisioning basic infrastructure on Google Cloud Platform with Terraform
Stars: ✭ 76 (-10.59%)
Mutual labels:  hcl
Terraform
Stars: ✭ 84 (-1.18%)
Mutual labels:  hcl
Terraform Aws Couchbase
Reusable infrastructure modules for running Couchbase on AWS
Stars: ✭ 73 (-14.12%)
Mutual labels:  hcl
Tf aws elasticsearch
Terraform module which creates AWS Elasticsearch resources
Stars: ✭ 73 (-14.12%)
Mutual labels:  hcl
Mikado
🤖💨Mikado helps managing your AWS infrastructure for WordPress sites by defining an out-of-box, highly available, easy-to-deploy setup
Stars: ✭ 80 (-5.88%)
Mutual labels:  hcl
Tf Jitsi
5-minute self-hosted Jitsi on AWS
Stars: ✭ 73 (-14.12%)
Mutual labels:  hcl
Terraform Aws Ecs Codepipeline
Terraform Module for CI/CD with AWS Code Pipeline and Code Build for ECS https://cloudposse.com/
Stars: ✭ 85 (+0%)
Mutual labels:  hcl
Kubeadm Aws
Bootstrap a Kubernetes cluster on AWS using Terraform and kubeadm
Stars: ✭ 71 (-16.47%)
Mutual labels:  hcl
Swiss Army Kube
This repository provides the minimal set of resources, which may be required for starting comfortably developing the process of new IaC project
Stars: ✭ 79 (-7.06%)
Mutual labels:  hcl
Terraform Aws Elb
Terraform module which creates ELB resources on AWS
Stars: ✭ 85 (+0%)
Mutual labels:  hcl
Ecs Pipeline
☁️ 🐳 ⚡️ 🚀 Create environment and deployment pipelines to ECS Fargate with CodePipeline, CodeBuild and Github using Terraform
Stars: ✭ 85 (+0%)
Mutual labels:  hcl
Terraform Eks
Terraform for AWS EKS
Stars: ✭ 82 (-3.53%)
Mutual labels:  hcl

kubernetes-aws-vpc-kops-terraform

Example code for the Deploy Kubernetes in an Existing AWS VPC with Kops and Terraform blog post.

tldr

terraform apply -var name=yourdomain.com

export NAME=$(terraform output cluster_name)
export KOPS_STATE_STORE=$(terraform output state_store)
export ZONES=$(terraform output -json availability_zones | jq -r '.value|join(",")')

kops create cluster \
    --master-zones $ZONES \
    --zones $ZONES \
    --topology private \
    --dns-zone $(terraform output public_zone_id) \
    --networking calico \
    --vpc $(terraform output vpc_id) \
    --target=terraform \
    --out=. \
    ${NAME}

terraform output -json | docker run --rm -i ryane/gensubnets:0.1 | pbcopy

kops edit cluster ${NAME}

# replace *subnets* section with your paste buffer (be careful to indent properly)
# save and quit editor

kops update cluster \
  --out=. \
  --target=terraform \
  ${NAME}

terraform apply -var name=yourdomain.com

using a subdomain

If you want all of your dns records to live under a subdomain in its own hosted zone, you need to setup route delegation to the new zone. After running terraform apply -var name=k8s.yourdomain.com, you can run the following commands to setup the delegation:

cat update-zone.json \
 | jq ".Changes[].ResourceRecordSet.Name=\"$(terraform output name).\"" \
 | jq ".Changes[].ResourceRecordSet.ResourceRecords=$(terraform output -json name_servers | jq '.value|[{"Value": .[]}]')" \
 > update-zone.json

aws --profile=default route53 change-resource-record-sets \
 --hosted-zone-id $(aws --profile=default route53 list-hosted-zones | jq -r '.HostedZones[] | select(.Name=="yourdomain.com.") | .Id' | sed 's/\/hostedzone\///') \
 --change-batch file://update-zone.json

Wait until your changes propagate before continuing. You are good to go when

host -a k8s.yourdomain.com

returns the correct NS records.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].