Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Initial Implementation (#1)
Browse files Browse the repository at this point in the history
* use cloudposse public repo

* Add links

* Restore missing sections

* Reorg

* Update license

* include conf dir

* Fix cannonical link
  • Loading branch information
osterman authored Jul 17, 2018
1 parent 372978e commit c8482cb
Show file tree
Hide file tree
Showing 15 changed files with 1,535 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**/.terraform
.git
.gitignore
.editorconfig

# Compiled files
*.tfstate
*.tfstate.backup
.terraform.tfstate.lock.info

# Module directory
.terraform/
.idea
*.iml

# Build Harness
.build-harness
build-harness/
24 changes: 24 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Override for Makefile
[{Makefile, makefile, GNUmakefile}]
indent_style = tab
indent_size = 4

[Makefile.*]
indent_style = tab
indent_size = 4

[shell]
indent_style = tab
indent_size = 4

[*.sh]
indent_style = tab
indent_size = 4
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Compiled files
*.tfstate
*.tfstate.backup
.terraform.tfstate.lock.info

# Module directory
.terraform/
.idea
*.iml

# Build Harness
.build-harness
build-harness/
57 changes: 57 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
FROM cloudposse/terraform-root-modules:0.4.5 as terraform-root-modules

FROM cloudposse/geodesic:0.11.6

ENV DOCKER_IMAGE="cloudposse/prod.cloudposse.co"
ENV DOCKER_TAG="latest"

ENV BANNER="prod.cloudposse.co"

# Default AWS Profile name
ENV AWS_DEFAULT_PROFILE="cpco-prod-admin"

# AWS Region for the cluster
ENV AWS_REGION="us-west-2"

# Terraform State Bucket
ENV TF_BUCKET="cpco-prod-terraform-state"
ENV TF_BUCKET_REGION="us-west-2"
ENV TF_DYNAMODB_TABLE="cpco-prod-terraform-state-lock"

# Terraform Vars
ENV TF_VAR_domain_name=prod.cloudposse.co
ENV TF_VAR_namespace=cpco
ENV TF_VAR_stage=prod

ENV TF_VAR_REDIS_INSTANCE_TYPE=cache.r3.large

# chamber KMS config
ENV CHAMBER_KMS_KEY_ALIAS="alias/cpco-prod-chamber"

# Copy root modules
COPY --from=terraform-root-modules /aws/ /conf/

# Place configuration in 'conf/' directory
COPY conf/ /conf/

# Filesystem entry for tfstate
RUN s3 fstab '${TF_BUCKET}' '/' '/secrets/tf'

# kops config
ENV KUBERNETES_VERSION="1.9.6"
ENV KOPS_CLUSTER_NAME="us-west-2.prod.cloudposse.co"
ENV KOPS_DNS_ZONE=${KOPS_CLUSTER_NAME}
ENV KOPS_STATE_STORE="s3://cpco-prod-kops-state"
ENV KOPS_STATE_STORE_REGION="us-west-2"
ENV KOPS_AVAILABILITY_ZONES="us-west-2a,us-west-2b,us-west-2c"
ENV KOPS_BASTION_PUBLIC_NAME="bastion"
ENV BASTION_MACHINE_TYPE="t2.medium"
ENV MASTER_MACHINE_TYPE="m4.large"
ENV NODE_MACHINE_TYPE="m4.large"
ENV NODE_MAX_SIZE="8"
ENV NODE_MIN_SIZE="8"

# Generate kops manifest
RUN build-kops-manifest

WORKDIR /conf/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright 2018 Cloud Posse, LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export CLUSTER ?= prod.cloudposse.co
export DOCKER_ORG ?= cloudposse
export DOCKER_IMAGE ?= $(DOCKER_ORG)/$(CLUSTER)
export DOCKER_TAG ?= latest
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG)
export DOCKER_BUILD_FLAGS =
export README_DEPS ?= docs/targets.md docs/terraform.md

-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

## Initialize build-harness, install deps, build docker container, install wrapper script and run shell
all: init deps build install run
@exit 0

## Install dependencies (if any)
deps:
@exit 0

## Build docker image
build:
@make --no-print-directory docker/build

## Push docker image to registry
push:
docker push $(DOCKER_IMAGE)

## Install wrapper script from geodesic container
install:
@docker run --rm $(DOCKER_IMAGE_NAME) | sudo bash -s $(DOCKER_TAG)

## Start the geodesic shell by calling wrapper script
run:
$(CLUSTER)
Loading

0 comments on commit c8482cb

Please sign in to comment.