Skip to content

Commit

Permalink
Replace references to create command with apply
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Weiße <[email protected]>
  • Loading branch information
daniel-weisse committed Nov 20, 2023
1 parent 4fd9c6a commit ef1da10
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 85 deletions.
4 changes: 2 additions & 2 deletions docs/docs/architecture/orchestration.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ In addition, the cluster's [identifier](orchestration.md#post-installation-confi

### Creation process details

1. The CLI `create` command creates the confidential VM (CVM) resources in your cloud environment and configures the network
1. The CLI `apply` command first creates the confidential VM (CVM) resources in your cloud environment and configures the network
2. Each CVM boots the Constellation node image and measures every component in the boot chain
3. The first microservice launched in each node is the [*Bootstrapper*](microservices.md#bootstrapper)
4. The *Bootstrapper* waits until it either receives an initialization request or discovers an initialized cluster
5. The CLI `apply` command connects to the *Bootstrapper* of a selected node, sends the configuration, and initiates the initialization of the cluster
5. The CLI then connects to the *Bootstrapper* of a selected node, sends the configuration, and initiates the initialization of the cluster
6. The *Bootstrapper* of **that** node [initializes the Kubernetes cluster](microservices.md#bootstrapper) and deploys the other Constellation [microservices](microservices.md) including the [*JoinService*](microservices.md#joinservice)
7. Subsequently, the *Bootstrappers* of the other nodes discover the initialized cluster and send join requests to the *JoinService*
8. As part of the join request each node includes an attestation statement of its boot measurements as authentication
Expand Down
27 changes: 10 additions & 17 deletions docs/docs/getting-started/first-steps-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,29 +100,22 @@ attaching persistent storage, or autoscaling aren't available.

This creates a [configuration file](../workflows/config.md) for QEMU called `constellation-conf.yaml`. After that, your current folder also becomes your [workspace](../architecture/orchestration.md#workspaces). All `constellation` commands for your cluster need to be executed from this directory.

2. Now you can create your cluster and its nodes. `constellation create` uses the options set in `constellation-conf.yaml`.

```bash
constellation create
```

The Output should look like the following:

```shell-session
$ constellation create
Your Constellation cluster was created successfully.
```

3. Initialize the cluster
2. Now you can create your cluster and its nodes. `constellation apply` uses the options set in `constellation-conf.yaml`.

```bash
constellation apply
```

This should give the following output:
The Output should look like the following::

```shell-session
$ constellation apply
$ constellation apply -y
Checking for infrastructure changes
The following Constellation cluster will be created:
1 control-plane node of type 2-vCPUs will be created.
1 worker node of type 2-vCPUs will be created.
Creating
Cloud infrastructure created successfully.
Your Constellation master secret was successfully written to ./constellation-mastersecret.json
Connecting
Initializing cluster
Expand All @@ -146,7 +139,7 @@ attaching persistent storage, or autoscaling aren't available.

:::

4. Configure kubectl
3. Configure kubectl

```bash
export KUBECONFIG="$PWD/constellation-admin.conf"
Expand Down
29 changes: 11 additions & 18 deletions docs/docs/getting-started/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ If you encounter any problem with the following steps, make sure to use the [lat
:::
-->
3. Create the cluster. `constellation create` uses options set in `constellation-conf.yaml`.
3. Create the cluster. `constellation apply` uses options set in `constellation-conf.yaml`.
If you want to manually manage your cloud resources, for example by using [Terraform](../reference/terraform.md), follow the corresponding instructions in the [Create workflow](../workflows/create.md).
:::tip
Expand All @@ -128,26 +128,19 @@ If you encounter any problem with the following steps, make sure to use the [lat
:::
```bash
constellation create -y
constellation apply -y
```
This should give the following output:
This should look similar to the following:
```shell-session
$ constellation create -y
Your Constellation cluster was created successfully.
```
4. Initialize the cluster.
```bash
constellation apply
```
This should give the following output:
```shell-session
$ constellation apply
$ constellation apply -y
Checking for infrastructure changes
The following Constellation cluster will be created:
3 control-plane node of type n2d-standard-4 will be created.
2 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
Expand All @@ -171,7 +164,7 @@ If you encounter any problem with the following steps, make sure to use the [lat

:::

5. Configure kubectl.
4. Configure kubectl.

```bash
export KUBECONFIG="$PWD/constellation-admin.conf"
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/reference/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Currently, these subdirectories are:
* `constellation-terraform` - Terraform state files for the resources of the Constellation cluster
* `constellation-iam-terraform` - Terraform state files for IAM configuration

As with all commands, commands that work with these files (e.g., `create`, `terminate`, `iam`) have to be executed from the root of the cluster's [workspace directory](../architecture/orchestration.md#workspaces). You usually don't need and shouldn't manipulate or delete the subdirectories manually.
As with all commands, commands that work with these files (e.g., `apply`, `terminate`, `iam`) have to be executed from the root of the cluster's [workspace directory](../architecture/orchestration.md#workspaces). You usually don't need and shouldn't manipulate or delete the subdirectories manually.

## Interacting with Terraform manually

Expand All @@ -27,11 +27,11 @@ Manual interaction with Terraform state created by Constellation (i.e., via the
## Terraform debugging

To debug Terraform issues, the Constellation CLI offers the `tf-log` flag. You can set it to any of [Terraform's log levels](https://developer.hashicorp.com/terraform/internals/debugging):
- `JSON` (JSON-formatted logs at `TRACE` level)
- `TRACE`
- `DEBUG`
- `INFO`
- `WARN`
- `ERROR`
* `JSON` (JSON-formatted logs at `TRACE` level)
* `TRACE`
* `DEBUG`
* `INFO`
* `WARN`
* `ERROR`

The log output is written to the `terraform.log` file in the workspace directory. The output is appended to the file on each run.
45 changes: 11 additions & 34 deletions docs/docs/workflows/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,33 @@ This recording presents the essence of this page. It's recommended to read it in

---

Creating your cluster requires two steps:
Creating your cluster happens through multiple phases.
The most significant ones are:

1. Creating the necessary resources in your cloud environment
2. Bootstrapping the Constellation cluster and setting up a connection
3. Installing the necessary Kubernetes components

`constellation apply` handles all this in a single command.
You can use the `--skip-phases` flag to skip specific phases of the process.
For example, if you created the infrastructure manually, you can skip the cloud resource creation phase.

See the [architecture](../architecture/orchestration.md) section for details on the inner workings of this process.

:::tip
If you don't have a cloud subscription, you can also set up a [local Constellation cluster using virtualization](../getting-started/first-steps-local.md) for testing.
:::

## The *create* step

This step creates the necessary resources for your cluster in your cloud environment.
Before you create the cluster, make sure to have a [valid configuration file](./config.md).

### Create

<tabs groupId="usage">
<tabItem value="cli" label="CLI">

```bash
constellation create
constellation apply
```

*create* stores your cluster's state in a [`constellation-terraform`](../architecture/orchestration.md#cluster-creation-process) directory in your workspace.
`apply` stores the state of your cluster's cloud resources in a [`constellation-terraform`](../architecture/orchestration.md#cluster-creation-process) directory in your workspace.

</tabItem>
<tabItem value="self-managed" label="Self-managed">
Expand Down Expand Up @@ -70,31 +71,7 @@ Make sure all necessary resources are created, e.g., through checking your CSP's

Fill these outputs into the corresponding fields of the `Infrastructure` block inside the `constellation-state.yaml` file. For example, fill the IP or DNS name your cluster can be reached at into the `.Infrastructure.ClusterEndpoint` field.

Continue with [initializing your cluster](#the-apply-step).

</tabItem>
</tabs>

## The *apply* step

The following command initializes and bootstraps your cluster:

<tabs groupId="usage">
<tabItem value="cli" label="CLI">

```bash
constellation apply
```

</tabItem>
<tabItem value="terraform" label="Terraform">

```bash
constellation apply --skip-phases=infrastructure
```

</tabItem>
<tabItem value="self-managed" label="Self-managed">
With the required cloud resources set up, continue with initializing your cluster.

```bash
constellation apply --skip-phases=infrastructure
Expand All @@ -103,7 +80,7 @@ constellation apply --skip-phases=infrastructure
</tabItem>
</tabs>

Next, configure `kubectl` for your cluster:
Finally, configure `kubectl` for your cluster:

```bash
export KUBECONFIG="$PWD/constellation-admin.conf"
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/workflows/lb.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Expose a service
Constellation integrates the native load balancers of each CSP. Therefore, to expose a service simply [create a service of type `LoadBalancer`](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer).


Constellation integrates the native load balancers of each CSP. Therefore, to expose a service simply [create a service of type `LoadBalancer`](https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer).

## Internet-facing LB service on AWS

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/workflows/terminate.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ constellation terminate --yes
```

This deletes all resources created by Constellation in your cloud environment.
All local files created by the `create` and `apply` commands are deleted as well, except for `constellation-mastersecret.json` and the configuration file.
All local files created by the `apply` command are deleted as well, except for `constellation-mastersecret.json` and the configuration file.

:::caution

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/workflows/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If something doesn't work, check out the [known issues](https://github.com/edgel

### Azure: Resource Providers can't be registered

On Azure, you may receive the following error when running `create` or `terminate` with limited IAM permissions:
On Azure, you may receive the following error when running `apply` or `terminate` with limited IAM permissions:

```shell-session
Error: Error ensuring Resource Providers are registered.
Expand All @@ -27,11 +27,11 @@ If you don't have permission to register Resource Providers you may wish to use

To continue, please ensure that the [required resource providers](../getting-started/install.md#required-permissions) have been registered in your subscription by your administrator.

Afterward, set `ARM_SKIP_PROVIDER_REGISTRATION=true` as an environment variable and either run `create` or `terminate` again.
Afterward, set `ARM_SKIP_PROVIDER_REGISTRATION=true` as an environment variable and either run `apply` or `terminate` again.
For example:

```bash
ARM_SKIP_PROVIDER_REGISTRATION=true constellation create
ARM_SKIP_PROVIDER_REGISTRATION=true constellation apply
```

Or alternatively, for `terminate`:
Expand Down
3 changes: 2 additions & 1 deletion docs/docs/workflows/trusted-launch.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ AZURE_IMAGE_VERSION=2.2.0 AZURE_RESOURCE_GROUP_NAME=constellation-images AZURE_I
```

The script creates the following resources:

1. A new image gallery with the default name `constellation-import`
2. A new image definition with the default name `constellation`
3. The actual image with the provided version. In this case `2.2.0`
Expand All @@ -42,7 +43,7 @@ constellation config fetch-measurements -u$URL -s$URL.sig

:::info

The [constellation create](create.md) command will issue a warning because manually imported images aren't recognized as production grade images:
The [`constellation apply`](create.md) command will issue a warning because manually imported images aren't recognized as production grade images:

```shell-session
Configured image doesn't look like a released production image. Double check image before deploying to production.
Expand Down

0 comments on commit ef1da10

Please sign in to comment.