Skip to content

Commit ae949f8

Browse files
authored
fix: stacks page 404ing (#400)
1 parent c3f10a2 commit ae949f8

File tree

4 files changed

+72
-79
lines changed

4 files changed

+72
-79
lines changed

pages/deployments/stacks.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,72 @@
22
title: Stacks
33
description: How to manage Infrastructure as Code at Scale Using Plural
44
---
5+
6+
The goal of Plural Stacks is to provide a scalable framework to manage infrastructure as code like Terraform, Ansible and Pulumi with a kubernetes-friendly, api-driven approach. The core workflow is as follows:
7+
8+
* Declaratively define a stack with a type (terraform, ansible, etc), a location in a git repository to source code from, and a cluster on which it will execute
9+
* On each commit to the tracked git repository, a run is created which the Plural deployment operator will detect and execute on the targeted cluster
10+
- this allows users to fine grain permissions and network location of IaC runs where both are necessary to configure.
11+
* Plural will carefully execute the run for you, and besides basic information like communicating stdout to the UI, we will also gather and present useful information like inputs/outputs, terraform state diagrams and more
12+
* On PRs to the tracked repository, a "plan" run is also executed and comments posted on the relevant PR where possible.
13+
14+
To get a better idea of the full power of the experience, feel free to take a look at this demo video (at 2x speed if you want to save some time):
15+
16+
{% embed url="https://youtu.be/06WXbvw6p3w" aspectRatio="16 / 9" /%}
17+
18+
# A Basic Stack
19+
20+
The most common way to instantiate a stack is via Kubernetes CRD. This gives a flexible, modular way of recreating infrastructure with Terraform and pairs nicely with our PR Automation tooling for full self-service around IaC.
21+
22+
Here's an example:
23+
24+
```yaml
25+
apiVersion: deployments.plural.sh/v1alpha1
26+
kind: InfrastructureStack
27+
metadata:
28+
name: gke-demo
29+
namespace: stacks
30+
spec:
31+
name: gke-demo
32+
type: TERRAFORM
33+
approval: true
34+
detach: false
35+
manageState: true
36+
37+
configuration:
38+
version: 1.8.2
39+
repositoryRef:
40+
name: fleet
41+
namespace: fleets
42+
clusterRef:
43+
name: mgmt
44+
namespace: infra
45+
workdir: gke-cluster
46+
git:
47+
ref: main
48+
folder: terraform
49+
files:
50+
- mountPath: /plural
51+
secretRef:
52+
name: gcp-creds
53+
environment:
54+
- name: GOOGLE_APPLICATION_CREDENTIALS
55+
value: /plural/creds.json
56+
- name: TF_VAR_cluster
57+
value: gke-demo
58+
- name: TF_VAR_tier
59+
value: dev
60+
- name: TF_VAR_fleet
61+
value: gke-dem
62+
```
63+
64+
The meaning of this yaml is pretty self-documenting, we are:
65+
66+
* creating a `TERRAFORM` stack, so it will execute the standard terraform workflow
67+
* we're using Plural as the state store, removing the need to configure S3 or other backends manually
68+
* `approval` will be required before `terraform apply` will trigger, ensuring a human verifies the plan first to reduce misconfiguration risk
69+
* we're sourcing manifests from the `fleet` repository (referencing a `GitRepository` crd)
70+
* we're executing on the `mgmt` cluster (referencing a `Cluster` crd)
71+
* and we're executing in the `terraform/gke-cluster` folder
72+
73+
You can also see you can bind files and environment variables into the environment, although it is still best practice to use IRSA, GKE workload identity or similar mechanisms for issuing cloud credentials.

pages/stacks/overview.md

Lines changed: 0 additions & 73 deletions
This file was deleted.

src/NavData.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,9 @@ const rootNavData: NavMenu = deepFreeze([
153153
],
154154
},
155155
{
156-
href: '/stacks/',
157-
title: 'Iac Management with Stacks',
156+
href: '/deployments/stacks/',
157+
title: 'IaC Management with Stacks',
158158
sections: [
159-
{
160-
title: 'Overview',
161-
href: '/stacks/overview',
162-
},
163159
{
164160
title: 'Customizing Stack Runners',
165161
href: '/stacks/customize-runners',

src/generated/graphql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3799,6 +3799,7 @@ export type RootQueryType = {
37993799
invoices?: Maybe<InvoiceConnection>;
38003800
keyBackup?: Maybe<KeyBackup>;
38013801
keyBackups?: Maybe<KeyBackupConnection>;
3802+
licenseKey?: Maybe<Scalars['String']['output']>;
38023803
loginMethod?: Maybe<LoginMethodResponse>;
38033804
loginMetrics?: Maybe<Array<Maybe<GeoMetric>>>;
38043805
me?: Maybe<User>;

0 commit comments

Comments
 (0)