From ebe8aa4bac2ce97eefbd89a542f45b562eda3b2a Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Tue, 10 Dec 2024 15:58:03 +0100 Subject: [PATCH 1/2] add default catalogs service setup --- apps/repositories/console.yaml | 8 ---- apps/repositories/runtime.yaml | 26 ----------- apps/services/cert-manager.yaml | 24 ---------- apps/services/console.yaml | 24 ---------- apps/services/flux.yaml | 24 ---------- .../pr-automation/cluster-creator.yaml | 44 ------------------- apps/services/pr-automation/scm.yaml | 8 ---- apps/services/settings.yaml | 10 ----- apps/services/setup.yaml | 15 ------- .../runtime.yaml => setup/catalogs.yaml | 25 ++++++----- 10 files changed, 13 insertions(+), 195 deletions(-) delete mode 100644 apps/repositories/console.yaml delete mode 100644 apps/repositories/runtime.yaml delete mode 100644 apps/services/cert-manager.yaml delete mode 100644 apps/services/console.yaml delete mode 100644 apps/services/flux.yaml delete mode 100644 apps/services/pr-automation/cluster-creator.yaml delete mode 100644 apps/services/pr-automation/scm.yaml delete mode 100644 apps/services/settings.yaml delete mode 100644 apps/services/setup.yaml rename apps/services/runtime.yaml => setup/catalogs.yaml (52%) diff --git a/apps/repositories/console.yaml b/apps/repositories/console.yaml deleted file mode 100644 index 3cab786..0000000 --- a/apps/repositories/console.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: console - namespace: infra -spec: - interval: 5m0s - url: https://pluralsh.github.io/console \ No newline at end of file diff --git a/apps/repositories/runtime.yaml b/apps/repositories/runtime.yaml deleted file mode 100644 index d6dd249..0000000 --- a/apps/repositories/runtime.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: runtime - namespace: infra -spec: - interval: 5m0s - url: https://pluralsh.github.io/bootstrap ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: cert-manager - namespace: infra -spec: - interval: 5m0s - url: https://charts.jetstack.io ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: flux - namespace: infra -spec: - interval: 5m0s - url: https://fluxcd-community.github.io/helm-charts \ No newline at end of file diff --git a/apps/services/cert-manager.yaml b/apps/services/cert-manager.yaml deleted file mode 100644 index 6ed13eb..0000000 --- a/apps/services/cert-manager.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: ServiceDeployment -metadata: - name: cert-manager - namespace: infra -spec: - namespace: cert-manager - git: - folder: helm-values - ref: main - repositoryRef: - kind: GitRepository - name: infra - namespace: infra - helm: - version: "v1.x.x" - chart: cert-manager - url: https://charts.jetstack.io - valuesFiles: - - certmanager.yaml - clusterRef: - kind: Cluster - name: mgmt - namespace: infra \ No newline at end of file diff --git a/apps/services/console.yaml b/apps/services/console.yaml deleted file mode 100644 index 96b5db7..0000000 --- a/apps/services/console.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: ServiceDeployment -metadata: - name: console - namespace: infra -spec: - namespace: plrl-console - git: - folder: helm-values - ref: main - repositoryRef: - kind: GitRepository - name: infra - namespace: infra - helm: - version: "0.x.x" - chart: console - url: https://pluralsh.github.io/console - valuesFiles: - - console.yaml - clusterRef: - kind: Cluster - name: mgmt - namespace: infra diff --git a/apps/services/flux.yaml b/apps/services/flux.yaml deleted file mode 100644 index 6dbd5e5..0000000 --- a/apps/services/flux.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: ServiceDeployment -metadata: - name: flux - namespace: infra -spec: - namespace: flux - git: - folder: helm-values - ref: main - repositoryRef: - kind: GitRepository - name: infra - namespace: infra - helm: - version: "2.12.2" - chart: flux2 - url: https://fluxcd-community.github.io/helm-charts - valuesFiles: - - flux.yaml - clusterRef: - kind: Cluster - name: mgmt - namespace: infra \ No newline at end of file diff --git a/apps/services/pr-automation/cluster-creator.yaml b/apps/services/pr-automation/cluster-creator.yaml deleted file mode 100644 index a1fb72d..0000000 --- a/apps/services/pr-automation/cluster-creator.yaml +++ /dev/null @@ -1,44 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: PrAutomation -metadata: - name: cluster-creator -spec: - name: cluster-creator - documentation: | - Sets up a PR to provision a cluster for a fleet + stage - creates: - templates: - - source: templates/clusters/stack.yaml - destination: "apps/clusters/{{ context.cloud }}/stacks/{{ context.name }}.yaml" - external: false - - source: templates/clusters/cluster.yaml - destination: "apps/clusters/{{ context.cloud }}/clusters/{{ context.name }}.yaml" - external: false - - source: templates/clusters/clusters.yaml - destination: "apps/services/clusters.yaml" - external: false - scmConnectionRef: - name: github # 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" - identifier: [[ .Identifier ]] # REPLACEME with your own repo slug - configuration: - - name: name - type: STRING - documentation: name for this cluster - - name: cloud - type: ENUM - documentation: the cloud you'll host on - values: - - aws - - gcp - - azure - - name: fleet - type: STRING - documentation: a 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 diff --git a/apps/services/pr-automation/scm.yaml b/apps/services/pr-automation/scm.yaml deleted file mode 100644 index ed8d5ed..0000000 --- a/apps/services/pr-automation/scm.yaml +++ /dev/null @@ -1,8 +0,0 @@ -# You will need to manually create the github scm connection this refers to -# apiVersion: deployments.plural.sh/v1alpha1 -# kind: ScmConnection -# metadata: -# name: github -# spec: -# name: github -# type: GITHUB \ No newline at end of file diff --git a/apps/services/settings.yaml b/apps/services/settings.yaml deleted file mode 100644 index 0427af7..0000000 --- a/apps/services/settings.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: DeploymentSettings -metadata: - name: global - namespace: plrl-deploy-operator -spec: - stacks: - jobSpec: - namespace: plrl-deploy-operator - serviceAccount: stacks diff --git a/apps/services/setup.yaml b/apps/services/setup.yaml deleted file mode 100644 index f446658..0000000 --- a/apps/services/setup.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: deployments.plural.sh/v1alpha1 -kind: GitRepository -metadata: - name: infra - namespace: infra -spec: - url: [[ .RepoUrl ]] ---- -apiVersion: deployments.plural.sh/v1alpha1 -kind: Cluster -metadata: - name: mgmt - namespace: infra -spec: - handle: mgmt \ No newline at end of file diff --git a/apps/services/runtime.yaml b/setup/catalogs.yaml similarity index 52% rename from apps/services/runtime.yaml rename to setup/catalogs.yaml index 5fe2314..20f9af2 100644 --- a/apps/services/runtime.yaml +++ b/setup/catalogs.yaml @@ -1,23 +1,24 @@ apiVersion: deployments.plural.sh/v1alpha1 +kind: GitRepository +metadata: + name: scaffolds + namespace: infra +spec: + url: https://github.com/pluralsh/scaffolds.git +--- +apiVersion: deployments.plural.sh/v1alpha1 kind: ServiceDeployment metadata: - name: runtime + name: catalogs namespace: infra spec: - namespace: plural-runtime - git: - folder: helm-values - ref: main repositoryRef: kind: GitRepository - name: infra + name: scaffolds namespace: infra - helm: - version: "0.x.x" - chart: runtime - url: https://pluralsh.github.io/bootstrap - valuesFiles: - - runtime.yaml + git: + folder: setup/catalogs + ref: main clusterRef: kind: Cluster name: mgmt From 6627f34560cc93ab976f55179ea815aaeae23c7b Mon Sep 17 00:00:00 2001 From: Sebastian Florek Date: Thu, 12 Dec 2024 14:21:10 +0100 Subject: [PATCH 2/2] make catalog service protected --- setup/catalogs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/catalogs.yaml b/setup/catalogs.yaml index 20f9af2..93080dc 100644 --- a/setup/catalogs.yaml +++ b/setup/catalogs.yaml @@ -23,3 +23,4 @@ spec: kind: Cluster name: mgmt namespace: infra + protect: true