-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
256 lines (232 loc) · 9.57 KB
/
template.yaml
File metadata and controls
256 lines (232 loc) · 9.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: crossplane-storage-queue
title: Azure Storage Queue
description: >
Creates a pull request to add a Crossplane StorageQueue claim and an ArgoCD
Application manifest to an existing service repository.
tags:
- crossplane
- azure
- storage
- queue
- infrastructure
spec:
owner: group:platform-engineering
type: infrastructure
parameters:
- title: Target Service
required:
- targetComponent
properties:
targetComponent:
title: Target Component
type: string
description: The catalog component to add the storage queue to
ui:field: EntityPicker
ui:options:
catalogFilter:
- kind: Component
defaultKind: Component
- title: Storage Queue Configuration
required:
- namespace
- environment
- storageAccountName
- queueName
properties:
namespace:
title: Kubernetes Namespace
type: string
description: Namespace where the Crossplane StorageQueue claim will be created
environment:
title: Environment
type: string
description: Target environment / cluster
default: kind
enum:
- kind
- azure
- aws
enumNames:
- Kind (local)
- Azure AKS
- AWS EKS
storageAccountName:
title: Storage Account Name
type: string
description: >
Azure Storage Account name — must be globally unique,
3-24 characters, lowercase alphanumeric only (no hyphens).
pattern: '^[a-z0-9]{3,24}$'
queueName:
title: Queue Name
type: string
description: Name of the Azure Storage Queue to create
location:
title: Azure Region
type: string
description: Azure region where the storage resources will be provisioned
default: westus2
enum:
- eastus
- eastus2
- westus
- westus2
- westus3
- centralus
- northcentralus
- southcentralus
- westcentralus
enumNames:
- East US
- East US 2
- West US
- West US 2
- West US 3
- Central US
- North Central US
- South Central US
- West Central US
storageAccountTier:
title: Storage Account Tier
type: string
description: Performance tier for the storage account
default: Standard
enum:
- Standard
- Premium
replicationType:
title: Replication Type
type: string
description: Azure storage replication strategy
default: LRS
enum:
- LRS
- GRS
- ZRS
- RAGRS
enumNames:
- Locally Redundant Storage (LRS)
- Geo-Redundant Storage (GRS)
- Zone-Redundant Storage (ZRS)
- Read-Access Geo-Redundant Storage (RAGRS)
- title: ArgoCD Configuration
required:
- argocdProject
properties:
argocdProject:
title: ArgoCD Project
type: string
description: The ArgoCD project this application will be associated with
default: kind-cluster
targetRevision:
title: Target Revision
type: string
description: Git branch that ArgoCD will track for this application
default: main
steps:
- id: fetch-entity
name: Fetch Target Component
action: catalog:fetch
input:
entityRef: ${{ parameters.targetComponent }}
- id: fetch-template
name: Generate Service Repo Manifests
action: fetch:template
input:
url: ./skeleton
targetPath: ./service-repo
values:
serviceName: ${{ steps['fetch-entity'].output.entity.metadata.name }}
repoOwner: ${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[0] }}
repoName: ${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1] }}
repoNameSanitized: ${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1].replace('.', '-') }}
namespace: ${{ parameters.namespace }}
environment: ${{ parameters.environment }}
storageAccountName: ${{ parameters.storageAccountName }}
queueName: ${{ parameters.queueName }}
location: ${{ parameters.location }}
storageAccountTier: ${{ parameters.storageAccountTier }}
replicationType: ${{ parameters.replicationType }}
argocdProject: ${{ parameters.argocdProject }}
targetRevision: ${{ parameters.targetRevision }}
- id: fetch-template-flux
name: Generate Flux Manifests
action: fetch:template
input:
url: ./skeleton-flux
targetPath: ./flux-repo
values:
repoNameSanitized: ${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1].replace('.', '-') }}
environment: ${{ parameters.environment }}
- id: create-service-pr
name: Create Service Repo Pull Request
action: publish:github:pull-request
input:
repoUrl: github.com?owner=${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[0] }}&repo=${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1] }}
sourcePath: ./service-repo
title: "feat: add Crossplane StorageQueue for ${{ steps['fetch-entity'].output.entity.metadata.name }}"
branchName: feat/crossplane-storage-queue-${{ steps['fetch-entity'].output.entity.metadata.name }}
description: |
## Azure Storage Queue Infrastructure
This PR provisions an Azure Storage Queue for the **${{ steps['fetch-entity'].output.entity.metadata.name }}** service using Crossplane.
### Files Added
**Crossplane claim:**
- `deploy/crossplane/base/kustomization.yaml`
- `deploy/crossplane/base/storage-queue.yaml`
- `deploy/crossplane/overlays/${{ parameters.environment }}/kustomization.yaml`
- `deploy/crossplane/overlays/${{ parameters.environment }}/patch-queue-name.yaml`
**ArgoCD Application:**
- `deploy/argocd/overlays/${{ parameters.environment }}/kustomization.yaml`
- `deploy/argocd/overlays/${{ parameters.environment }}/storage-queue-application.yaml`
> **Note:** If `deploy/argocd/overlays/${{ parameters.environment }}/kustomization.yaml` already
> exists in this repository, do not overwrite it. Instead, only add
> `- storage-queue-application.yaml` to the existing `resources` list and discard
> the kustomization.yaml changes from this PR.
### Configuration
| Parameter | Value |
|-----------|-------|
| Namespace | `${{ parameters.namespace }}` |
| Environment | `${{ parameters.environment }}` |
| Storage Account | `${{ parameters.storageAccountName }}` |
| Queue Name | `${{ parameters.queueName }}` |
| Azure Region | `${{ parameters.location }}` |
| Tier | `${{ parameters.storageAccountTier }}` |
| Replication | `${{ parameters.replicationType }}` |
| ArgoCD Project | `${{ parameters.argocdProject }}` |
| Target Revision | `${{ parameters.targetRevision }}` |
---
Generated by the Crossplane Storage Queue template
- id: create-flux-pr
name: Create Flux Cluster Pull Request
action: publish:github:pull-request
input:
repoUrl: github.com?owner=solthoth&repo=flux-managed-cluster
sourcePath: ./flux-repo
title: "feat: add Crossplane Kustomization for ${{ steps['fetch-entity'].output.entity.metadata.name }}"
branchName: feat/crossplane-storage-queue-${{ steps['fetch-entity'].output.entity.metadata.name }}
description: |
## Flux Kustomization — Azure Storage Queue
This PR registers the Crossplane StorageQueue claim for **${{ steps['fetch-entity'].output.entity.metadata.name }}** with the Flux-managed cluster.
### Files Added
- `apps/overlays/${{ parameters.environment }}/${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1].replace('.', '-') }}-crossplane.yaml`
> **Note:** Add the new file to the `resources` list in the existing
> `apps/overlays/${{ parameters.environment }}/kustomization.yaml`.
### Configuration
| Parameter | Value |
|-----------|-------|
| Source Repository | `${{ steps['fetch-entity'].output.entity.metadata.annotations['github.com/project-slug'].split('/')[1].replace('.', '-') }}` |
| Environment | `${{ parameters.environment }}` |
| Crossplane Path | `./deploy/crossplane/overlays/${{ parameters.environment }}` |
---
Generated by the Crossplane Storage Queue template
output:
links:
- title: Service Repo Pull Request
icon: github
url: ${{ steps['create-service-pr'].output.remoteUrl }}
- title: Flux Cluster Pull Request
icon: github
url: ${{ steps['create-flux-pr'].output.remoteUrl }}