Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sebastian/prod-2981-set-up-catal…
Browse files Browse the repository at this point in the history
…og-pipeline' into sebastian/prod-2981-set-up-catalog-pipeline
  • Loading branch information
maciaszczykm committed Dec 13, 2024
2 parents 7d561e8 + b27ba15 commit 08ff360
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 0 deletions.
7 changes: 7 additions & 0 deletions catalogs/infra/cluster/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: deployments.plural.sh/v1alpha1
kind: Cluster
metadata:
name: {{ context.name }}
namespace: infra
spec:
handle: {{ context.name }}
17 changes: 17 additions & 0 deletions catalogs/infra/cluster/servicedeployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: deployments.plural.sh/v1alpha1
kind: ServiceDeployment
metadata:
name: clusters
namespace: infra
spec:
namespace: infra
git:
folder: services/infra/clusters
ref: main
repositoryRef:
kind: GitRepository
name: infra
namespace: infra
clusterRef:
name: mgmt
namespace: infra
31 changes: 31 additions & 0 deletions catalogs/infra/cluster/stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: deployments.plural.sh/v1alpha1
kind: InfrastructureStack
metadata:
name: cluster-{{ context.name }}
spec:
name: cluster-{{ context.name }}
detach: false
type: TERRAFORM
approval: true
manageState: true
actor: [email protected]
configuration:
version: '1.8'
repositoryRef:
name: infra
namespace: infra
clusterRef:
name: mgmt
namespace: infra
git:
ref: main
folder: terraform/modules/clusters/{{ context.cloud }}
environment:
- name: TF_VAR_cluster
value: {{ context.name }}
- name: TF_VAR_fleet
value: {{ context.fleet }}
- name: TF_VAR_tier
value: {{ context.tier }}
- name: TF_VAR_region
value: {{ context.region }}
12 changes: 12 additions & 0 deletions setup/catalogs/catalogs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,15 @@ spec:
author: Plural
description: |
Sets up OSS devops infrastructure using Plural
---
apiVersion: deployments.plural.sh/v1alpha1
kind: Catalog
metadata:
name: infra
spec:
name: infra
category: data
icon: https://docs.plural.sh/favicon-128.png
author: Plural
description: |
Sets up infrastructure using Plural
53 changes: 53 additions & 0 deletions setup/catalogs/infra/cluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: deployments.plural.sh/v1alpha1
kind: PrAutomation
metadata:
name: cluster
spec:
name: cluster
documentation: |
Sets up a PR to provision a cluster for a fleet + stage
creates:
git:
ref: sebastian/prod-2981-set-up-catalog-pipeline # TODO set to main
folder: catalogs/infra/cluster
templates:
- source: stack.yaml
destination: "services/infra/clusters/{{ context.cloud }}/stacks/{{ context.name }}.yaml"
external: true
- source: cluster.yaml
destination: "services/infra/clusters/{{ context.cloud }}/{{ context.name }}.yaml"
external: true
- source: servicedeployment.yaml
destination: "bootstrap/infra/clusters/servicedeployment.yaml"
external: true
repositoryRef:
name: scaffolds
catalogRef:
name: infra
scmConnectionRef:
name: plural # you'll need to add this ScmConnection manually before this is functional
title: "Adding {{ context.cloud }} cluster: {{ context.name }}"
message: "Adding {{ context.cloud }} cluster {{ context.name }} and registering it with Plural"
configuration:
- name: name
type: STRING
documentation: Name of the cluster.
- name: cloud
type: ENUM
documentation: The cloud provider you'll host on.
values:
- aws
- gcp
- azure
- name: fleet
type: STRING
documentation: Name for the fleet you want this cluster to belong to.
- name: tier
type: ENUM
documentation: What tier to place this cluster in.
values:
- dev
- prd
- name: region
type: STRING
documentation: Region where the cluster should be created.

0 comments on commit 08ff360

Please sign in to comment.