-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
Showing
12 changed files
with
388 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: "Geodesic Usage" | ||
title: "Geodesic Module Usage" | ||
description: "" | ||
--- | ||
# Prerequisites | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
86
content/geodesic/module/usage/examples/aws-kops-backend.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
23
content/geodesic/module/usage/examples/start-geodesic-shell.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.