Skip to content

Commit afd00d1

Browse files
Document plural up (#248)
Also backfills some missing terraform docs. I think we probably need to devote an entire section to the terraform provider but not handling that for now. We'd also ideally embed a getting started video in here.
1 parent 2ff55cc commit afd00d1

File tree

7 files changed

+219
-26
lines changed

7 files changed

+219
-26
lines changed

pages/deployments/cli-quickstart.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,67 @@ This guide goes over how to deploy your services with the Plural CLI. At the end
1414

1515
## Onboard to Plural and install the Plural Console
1616

17-
If you haven't already, you'll need to follow the Plural guide to install Console. You can use the guide for the [in-browser Cloud Shell](/getting-started/cloud-shell-quickstart) or the [CLI](/getting-started/quickstart) to get started.
17+
If you haven't already, you'll need to follow the Plural guide to install Console. There are two recommended ways to do this:
1818

19-
{% callout severity="info" %}
20-
`plural cd` is an alias for `plural deployments`, and can be used interchangeably within the CLI.
19+
- [Bring Your Own Cluster](/deployments/existing-cluster) - you've created a kubernetes cluster your way with all the main prequisites. You can use helm to install the management plane and then use the Console to manage itself from there.
20+
- `plural up` - a single command to create a new management cluster on the major clouds, wire up a basic GitOps setup and get you started.
21+
22+
Both are pretty flexible, and even if you chose to use the BYOK method, we recommend looking into some of our example `plural up` repos to get some ideas on how to use our CRDs and terraform provider with all the other tools they'll commonly touch. You can see an example `plural up` repository [here](https://github.com/pluralsh/plural-up-demo).
23+
24+
## Use `plural up` to create your first management console
25+
26+
First you'll want to follow our guide [here](getting-started/cli-quickstart) to install our CLI. Once you've done this, you'll simply run:
27+
28+
```sh
29+
plural up # optionally add --service-account <email> if you want to use a service account to group manage this console
30+
```
31+
32+
{% callout severity="warn" %}
33+
`plural up` is best run in an empty repo. That will let it oauth to github/gitlab and create the repository for you, alongside registering pull deploy keys to register it in your new console.
2134
{% /callout %}
2235

23-
## Set Environment Variables
36+
This will do a few things:
37+
38+
- create a new repo to house your IaC and yaml manifests
39+
- execute terraform to create the new cluster
40+
- execute another terraform stack to provision the GitOps setup for the Plural Console and any other services you'd like to deploy from that repo
41+
42+
We've also generated a README that should give an overview of how the repo can be used for things like:
43+
44+
- creating and registering new workload clusters with terraform
45+
- adding new services in the main infra repo
46+
- handling updates to the cluster terraform at your own pace
2447

25-
If you haven't already, you'll need to set your Console URL and Console token. Set them with:
48+
## Set Up the `plural cd` CLI
49+
50+
If you'd like to configure the plural cli to communicate with your new Console instance, the configuration process is pretty simple, you'll need to set your Console URL and Console token. Set them with:
2651

2752
```
2853
PLURAL_CONSOLE_URL
2954
PLURAL_CONSOLE_TOKEN
3055
```
3156

32-
## Create Clusters
57+
or alternatively you can run `plural cd login` to set them to a config file within `~/.plural`
3358

34-
To deploy additional clusters, use the `plural cd clusters create` command. As an example:
59+
{% callout severity="info" %}
60+
`plural cd` is an alias for `plural deployments`, and can be used interchangeably within the CLI.
61+
{% /callout %}
3562

36-
```
37-
plural cd clusters create --handle <CLUSTER_HANDLE> --version <K8s_VERSION> CLUSTER_NAME
38-
```
63+
## List Clusters, Services, Repositories
64+
65+
The following commands can help you list a lot of the clusters, services, etc that have already been registered:
3966

40-
To import an existing cluster, see the guide for [existing clusters](/deployments/existing-cluster).
67+
```sh
68+
plural cd clusters list
69+
plural cd services list @{cluster-handle}
70+
plural cd repositories list
71+
```
4172

4273
## Import Git Repositories and Deploy services
4374

4475
You'll need to then import the Git repository containing your service and the associated Kubernetes manifests. To do so, use `plural cd repositories create`:
4576

46-
```
77+
```sh
4778
plural cd repositories create --url <REPO_URL>
4879
```
4980

@@ -53,7 +84,7 @@ To then deploy your service, find the repo ID for the service you want to deploy
5384

5485
You can then use the `plural cd services create` command:
5586

56-
```
87+
```sh
5788
plural cd services create --name <SERVICE_NAME> --namespace <SERVICE_NAMESPACE> --repo-id <REPO_ID> --git-ref <GIT_REF> --git-folder <GIT_FOLDER> CLUSTER_ID
5889

5990
```

pages/deployments/cluster-cost.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,14 @@ We recommend you configure it as a global service, as that will ensure it's inst
1919

2020
## How Kubernetes Node Autoscaling Works
2121

22-
Kubernetes has its own mechanism of managing autoscaling. Instead of using familiar patterns like EC2 autoscaling groups, ultimately keyed on CPU or memory utilization, kubernetes will add or removed nodes based on whether there are outstanding pods that cannot be scheduled to any worker given the currently configured pod requests.
22+
Kubernetes has its own mechanism of managing autoscaling. Instead of using familiar patterns like EC2 autoscaling groups, ultimately keyed on CPU or memory utilization, kubernetes will add or remove nodes based on whether there are outstanding pods that cannot be scheduled to any worker given the currently configured pod requests.
2323

24+
<<<<<<< Updated upstream
2425
There are also some other constraints that kubernetes will cause autoscaling for, e.g. pods that have scheduling constraints preventing them to be scheduling on the same nodes as other (thus requiring a new node), pods that must be in a specific availability zone or other node pool, pods that must remain due to a PodDisruptionBudget.
26+
=======
27+
There are also some other constraints that kubernetes will cause autoscaling for, eg pods that have scheduling constraints preventing them to be scheduling on the same nodes as others (thus requiring a new node), pods that must be in a specific availability zone or other node pool, pods that must remain due to a PodDisruptionBudget.
28+
29+
> > > > > > > Stashed changes
2530
2631
This does lead to much more powerful autoscaling constructs but can lead to a bit of confusion for new users. To leverage kubernetes autoscaling properly you'll need to be sure you're putting sane resource requests on your pods and also have some of those edge cases in mind.
2732

pages/deployments/cluster-create.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,72 @@ If you click on a cluster and go to its properties page, you should be able to a
3535

3636
## Create Using Terraform
3737

38-
Coming Soon!
38+
```tf
39+
resource "plural_provider" "aws_provider" {
40+
name = "aws"
41+
cloud = "aws"
42+
cloud_settings = {
43+
aws = {
44+
# access_key_id = "" # Required, can be sourced from PLURAL_AWS_ACCESS_KEY_ID
45+
# secret_access_key = "" # Required, can be sourced from PLURAL_AWS_SECRET_ACCESS_KEY
46+
}
47+
}
48+
}
49+
50+
data "plural_provider" "aws_provider" {
51+
cloud = "aws"
52+
}
53+
54+
resource "plural_cluster" "aws_cluster" {
55+
name = "aws-cluster-tf"
56+
handle = "awstf"
57+
version = "1.24"
58+
provider_id = data.plural_provider.aws_provider.id
59+
cloud = "aws"
60+
protect = "false"
61+
cloud_settings = {
62+
aws = {
63+
region = "us-east-1"
64+
}
65+
}
66+
node_pools = {
67+
pool1 = {
68+
name = "pool1"
69+
min_size = 1
70+
max_size = 5
71+
instance_type = "t5.large"
72+
},
73+
pool2 = {
74+
name = "pool2"
75+
min_size = 1
76+
max_size = 5
77+
instance_type = "t5.large"
78+
labels = {
79+
"key1" = "value1"
80+
"key2" = "value2"
81+
},
82+
taints = [
83+
{
84+
key = "test"
85+
value = "test"
86+
effect = "NoSchedule"
87+
}
88+
]
89+
},
90+
pool3 = {
91+
name = "pool3"
92+
min_size = 1
93+
max_size = 5
94+
instance_type = "t5.large"
95+
cloud_settings = {
96+
aws = {
97+
launch_template_id = "test"
98+
}
99+
}
100+
}
101+
}
102+
tags = {
103+
"managed-by" = "terraform-provider-plural"
104+
}
105+
}
106+
```

pages/deployments/credentials.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,17 @@ Once created, you'll be able to see a new service named `capi-{cloud}` in your m
1717

1818
## Create using Terraform
1919

20-
Coming Soon!
20+
```tf
21+
resource "plural_provider" "aws_provider" {
22+
name = "aws"
23+
cloud = "aws"
24+
cloud_settings = {
25+
aws = {
26+
# access_key_id = "" # Required, can be sourced from PLURAL_AWS_ACCESS_KEY_ID
27+
# secret_access_key = "" # Required, can be sourced from PLURAL_AWS_SECRET_ACCESS_KEY
28+
}
29+
}
30+
}
31+
```
32+
33+
You can find some more examples at https://github.com/pluralsh/terraform-provider-plural/blob/main/example

pages/deployments/import-cluster.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ description: Set Up deployments to an existing, self-managed cluster
55

66
## Overview
77

8-
Most users will have created a significant amount of kubernetes infrastructure with tooling like terraform, pulumi or other forms of infrastructure automation. You can easily configure deployments to these clusters by installing our agent with a single command, and Plural CD will manage that agent from then on without any manual intervention.
8+
Most users will have created a significant amount of kubernetes infrastructure with tooling like terraform, pulumi or other forms of infrastructure automation. It's also very common for users to prefer sticking with their tried-and-true IaC patterns rather than futzing with cluster api, which we completely appreciate and wish to support fully.
9+
10+
You can easily configure deployments to these clusters by installing our agent with a single command, and Plural CD will manage that agent from then on without any manual intervention.
911

1012
## Installation
1113

@@ -23,10 +25,20 @@ plural cd bootstrap --name {name} --tag {name}={value} --tag {name2}={value2}
2325

2426
## Terraform
2527

26-
You can also set up a BYOK cluster via terraform with the following:
28+
You can also set up a BYOK cluster via terraform with the following (this would be for an eks cluster already created elsewhere in terraform):
2729

2830
```tf
29-
Coming Soon!
31+
resource "plural_cluster" "this" {
32+
handle = "your-cluster-handle"
33+
name = "human-readable-name"
34+
tags = var.tags
35+
protect = true # or false
36+
kubeconfig = {
37+
host = data.aws_eks_cluster.cluster.endpoint
38+
cluster_ca_certificate = base64decode(data.aws_eks_cluster.cluster.certificate_authority.0.data)
39+
token = data.aws_eks_cluster_auth.cluster.token
40+
}
41+
}
3042
```
3143

3244
## Networking Considerations

pages/deployments/services-deploy.md

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,70 @@ You can find the repo-id for your desired repository by running `plural cd repos
2727

2828
You should then see your service show up when calling `plural cd services list`.
2929

30+
## Create Using GitOps
31+
32+
We definitely recommend you read over our [operator docs](deployments/using-operator) to see the various CRDs you can use to define your services and patterns available there. For most use cases this will be the most robust workflow.
33+
3034
## Create Using Terraform
3135

32-
Coming Soon!
36+
There are some times where you'd still want to use terraform to create a service, a common pattern would be in bootstrapping the environment for a team or something similar.
37+
38+
```tf
39+
data "plural_cluster" "byok_workload_cluster" {
40+
handle = "gcp-workload-cluster"
41+
}
42+
43+
data "plural_git_repository" "cd-test" {
44+
url = "https://github.com/pluralsh/plrl-cd-test.git"
45+
}
46+
47+
resource "plural_service_deployment" "cd-test" {
48+
# Required
49+
name = "tf-cd-test"
50+
namespace = "tf-cd-test"
51+
52+
cluster = {
53+
handle = data.plural_cluster.byok_workload_cluster.handle
54+
}
55+
56+
repository = {
57+
id = data.plural_git_repository.cd-test.id
58+
ref = "main"
59+
folder = "kubernetes"
60+
}
61+
62+
# Optional
63+
version = "0.0.2"
64+
docs_path = "doc"
65+
protect = false
66+
67+
configuration = [
68+
{
69+
name : "host"
70+
value : "tf-cd-test.gcp.plural.sh"
71+
},
72+
{
73+
name : "tag"
74+
value : "sha-4d01e86"
75+
}
76+
]
77+
78+
sync_config = {
79+
namespace_metadata = {
80+
annotations = {
81+
"testannotationkey" : "testannotationvalue"
82+
}
83+
labels = {
84+
"testlabelkey" : "testlabelvalue"
85+
}
86+
}
87+
}
88+
89+
depends_on = [
90+
data.plural_cluster.byok_workload_cluster,
91+
data.plural_git_repository.cd-test
92+
]
93+
}
94+
```
95+
96+
You can see some more examples [here](https://github.com/pluralsh/terraform-provider-plural/blob/main/example/service/)

src/NavData.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const rootNavData: NavMenu = deepFreeze([
5858
],
5959
},
6060
{
61-
title: 'Plural Continuous Deployment',
61+
title: 'Plural Fleet Management',
6262
sections: [
6363
{
6464
href: '/getting-started/deployments',
@@ -72,10 +72,10 @@ const rootNavData: NavMenu = deepFreeze([
7272
title: 'Quickstart with our CLI',
7373
href: '/deployments/cli-quickstart',
7474
},
75-
{
76-
href: '/deployments/browser-quickstart',
77-
title: 'Quickstart from your Browser',
78-
},
75+
// {
76+
// href: '/deployments/browser-quickstart',
77+
// title: 'Quickstart from your Browser',
78+
// },
7979
{
8080
href: '/deployments/existing-cluster',
8181
title: 'Set Up on your own Cluster',
@@ -132,7 +132,7 @@ const rootNavData: NavMenu = deepFreeze([
132132
},
133133
{
134134
href: '/deployments/cluster-create',
135-
title: 'Create Workload Clusters',
135+
title: 'Create Cluster API Workload Clusters',
136136
},
137137
// {
138138
// href: '/deployments/cluster-config',

0 commit comments

Comments
 (0)