forked from vfarcic/backstage-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backstage-template.yaml
173 lines (173 loc) · 4.63 KB
/
backstage-template.yaml
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
apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
name: crossplane-kubernetes
title: Crossplane Kubernetes
description: Create and Manage Kubernetes Clusters
spec:
owner: vfarcic/crossplane-kubernetes
type: service
parameters:
- title: Service Selector
properties:
name:
type: string
ui:autofocus: true
provider:
type: string
enum:
- aws
- azure
- google
default: aws
namespace:
type: string
repository:
type: string
repositoryUser:
type: string
default: vfarcic
required:
- name
- provider
- namespace
- repository
- title: Service Definition
properties:
version:
title: General version
type: string
nodeSize:
title: General nodeSize
type: string
enum:
- small
- medium
- large
default: small
minNodeCount:
title: General minNodeCount
type: integer
default: 1
namespaces:
title: General namespaces
type: array
default:
- dev
- production
items:
type: string
required:
- nodeSize
- title: Apps
properties:
crossplane:
type: object
properties:
enabled:
title: Crossplane enabled
type: boolean
default: false
required: []
argocd:
type: object
properties:
enabled:
title: Argo CD enabled
type: boolean
default: false
host:
title: Argo CD host
type: string
default: acme.com
repoURL:
title: Argo CD repoURL
type: string
default: https://github.com/vfarcic/SOMETHING
destinationNamespace:
title: Argo CD destinationNamespace
type: string
default: argo-cd
sourcePath:
title: Argo CD sourcePath
type: string
default: '.'
required: []
openfunction:
type: object
properties:
enabled:
title: OpenFunction enabled
type: boolean
default: false
required: []
dapr:
type: object
properties:
enabled:
title: Dapr enabled
type: boolean
default: false
required: []
traefik:
type: object
properties:
enabled:
title: Traefik enabled
type: boolean
default: false
required: []
steps:
- id: log-message
name: Log Message
action: debug:log
input:
message: Created the manifest for the ${{ parameters.name }} Kubernetes cluster.
- id: fetch-template
action: fetch:template
name: Generate manifest
input:
url: manifest-templates
targetPath: manifests
values:
name: ${{ parameters.name }}
namespace: ${{ parameters.namespace }}
provider: ${{ parameters.provider }}
version: ${{ parameters.version }}
nodeSize: ${{ parameters.nodeSize }}
minNodeCount: ${{ parameters.minNodeCount }}
namespaces: ${{ parameters.namespaces }}
crossplane:
enabled: ${{ parameters.crossplane.enabled }}
argocd:
enabled: ${{ parameters.argocd.enabled }}
host: ${{ parameters.argocd.host }}
repoURL: ${{ parameters.argocd.repoURL }}
destinationNamespace: ${{ parameters.argocd.destinationNamespace }}
sourcePath: ${{ parameters.argocd.sourcePath }}
openfunction:
enabled: ${{ parameters.openfunction.enabled }}
dapr:
enabled: ${{ parameters.dapr.enabled }}
traefik:
enabled: ${{ parameters.openfunction.enabled }}
- id: rename-manifest
action: fs:rename
name: Rename files
input:
files:
- from: manifests/cluster-claim.yaml
to: manifests/cluster-claim-${{ parameters.name }}.yaml
- id: create-pull-request
action: publish:github:pull-request
name: Create a pull request
input:
repoUrl: github.com?repo=${{ parameters.repository }}&owner=${{ parameters.repositoryUser }}
branchName: cluster-${{ parameters.name }}
gitCommitMessage: Kubernetes cluster
title: Kubernetes cluster manifest ${{ parameters.name }}
description: This pull request creates the cluster-claim-${{ parameters.name }}.yaml Kubernetes cluster manifest
output:
links:
- title: Pull Request
url: ${{ steps['create-pull-request'].output.remoteUrl }}