2022-09-02 05:52:42 -04:00
# Installation and Setup
Constellation runs entirely in your cloud environment and can be easily controlled via a dedicated Command Line Interface (CLI).
2022-09-13 06:05:07 -04:00
The following guides you through the steps of installing the CLI on your machine, verifying it, and connecting it to your Cloud Service Provider (CSP).
2022-09-02 05:52:42 -04:00
### Prerequisites
2022-09-13 06:05:07 -04:00
Make sure the following requirements are met:
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
- Your machine is running Linux or macOS
2022-09-02 05:52:42 -04:00
- You have admin rights on your machine
- [kubectl ](https://kubernetes.io/docs/tasks/tools/ ) is installed
2022-09-13 06:05:07 -04:00
- Your cloud provider is Microsoft Azure or Google Cloud Platform (GCP)
2022-09-02 05:52:42 -04:00
## Install the Constellation CLI
2022-09-13 06:05:07 -04:00
Download the CLI executable from the [release page ](https://github.com/edgelesssys/constellation/releases ). Move the downloaded file to a directory in your `PATH` (default: `/usr/local/bin` ) and make it executable by entering `chmod u+x constellation` in your terminal.
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
:::note
Edgeless Systems uses [sigstore ](https://www.sigstore.dev/ ) to sign each release of the CLI. You may want to [verify the signature ](../workflows/verify-cli.md ) before you use the CLI.
:::
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
:::tip
The CLI supports autocompletion for various shells. To set it up, run `constellation completion` and follow the given steps.
:::
2022-09-02 05:52:42 -04:00
## Set up cloud credentials
2022-09-13 06:05:07 -04:00
The CLI makes authenticated calls to the CSP API. Therefore, you need to set up Constellation with the credentials for your CSP. Currently, Microsoft Azure and Google Cloud Platform (GCP) are the only supported CSPs.
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
### Step 1: Authenticate
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
First, you need to authenticate with your CSP. The following lists the required steps for *testing* and *production* environments.
2022-09-02 05:52:42 -04:00
:::danger
2022-09-13 06:05:07 -04:00
The steps for a *testing* environment are simpler. However, they may expose secrets to the CSP. If in doubt, follow the *production* steps.
2022-09-02 05:52:42 -04:00
:::
2022-09-09 11:01:57 -04:00
< tabs groupId = "csp" >
2022-09-02 05:52:42 -04:00
< tabItem value = "azure" label = "Azure" default >
**Testing**
2022-09-13 06:05:07 -04:00
Simply open the [Azure Cloud Shell ](https://docs.microsoft.com/en-us/azure/cloud-shell/overview ).
2022-09-02 05:52:42 -04:00
**Production**
2022-09-13 06:05:07 -04:00
Use the latest version of the [Azure CLI ](https://docs.microsoft.com/en-us/cli/azure/ ) on a trusted machine:
2022-09-02 05:52:42 -04:00
```bash
az login
```
Other options are described in Azure's [authentication guide ](https://docs.microsoft.com/en-us/cli/azure/authenticate-azure-cli ).
< / tabItem >
< tabItem value = "gcp" label = "GCP" default >
Enable the following cloud APIs first:
- [Compute Engine API ](https://console.cloud.google.com/marketplace/product/google/compute.googleapis.com )
- [Cloud Resource Manager API ](https://console.cloud.google.com/apis/library/cloudresourcemanager.googleapis.com )
- [Identity and Access Management (IAM) API ](https://console.developers.google.com/apis/api/iam.googleapis.com )
**Testing**
2022-09-13 06:05:07 -04:00
If you are running from within VM on GCP, and the VM is allowed to access the necessary APIs, no further configuration is needed.
2022-09-02 05:52:42 -04:00
2022-09-13 06:05:07 -04:00
If you are using the [Google Cloud Shell ](https://cloud.google.com/shell ), make sure your [session is authorized ](https://cloud.google.com/shell/docs/auth ). For example, execute `gsutil` and accept the authorization prompt.
2022-09-02 05:52:42 -04:00
**Production**
2022-09-13 06:05:07 -04:00
For production, use one of the following options on a trusted machine:
2022-09-02 05:52:42 -04:00
- Use the [`gcloud` CLI ](https://cloud.google.com/sdk/gcloud )
```bash
gcloud auth application-default login
```
2022-09-13 06:05:07 -04:00
This will ask you to log-in to your Google account and create your credentials.
2022-09-02 05:52:42 -04:00
The Constellation CLI will automatically load these credentials when needed.
- Set up a service account and pass the credentials manually
Follow [Google's guide ](https://cloud.google.com/docs/authentication/production#manually ) for setting up your credentials.
< / tabItem >
< / tabs >
2022-09-13 06:05:07 -04:00
### Step 2: Set permissions
Finally, set the required permissions for your user account.
2022-09-02 05:52:42 -04:00
2022-09-09 11:01:57 -04:00
< tabs groupId = "csp" >
2022-09-02 05:52:42 -04:00
< tabItem value = "azure" label = "Azure" default >
2022-09-13 06:05:07 -04:00
Set the following permissions:
2022-09-02 05:52:42 -04:00
- `Contributor`
- `User Access Administrator`
< / tabItem >
< tabItem value = "gcp" label = "GCP" default >
2022-09-13 06:05:07 -04:00
Set the following permissions:
2022-09-02 05:52:42 -04:00
- `compute.*` (or the subset defined by `roles/compute.instanceAdmin.v1` )
2022-09-09 11:01:57 -04:00
- `iam.serviceAccountUser`
2022-09-02 05:52:42 -04:00
Follow Google's guide on [understanding ](https://cloud.google.com/iam/docs/understanding-roles ) and [assigning roles ](https://cloud.google.com/iam/docs/granting-changing-revoking-access ).
< / tabItem >
< / tabs >
### Next Steps
2022-09-13 06:05:07 -04:00
You are now ready to [deploy your first confidential Kubernetes cluster and application ](first-steps.md ).