diff options
author | yoonsoonjahng <yoonsoon.jahng@yoppworks.com> | 2020-10-27 13:14:37 -0400 |
---|---|---|
committer | yoonsoonjahng <yoonsoon.jahng@yoppworks.com> | 2020-11-03 09:50:19 -0500 |
commit | 69e2530c06f7bc569f1ad50f877f4129f0b7dd56 (patch) | |
tree | a21591fe5182c954fbcd35f681ed2d4b91b29def | |
parent | 7bb34f87a76af9bcb6400bc19bd3b682183dcad6 (diff) |
1. Changed wrong url format
2. Fixed wrong host name
3. Updated REAME file more descriptive
Issue-ID: INT-1753
Change-Id: I5bd4e0247fdb2204b097da683f7b6bb4ffb6aefe
Signed-off-by: yoonsoonjahng <yoonsoon.jahng@yoppworks.com>
10 files changed, 39 insertions, 14 deletions
@@ -14,8 +14,11 @@ This Terragrunt(Terraform) code provides the same infrastructure as you would cr ``` openlab # Terragrunt scripts to feed configuration into the Terraform modules └ RegionOne # For multi regions. e.g, us-east-1 - └ stage # Environment specific configuration. e.g, QA/Stage/Prod - └ resource + | └ stage # Environment specific configuration. e.g, QA/Stage/Prod + | └ resource + └ RegionTwo # For multi regions. e.g, us-east-1 + └ Prod # Environment specific configuration. e.g, QA/Stage/Prod + └ resource ``` Infrastrucuture is organized hierarchically in folders. @@ -32,16 +35,35 @@ We deployed VMs and K8s with the scripts and after that we deployed ONAP Frankfu ### Usage #### Set up environment variables for your target cloud. -1.a You need to export cloud storage credential. +1. You need to export cloud storage credential. For instance, if you use Google Storage bucket, you can download the credentials from Google UI or the command-line tool. Go to Google Cloud project's `IAM & Admin` menu and choose the service account associated with the storage. You can export the credential as a JSON formatted file. Then `export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credential-file`. Please, refer to the following [link](https://cloud.google.com/iam/docs/creating-managing-service-account-keys). -Second, you need to export Openstack credentials. You can use the openstack.rc file downloaded from your Openstack project. +2. you need to export Openstack credentials. You can use the openstack.rc file downloaded from your Openstack project. Please, refer to the following [link](https://docs.openstack.org/ocata/user-guide/common/cli-set-environment-variables-using-openstack-rc.html) for details. +3. expose your KUBECONFIG environmental variable. kube_config_cluster.yaml file will be created under the stage directory. This file contains +the login credential for the new Kubernetes cluster. You have to provide the full path of the kube_config_cluster.yaml file. + +4. check all the environmental variables are set with the `env` command. +For example, +``` +GOOGLE_APPLICATION_CREDENTIALS=/path/to/google_credential + +password=OpenstackPassowrd + +user_name=OpenstackUser + +auth_url=http://x.x.x.x:.. + +project_id=12345667 + +KUBECONFIG=/path/to/terragrunt/openlab/RegionOne/stage/kube_config_cluster.yaml +``` + #### Fill in files - `account.hcl`: Top-level configuration for a cloud account. - `region.hcl`: The second level configuration for a region within the cloud @@ -56,6 +78,9 @@ Terraform version 0.13 is required. https://github.com/gruntwork-io/terragrunt-infrastructure-live-example#deploying-all-modules-in-a-region +If you have multiple environments, you have to have a directory for it. Stage directory contains subdirectories for underlying infrastructure. +You can simple copy the stage directory and paste it under RegionOne directory. If your cluster runs in a different region, you have to change the name of RegionOne into the region where your cluster runs. + #### Updating infrastructure version Infrastructure may evolve. You can use existing infrastructure as it is or updating the infrastructure to meet a new requirement. To deploy a different version of infrastructure, you can change a tag of `source` module version. diff --git a/terragrunt/openlab/RegionOne/stage/compute/control/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/compute/control/terragrunt.hcl index 46a2c24..fadd4c9 100644 --- a/terragrunt/openlab/RegionOne/stage/compute/control/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/compute/control/terragrunt.hcl @@ -9,7 +9,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/compute" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/openstack/compute" } include { @@ -25,7 +25,7 @@ inputs = { environment = local.environment cluster_name = "${local.region}-${local.environment}" - node_name = "worker-node" + node_name = "control-node" image = "ubuntu-18.04" flavor = "m1.xlarge" floating_ip_pool = "external" diff --git a/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl index 4e7f83f..9d0a213 100644 --- a/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/compute/nfsserver/terragrunt.hcl @@ -9,7 +9,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/compute" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/openstack/compute" } include { diff --git a/terragrunt/openlab/RegionOne/stage/compute/worker/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/compute/worker/terragrunt.hcl index 8d33ae4..b57276a 100644 --- a/terragrunt/openlab/RegionOne/stage/compute/worker/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/compute/worker/terragrunt.hcl @@ -9,7 +9,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/compute" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/openstack/compute" } include { diff --git a/terragrunt/openlab/RegionOne/stage/env.hcl b/terragrunt/openlab/RegionOne/stage/env.hcl index cb68eb2..0602dcf 100644 --- a/terragrunt/openlab/RegionOne/stage/env.hcl +++ b/terragrunt/openlab/RegionOne/stage/env.hcl @@ -10,7 +10,7 @@ locals { ssh_public_key = "" # OpenSSH formated string is required ssh_private_key_path = "" # e.g ~/.ssh/id_rsa - kubernetes_version = "v1.15.11-rancher1-2" + kubernetes_version = "v1.15.11-rancher1-2" # rke version. please, check the correct rke version at https://github.com/rancher/rke/releases/ kubernetes_user = "ubuntu" kubernetes_cluster_name = "rke_cluster" diff --git a/terragrunt/openlab/RegionOne/stage/keypair/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/keypair/terragrunt.hcl index 35e02ee..fe6500c 100644 --- a/terragrunt/openlab/RegionOne/stage/keypair/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/keypair/terragrunt.hcl @@ -9,7 +9,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/keypair" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/openstack/keypair" } include { diff --git a/terragrunt/openlab/RegionOne/stage/kubernetes/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/kubernetes/terragrunt.hcl index e6c0abb..ec6b60c 100644 --- a/terragrunt/openlab/RegionOne/stage/kubernetes/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/kubernetes/terragrunt.hcl @@ -20,7 +20,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/kubernetes/kubernetes" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/kubernetes/kubernetes" } include { diff --git a/terragrunt/openlab/RegionOne/stage/network/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/network/terragrunt.hcl index 31ff4f7..eb50f3b 100644 --- a/terragrunt/openlab/RegionOne/stage/network/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/network/terragrunt.hcl @@ -9,7 +9,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/openstack/network" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/openstack/network" } include { diff --git a/terragrunt/openlab/RegionOne/stage/rancher/terragrunt.hcl b/terragrunt/openlab/RegionOne/stage/rancher/terragrunt.hcl index 1d01e11..c0a762d 100644 --- a/terragrunt/openlab/RegionOne/stage/rancher/terragrunt.hcl +++ b/terragrunt/openlab/RegionOne/stage/rancher/terragrunt.hcl @@ -18,7 +18,7 @@ locals { } terraform { - source = "git::https://gerrit.onap.org/r/integration/terraform/openlab/modules/kubernetes/rancher" + source = "git::https://gerrit.onap.org/r/integration/terraform//openlab/modules/kubernetes/rancher" } include { diff --git a/terragrunt/openlab/account.hcl b/terragrunt/openlab/account.hcl index 27c5cf0..723c6f1 100644 --- a/terragrunt/openlab/account.hcl +++ b/terragrunt/openlab/account.hcl @@ -2,7 +2,7 @@ # terragrunt.hcl configuration. # For Openstack, please fill in the values below locals { - user_name = "${get_env("user_name", "")}" # Expose environmental variables for your account + user_name = "${get_env("user_name", "")}" # Expose environmental variables for your account. e.g. $>source openstack.rc password = "${get_env("password", "")}" project_id = "${get_env("project_id", "")}" auth_url = "${get_env("auth_url", "")}" |