Skip to content

Commit

Permalink
Geodesic documentation (#60)
Browse files Browse the repository at this point in the history
* Geodesic documentation

* Added documetation how to spin up kops cluster

* Update with-kops.md

* use include-code-block

* Move examples to standalone snippets

* fix syntax error
  • Loading branch information
goruha authored and osterman committed May 18, 2018
1 parent e8d3f9c commit 612bf45
Show file tree
Hide file tree
Showing 12 changed files with 388 additions and 196 deletions.
2 changes: 1 addition & 1 deletion content/geodesic/module/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Module"
title: "Geodesic Module"
description: ""
---
{{% dialog type="info" icon="fa fa-book" title="Read More" %}}
Expand Down
2 changes: 1 addition & 1 deletion content/geodesic/module/usage/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Geodesic Usage"
title: "Geodesic Module Usage"
description: ""
---
# Prerequisites
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions content/geodesic/module/usage/examples/assume-role.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
❌ (none) tfstate-backend ➤ assume-role
Enter passphrase to unlock /conf/.awsvault/keys/:
Enter token for arn:aws:iam::xxxxxxx:mfa/goruha: 781874
* Assumed role arn:aws:iam::xxxxxxx:role/OrganizationAccountAccessRole
-> Run 'init-terraform' to use this project
⧉ staging example
✅ (example-staging-admin) tfstate-backend ➤
86 changes: 86 additions & 0 deletions content/geodesic/module/usage/examples/aws-kops-backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
terraform {
required_version = ">= 0.11.2"
backend "s3" {}
}

variable "aws_assume_role_arn" {}

variable "tfstate_namespace" {}

variable "tfstate_stage" {}

variable "tfstate_region" {}

variable "kops_cluster_name" {}

variable "parent_zone_name" {}

provider "aws" {
assume_role {
role_arn = "${var.aws_assume_role_arn}"
}
}

module "kops_state_backend" {
source = "git::https://github.com/cloudposse/terraform-aws-kops-state-backend.git?ref=tags/0.1.3"
namespace = "${var.tfstate_namespace}"
stage = "${var.tfstate_stage}"
name = "kops-state"
parent_zone_name = "${var.parent_zone_name}"
zone_name = "$${name}.$${parent_zone_name}"
cluster_name = "${var.tfstate_region}"
region = "${var.tfstate_region}"
}

module "ssh_key_pair" {
source = "git::https://github.com/cloudposse/terraform-aws-key-pair.git?ref=tags/0.2.3"
namespace = "${var.tfstate_namespace}"
stage = "${var.tfstate_stage}"
name = "kops-${var.tfstate_region}"
ssh_public_key_path = "/secrets/tf/ssh"
generate_ssh_key = "true"
}

output "parent_zone_id" {
value = "${module.kops_state_backend.parent_zone_id}"
}

output "parent_zone_name" {
value = "${module.kops_state_backend.parent_zone_name}"
}

output "zone_id" {
value = "${module.kops_state_backend.zone_id}"
}

output "zone_name" {
value = "${module.kops_state_backend.zone_name}"
}

output "bucket_name" {
value = "${module.kops_state_backend.bucket_name}"
}

output "bucket_region" {
value = "${module.kops_state_backend.bucket_region}"
}

output "bucket_domain_name" {
value = "${module.kops_state_backend.bucket_domain_name}"
}

output "bucket_id" {
value = "${module.kops_state_backend.bucket_id}"
}

output "bucket_arn" {
value = "${module.kops_state_backend.bucket_arn}"
}

output "ssh_key_name" {
value = "${module.ssh_key_pair.key_name}"
}

output "ssh_public_key" {
value = "${module.ssh_key_pair.public_key}"
}
13 changes: 13 additions & 0 deletions content/geodesic/module/usage/examples/kops-create.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
✅ (example-staging-admin) kops ➤ kops create -f /conf/kops/manifest.yaml

Created cluster/us-west-2.staging.example.com
Created instancegroup/bastions
Created instancegroup/master-us-west-2a
Created instancegroup/master-us-west-2b
Created instancegroup/master-us-west-2c
Created instancegroup/nodes

To deploy these resources, run: kops update cluster us-west-2.staging.example.com --yes

⧉ staging example
✅ (example-staging-admin) kops ➤
23 changes: 23 additions & 0 deletions content/geodesic/module/usage/examples/start-geodesic-shell.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
sh-3.2$ staging.example.com
# Mounting /home/goruha into container
# Starting new staging.example.com session from cloudposse/staging.example.com:dev
# Exposing port 41179
* Started EC2 metadata service at http://169.254.169.254/latest

_ _ _
___| |_ __ _ __ _(_)_ __ __ _ _____ ____ _ _ __ ___ _ __ | | ___
/ __| __/ _` |/ _` | | '_ \ / _` | / _ \ \/ / _` | '_ ` _ \| '_ \| |/ _ \
\__ \ || (_| | (_| | | | | | (_| | | __/> < (_| | | | | | | |_) | | __/
|___/\__\__,_|\__, |_|_| |_|\__, | \___/_/\_\__,_|_| |_| |_| .__/|_|\___|
|___/ |___/ |_|


IMPORTANT:
* Your $HOME directory has been mounted to `/localhost`
* Use `aws-vault` to manage your sessions
* Run `assume-role` to start a session


-> Run 'assume-role' to login to AWS
⧉ staging example
❌ (none) ~ ➤
Empty file.
Loading

0 comments on commit 612bf45

Please sign in to comment.