-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathrhdh-cr-with-app-configs.yaml
220 lines (211 loc) · 5.64 KB
/
rhdh-cr-with-app-configs.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
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
apiVersion: v1
kind: ConfigMap
metadata:
name: my-backstage-config-backend-auth
data:
"app-config.backend-auth.yaml": |
backend:
auth:
externalAccess:
- type: legacy
options:
subject: legacy-default-config
secret: "${BACKEND_SECRET}"
auth:
environment: development
providers:
guest:
# using the guest user to query the '/api/dynamic-plugins-info/loaded-plugins' endpoint.
dangerouslyAllowOutsideDevelopment: true
---
apiVersion: v1
kind: Secret
metadata:
name: my-backstage-backend-auth-secret
stringData:
# generated with the command below (from https://backstage.io/docs/auth/service-to-service-auth/#setup):
# node -p 'require("crypto").randomBytes(24).toString("base64")'
BACKEND_SECRET: "R2FxRVNrcmwzYzhhN3l0V1VRcnQ3L1pLT09WaVhDNUEK" # notsecret
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-backstage-config-cm1
data:
app-config1-cm1.db.yaml: |
backend:
database:
connection:
password: ${POSTGRESQL_PASSWORD}
user: ${POSTGRESQL_USER}
app-config2-cm1.yaml: |
# Some comment in this file
app-config3-cm1.odo.yaml: |
catalog:
locations:
- type: url
target: https://github.com/ododev/odo-backstage-software-template/blob/main/template.yaml
rules:
- allow: [Template]
# # catalog.providers.githubOrg.default.orgUrl
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-backstage-config-cm2
data:
app-config1-cm2.gh.yaml: |
auth:
# see https://backstage.io/docs/auth/ to learn about auth providers
environment: development
providers:
github:
development:
clientId: '${GH_CLIENT_ID}'
clientSecret: '${GH_CLIENT_SECRET}'
app-config2-cm2.yaml: |
# a comment
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-dynamic-plugins-config-cm
data:
dynamic-plugins.yaml: |
includes:
- dynamic-plugins.default.yaml
plugins:
- package: ./dynamic-plugins/dist/roadiehq-scaffolder-backend-module-utils-dynamic
disabled: false
- package: './dynamic-plugins/dist/backstage-plugin-catalog-backend-module-github-dynamic'
disabled: false
pluginConfig:
catalog:
providers:
github:
myorg:
organization: '${GITHUB_ORG}'
schedule:
# supports cron, ISO duration, "human duration" (used below)
frequency: { minutes: 30}
# supports ISO duration, "human duration (used below)
timeout: { minutes: 3}
initialDelay: { seconds: 15}
- package: ./dynamic-plugins/dist/backstage-plugin-techdocs-backend-dynamic
disabled: false
pluginConfig:
# Reference documentation https://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
# and an external cloud storage when deploying TechDocs for production use-case.
# https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-basic-to-recommended-deployment-approach
techdocs:
builder: local
generator:
runIn: local
publisher:
type: local
- package: ./dynamic-plugins/dist/backstage-plugin-catalog-backend-module-gitlab-dynamic
disabled: false
pluginConfig:
catalog:
providers:
gitlab: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-env-cm-1
data:
CM_ENV1: "cm env 1"
CM_ENV2: "cm env 2"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-env-cm-11
data:
CM_ENV11: "cm env 11"
CM_ENV12: "cm env 12"
---
apiVersion: v1
kind: Secret
metadata:
name: my-gh-auth-secret
stringData:
GH_CLIENT_ID: "my GH client ID"
GH_CLIENT_SECRET: "my GH client secret"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: my-backstage-extra-files-cm1
data:
cm_file1.txt: |
# From ConfigMap
Lorem Ipsum
Dolor Sit Amet
cm_file2.properties: |
conf.x=y
conf.y=z
---
apiVersion: v1
kind: Secret
metadata:
name: my-backstage-extra-files-secret1
stringData:
secret_file1.txt: |
# From Secret
Lorem Ipsum
Dolor Sit Amet
secret_file2.properties: |
sec.a=b
sec.b=c
secrets.prod.yaml: |
appId: 1
webhookUrl: https://smee.io/foo
clientId: someGithubAppClientId
clientSecret: someGithubAppClientSecret
webhookSecret: someWebhookSecret
privateKey: |
SomeRsaPrivateKey
---
apiVersion: rhdh.redhat.com/v1alpha3
kind: Backstage
metadata:
name: bs-app-config
spec:
database:
enableLocalDb: true
deployment:
patch:
spec:
replicas: 2
application:
appConfig:
configMaps:
- name: "my-backstage-config-backend-auth"
- name: "my-backstage-config-cm1"
- name: "my-backstage-config-cm2"
key: "app-config1-cm2.gh.yaml"
dynamicPluginsConfigMapName: "my-dynamic-plugins-config-cm"
extraFiles:
mountPath: /tmp/my-extra-files
configMaps:
- name: "my-backstage-extra-files-cm1"
secrets:
- name: "my-backstage-extra-files-secret1"
key: secret_file1.txt
extraEnvs:
envs:
- name: GITHUB_ORG
value: 'my-gh-org'
- name: MY_ENV_VAR_2
value: my-value-2
configMaps:
- name: my-env-cm-1
- name: my-env-cm-11
key: CM_ENV11
secrets:
- name: "my-backstage-backend-auth-secret"
key: BACKEND_SECRET
- name: my-gh-auth-secret