Setup
What Will You Do¶
This is Part 1 of a multi-part, self-paced quick start exercise. In this part, you will use the Infra Admin persona to setup and configure the needed resources to use Environment Manager.
Step 1: Fork Git Repository¶
In this step, you will fork a git repository to your account. The forked repo will contain the code used in this guide. A GitOps pipeline will be created later in this guide which will be triggered by commits to this forked repository.
- Ensure you are logged into your GitHub.com account
- Navigate to the public Git repository
- Click to fork the repository
- Select your account name to fork the repo to
- Once complete, you should see a copy of the repository in your Git system (e.g. GitHub)
Step 2: Create GitHub Token¶
In this step, you will create a Personal Access Token in Github to allow access to the GitHub repository.
- Ensure you are logged into your GitHub.com account
- Go to the GitHub Account Settings
- Click "Generate new token (classic)"
- Provide a note for the token,
- Select the repo scope
- Click Generate token
- Copy and save the access token for use later in this guide
Step 3: Clone Git Repository¶
In this step, you will clone the previously forked Git repository to your local machine to simplify interacting with the repository.
- Clone the Git repository to your laptop using the command below. Be sure to update the repository link with the link from the previously forked repository.
git clone <Forked Repository URL>
- Once complete, you should see a folder called "terraform/aws/101-vpc-ecs" which contains the resources needed for this exercise.
Step 4: Download RCTL¶
The RCTL CLI allows you to programmatically interact with the controller enabling users to construct sophisticated automation workflows.
- Login into your Org
- Navigate to "My Tools" to download both the RCTL CLI and the "CLI Config" file
- Initialize RCTL using the step-by-step instructions
- Ensure you update your OS's Path environment variable for RCTL
Step 5: Configure Environment Parameters¶
In this step, you will configure a values file that will then be used by a configuration script.
- Open Terminal (on macOS/Linux) and navigate to the folder where you forked the Git repository
-
Navigate to the folder "
/terraform/aws/101-caas-eks/setup" -
Update the following values in the "values.yaml" file with the values from your repository and environment
project: UPDATE_EXISTING_PROJECT_NAME
usernName: UPDATE_REPO_USERNAME
token: UPDATE_REPO_TOKEN
endPoint: UPDATE_REPO_ENDPOINT
branch: UPDATE_REPO_BRANCH
Step 6: Run Setup Script¶
In this step, you will run the setup script which will assist in creating the resources for this guide.
- Navigate to the folder "
/terraform/aws/101-caas-eks/setup" - Execute the setup.sh script
The script will begin to run. After a few minutes, the script will pause and provide Webhook details. Use these webhook details in the next step.
Step 7: Setup GitHub Webhook¶
In this step, you will configure your repository webhook. The webhook will be used to trigger the System-Sync pipeline in the controller.
- Navigate to your GitHub repository -> Settings -> Webhooks
- Click Add webhook
- Copy and Paste the "Payload URL" and "Secret" from the script output
- Click Add webhook
- Enter Yes in the script to continue
Step 8: Configure Environment Contexts¶
In this step, you will configure the environment contexts in the controller with your AWS and Rafay account details. These account details will be used by Environment Manager to interact with your accounts.
Configure AWS Context¶
Make sure you have the following information. You may need to create these in your AWS environment or in the console.
- AWS Role ARN
-
Log into the controller and select your project
- Navigate to Environments -> Contexts
- Click on the existing AWS context name
- Select Input Variables
- Populate the values of the variables with the role ARN and external ID in your AWS account
- Click Save
Configure Rafay Context¶
You will use the CLI config details of your Rafay account to populate this context. The values needed can be found in a CLI config file. To obtain a CLI config file, navigate to Home -> My Tools -> Download CLI Config
- Navigate to Environments -> Contexts
- Click on the existing Rafay context name
- Select Environment Variables
- Populate the values of the variables
- Click Save
Step 9: Create Environment Resource¶
In this step, you will create an environment resource in the controller which will use the previously created environment template. This environment resource will be used to control the lifecycle of the environment.
- Log into the controller and select your project
- Navigate to Environments -> Environments
- Click New Environment
- Enter an environment name
- Select the existing environment template
- Select the environment template version
- Click Create
Recap¶
At this point, you have everything setup and configured to manage environments through Environment Manager.