constellation/docs/versioned_docs/version-2.0/workflows/create.md

79 lines
2.0 KiB
Markdown
Raw Normal View History

2022-09-02 05:52:42 -04:00
# Create your cluster
Creating your cluster requires two steps:
1. Creating the necessary resources in your cloud environment
2. Bootstrapping the Constellation cluster and setting up a connection
See the [architecture](../architecture/orchestration.md) section for details on the inner workings of this process.
## The *create* step
This step creates the necessary resources for your cluster in your cloud environment.
### Configuration
2022-09-28 10:31:47 -04:00
Generate a configuration file for your cloud service provider (CSP):
2022-09-02 05:52:42 -04:00
2022-09-09 11:01:57 -04:00
<tabs groupId="csp">
<tabItem value="azure" label="Azure">
2022-09-02 05:52:42 -04:00
```bash
constellation config generate azure
```
</tabItem>
<tabItem value="gcp" label="GCP">
2022-09-02 05:52:42 -04:00
```bash
constellation config generate gcp
```
</tabItem>
</tabs>
2022-09-28 10:31:47 -04:00
This creates the file `constellation-conf.yaml` in the current directory. [Fill in your CSP-specific information](../getting-started/first-steps.md#create-a-cluster) before you continue.
2022-09-02 05:52:42 -04:00
2022-09-28 10:31:47 -04:00
Next, download the trusted measurements for your configured image.
2022-09-02 05:52:42 -04:00
```bash
constellation config fetch-measurements
```
2022-09-28 10:31:47 -04:00
For details, see the [verification section](../workflows/verify-cluster.md).
2022-09-02 05:52:42 -04:00
### Create
2022-09-28 10:31:47 -04:00
Choose the initial size of your cluster.
2022-09-02 05:52:42 -04:00
The following command creates a cluster with one control-plane and two worker nodes:
```bash
2022-09-28 10:31:47 -04:00
constellation create --control-plane-nodes 1 --worker-nodes 2
2022-09-02 05:52:42 -04:00
```
2022-09-28 10:31:47 -04:00
For details on the flags, consult the command help via `constellation create -h`.
2022-09-02 05:52:42 -04:00
2022-09-28 10:31:47 -04:00
*create* stores your cluster's configuration to a file named [`constellation-state.json`](../architecture/orchestration.md#installation-process) in your current directory.
2022-09-02 05:52:42 -04:00
## The *init* step
The following command initializes and bootstraps your cluster:
```bash
constellation init
```
To enable autoscaling in your cluster, add the `--autoscale` flag:
```bash
constellation init --autoscale
```
2022-09-28 10:31:47 -04:00
Next, configure `kubectl` for your cluster:
2022-09-02 05:52:42 -04:00
```bash
export KUBECONFIG="$PWD/constellation-admin.conf"
```
🏁 That's it. You've successfully created a Constellation cluster.