Skip to main content

Create an Environment with KEI

Creating an environment with the Section application programming interface (API) is the first step when getting started with the Section Kubernetes Edge Interface (KEI).

Be sure to create an API Token for the steps in this guide that require the SECTION_API_TOKEN.

Get Your Account ID

In addition to your token you will also need to your SECTION_ACCOUNT_ID to identify which account the Environment will be added to. Your Account ID can easily be seen in the browser's URL for the Section Console, as in:

https://console.section.io/configure/account/SECTION_ACCOUNT_ID.

Alternatively, use the Account API Call to get your Account's ID.

get_account_id.sh
curl \
--header "Accept: application/json" \
--header "section-token: SECTION_API_TOKEN" \
-X GET "https://aperture.section.io/api/v1/account"

You will receive a JSON response with an "id", this is your SECTION_ACCOUNT_ID.

Create an Environment

Using the Create Application API call Section will automatically provision your KEI environment.

You will send a JSON object with the following fields:

  • The hostname This will be the domain name used to initialize the managed ingress controller if you opt-in to using it. This field will also act as the name of your environment. The hostname is limited to alphanumeric characters and the hyphen, and separated by dots.
  • The origin field is optional and not applicable to environments created for KEI
  • The stackName field must be set to kei

The curl command below sends the needed JSON object, embedded right into the command line.

create_kei_application.sh
curl \
--header "section-token: SECTION_API_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" -d "{ \
\"hostname\": \"YOUR_ENVIRONMENT_HOSTNAME\", \
\"origin\": \"blank\", \
\"stackName\": \"kei\" \
}" "https://aperture.section.io/api/v1/account/SECTION_ACCOUNT_ID/application/create"

Any empty JSON response means that the command did not work.

Once you have created your Section environment, navigate to it in the Section Console to see the KEI Endpoint URL that you will use to Deploy A Container to Section.