Skip to content

Setup

What Will You Do

In this part, you will use the Platform Team persona (i.e. Infra Admin role in Rafay) to import and configure the environment manager resources.

Important

This is a one-time setup. Once completed, it can be shared/used by 100s/1000s of developers in your Org.


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

GitHub Import

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

GitHub Token


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/waas/101-waas" which contains the resources needed for this exercise.

Step 4: Download RCTL CLI

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/waas/101-waas/setup"

  • Update the following values in the "values.yaml" file with the values from your repository and environment

project: UPDATE_EXISTING_PROJECT_NAME
userName: UPDATE_REPO_USERNAME
token: UPDATE_REPO_TOKEN
endPoint: UPDATE_REPO_ENDPOINT
branch: UPDATE_REPO_BRANCH
ClusterName: UPDATE_EXISTING_CLUSTER_NAME

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/waas/101-waas/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.

Webhook Output


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

Webhook in GitHub

  • Enter Yes in the script to continue

Step 8: Configure Environment Contexts

In this step, you will configure the environment context in the controller with your Rafay account details. These account details will be used by Environment Manager to interact with your account.

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 API key, secret and endpoint variables (Note, the project variable is pre-populated for you)
  • Ensure that you select the sensitive checkbox for both fields
  • Click Save

Populate Context

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.


Recap

At this point, you have everything setup and configured to to allow self service workspaces to be created on your shared host cluster.