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

Commit

Permalink
Update README (#1)
Browse files Browse the repository at this point in the history
* Update README

* Update readme

* Add dockerfile
  • Loading branch information
osterman authored and aknysh committed Jul 17, 2018
1 parent f8685a7 commit 2043fc2
Show file tree
Hide file tree
Showing 11 changed files with 803 additions and 9 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
18 changes: 11 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Local .terraform directories
**/.terraform/*

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

# Module directory
.terraform/
.idea
*.iml

# .tfvars files
*.tfvars
# 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/staging.cloudposse.co"
ENV DOCKER_TAG="latest"

ENV BANNER="staging.cloudposse.co"

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

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

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

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

ENV TF_VAR_REDIS_INSTANCE_TYPE=cache.r3.large

# chamber KMS config
ENV CHAMBER_KMS_KEY_ALIAS="alias/cpco-staging-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.staging.cloudposse.co"
ENV KOPS_DNS_ZONE=${KOPS_CLUSTER_NAME}
ENV KOPS_STATE_STORE="s3://cpco-staging-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="4"
ENV NODE_MIN_SIZE="4"

# Generate kops manifest
RUN build-kops-manifest

WORKDIR /conf/
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
export CLUSTER ?= staging.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 2043fc2

Please sign in to comment.