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: Import Git Repository¶
In this step, you will import a git repository to your account. The imported 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 repository.
- Ensure you are logged into your GitHub.com account
- Navigate here to begin the import
- Enter the following URL into the input on the page: https://github.com/RafaySystems/envmgr.git
- Enter envmgr for the repository name
- Select Private
- Click Begin Import
- Once complete, you should see a copy of the repository in GitHub
Note that the Rafay agent automatically writes back changes to Git if you make any changes to the resources via the web console or other supported interfaces.
- The resources (esp. secrets) you identify as sensitive. will be automatically encrypted using a secret sealer before being synced to your Git repo.
- If you forget to mark resources as sensitive, they will not be encrypted
Important
We recommend that users DO NOT use public Git repositories to avoid accidental exposure of sensitive data in your Git repository.
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 imported 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 imported repository.
git clone <Imported Repository URL>
- Once complete, you should see a folder called "terraform/aws/101-kubeflow-eks" 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 cloned the Git repository
-
Navigate to the folder "
/terraform/aws/101-kubeflow-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-kubeflow-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¶
For this step, you will need an AWS access key and secret. You may need to create these in your AWS environment or in the console.
- Log into the controller and select your project
- Navigate to Environments -> Contexts
- Click on the existing AWS context name
- Select Environment Variables
- Populate the access key and secret key values
- Ensure that you select the sensitive checkbox for both fields
- Select Input Variables
- Populate the access key and secret key values
- Ensure that you select the sensitive checkbox for both fields
- Click Save
Important
The Rafay agent automatically writes back the environment variables to Git. The resources (esp. secrets) you identify as sensitive. will be automatically encrypted using a secret sealer before being synced to your Git repo.
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
- Ensure that you select the sensitive checkbox for both fields
- Click Save
Important
The Rafay agent automatically writes back the environment variables to Git. The resources (esp. secrets) you identify as sensitive. will be automatically encrypted using a secret sealer before being synced to your Git repo.
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.