First steps with Constellation
The following steps guide you through the process of creating a cluster and deploying a sample app. This example assumes that you have successfully installed and set up Constellation, and have access to a cloud subscription.
If you don't have a cloud subscription, you can also set up a local Constellation cluster using virtualization for testing.
If you encounter any problem with the following steps, make sure to use the latest release and check out the known issues.
Create a cluster
-
Create the configuration file and state file for your cloud provider. If you are following the steps of this guide, there is no need to edit the file.
- AWS
- Azure
- GCP
- STACKIT
constellation config generate awsconstellation config generate azureconstellation config generate gcpconstellation config generate stackit -
Create your IAM configuration.
- AWS
- Azure
- GCP
- STACKIT
constellation iam create aws --zone=us-east-2a --prefix=constellTest --update-configThis command creates IAM configuration for the AWS zone
us-east-2ausing the prefixconstellTestfor all named resources being created. It also updates the configuration fileconstellation-conf.yamlin your current directory with the IAM values filled in.Depending on the attestation variant selected on config generation, different regions are available. AMD SEV-SNP machines (requires the default attestation variant
awsSEVSNP) are currently available in the following regions:eu-west-1us-east-2
You can find a list of regions that support AMD SEV-SNP in AWS's documentation.
NitroTPM machines (requires the attestation variant
awsNitroTPM) are available in all regions. Constellation OS images are currently replicated to the following regions:eu-central-1eu-west-1eu-west-3us-east-2ap-south-1
If you require the OS image to be available in another region, let us know.
You can find a list of all regions in AWS's documentation.
constellation iam create azure --subscriptionID 00000000-0000-0000-0000-000000000000 --region=westus --resourceGroup=constellTest --servicePrincipal=spTest --update-configThis command creates IAM configuration on the Azure region
westuscreating a new resource groupconstellTestand a new service principalspTest. It also updates the configuration fileconstellation-conf.yamlin your current directory with the IAM values filled in.CVMs are available in several Azure regions. Constellation OS images are currently replicated to the following:
germanywestcentralwestuseastusnortheuropewesteuropesoutheastasia
If you require the OS image to be available in another region, let us know.
You can find a list of all regions in Azure's documentation.
constellation iam create gcp --projectID=yourproject-12345 --zone=europe-west3-a --prefix=constell-test --update-configThis command creates IAM configuration in the GCP project
yourproject-12345on the GCP zoneeurope-west3-acreating a new service accountconstell-test. It also updates the configuration fileconstellation-conf.yamlin your current directory with the IAM values filled in.Note that only regions offering CVMs of the
C2DorN2Dseries are supported. You can find a list of all regions in Google's documentation, which you can filter by machine typeC2DorN2D.To use Constellation on STACKIT, the cluster will use the User Access Token (UAT) that's generated during the install step. After creating the accounts, fill in the STACKIT details in
constellation-conf.yamlunderprovider.openstack:stackitProjectID: STACKIT project id (can be found after login on the STACKIT portal)
cautionstackitProjectIDrefers to the ID of your STACKIT project. The STACKIT portal also shows the OpenStack ID that's associated with your project in some places. Make sure you insert the STACKIT project ID in theconstellation-conf.yamlfile. It's of the formatXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.tipTo learn about all options you have for managing IAM resources and Constellation configuration, see the Configuration workflow.
-
Create the cluster.
constellation applyuses options set inconstellation-conf.yaml. If you want to manually manage your cloud resources, for example by using Terraform, follow the corresponding instructions in the Create workflow.tipOn Azure, you may need to wait 15+ minutes at this point for role assignments to propagate.
constellation apply -yThis should look similar to the following:
$ constellation apply -y
Checking for infrastructure changes
The following Constellation cluster will be created:
3 control-plane nodes of type n2d-standard-4 will be created.
1 worker node of type n2d-standard-4 will be created.
Creating
Cloud infrastructure created successfully
Your Constellation master secret was successfully written to ./constellation-mastersecret.json
Connecting
Initializing cluster
Installing Kubernetes components
Your Constellation cluster was successfully initialized.
Constellation cluster identifier g6iMP5wRU1b7mpOz2WEISlIYSfdAhB0oNaOg6XEwKFY=
Kubernetes configuration constellation-admin.conf
You can now connect to your cluster by executing:
export KUBECONFIG="$PWD/constellation-admin.conf"The cluster's identifier will be different in your output. Keep
constellation-mastersecret.jsonsomewhere safe. This will allow you to recover your cluster in case of a disaster.infoDepending on your CSP and region,
constellation applymay take 10+ minutes to complete. -
Configure kubectl.
export KUBECONFIG="$PWD/constellation-admin.conf"
Deploy a sample application
-
Deploy the emojivoto app
kubectl apply -k github.com/BuoyantIO/emojivoto/kustomize/deployment -
Expose the frontend service locally
kubectl wait --for=condition=available --timeout=60s -n emojivoto --all deployments
kubectl -n emojivoto port-forward svc/web-svc 8080:80 &
curl http://localhost:8080
kill %1
Terminate your cluster
Use the CLI to terminate your cluster. If you manually used Terraform to manage your cloud resources, follow the corresponding instructions in the Terminate workflow.
constellation terminate
This should give the following output:
$ constellation terminate
You are about to terminate a Constellation cluster.
All of its associated resources will be DESTROYED.
This action is irreversible and ALL DATA WILL BE LOST.
Do you want to continue? [y/n]:
Confirm with y to terminate the cluster:
Terminating ...
Your Constellation cluster was terminated successfully.
Optionally, you can also delete your IAM resources.
