@flowfuse/driver-kubernetes 2.22.0 → 2.22.1-468ab35-202510010835.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,6 +13,6 @@ jobs:
|
|
|
13
13
|
with:
|
|
14
14
|
node-version: 18
|
|
15
15
|
- run: npm ci
|
|
16
|
-
- uses: JS-DevTools/npm-publish@
|
|
16
|
+
- uses: JS-DevTools/npm-publish@7f8fe47b3bea1be0c3aec2b717c5ec1f3e03410b # v4.1.1
|
|
17
17
|
with:
|
|
18
18
|
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
package/kubernetes.js
CHANGED
|
@@ -202,6 +202,13 @@ const createDeployment = async (project, options) => {
|
|
|
202
202
|
localPod.spec.containers[0].resources.limits.cpu = `${stack.cpu * 10}m`
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
206
|
+
localPod.spec.labels = {
|
|
207
|
+
...localPod.spec.labels,
|
|
208
|
+
...this._app.config.driver.options.projectLabels
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
205
212
|
const ha = await project.getSetting('ha')
|
|
206
213
|
if (ha?.replicas > 1) {
|
|
207
214
|
localDeployment.spec.replicas = ha.replicas
|
|
@@ -225,6 +232,9 @@ const createService = async (project, options) => {
|
|
|
225
232
|
throw new Error('Service type must be either NodePort or ClusterIP')
|
|
226
233
|
}
|
|
227
234
|
localService.spec.type = serviceType
|
|
235
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
236
|
+
localService.metadata.labels = this._app.config.driver.options.projectLabels
|
|
237
|
+
}
|
|
228
238
|
return localService
|
|
229
239
|
}
|
|
230
240
|
|
|
@@ -264,6 +274,10 @@ const createIngress = async (project, options) => {
|
|
|
264
274
|
localIngress.metadata.annotations[key] = mustache(localIngress.metadata.annotations[key], exposedData)
|
|
265
275
|
})
|
|
266
276
|
|
|
277
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
278
|
+
localIngress.metadata.labels = this._app.config.driver.options.projectLabels
|
|
279
|
+
}
|
|
280
|
+
|
|
267
281
|
localIngress.metadata.name = project.safeName
|
|
268
282
|
localIngress.spec.rules[0].host = url.host
|
|
269
283
|
localIngress.spec.rules[0].http.paths[0].backend.service.name = `${prefix}${project.safeName}`
|
|
@@ -312,6 +326,10 @@ const createCustomIngress = async (project, hostname, options) => {
|
|
|
312
326
|
customIngress.spec.ingressClassName = `${this._customHostname.ingressClass}`
|
|
313
327
|
}
|
|
314
328
|
|
|
329
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
330
|
+
customIngress.metadata.labels = this._app.config.driver.options.projectLabels
|
|
331
|
+
}
|
|
332
|
+
|
|
315
333
|
return customIngress
|
|
316
334
|
}
|
|
317
335
|
|
|
@@ -337,6 +355,12 @@ const createPersistentVolumeClaim = async (project, options) => {
|
|
|
337
355
|
'ff-project-id': project.id,
|
|
338
356
|
'ff-project-name': project.safeName
|
|
339
357
|
}
|
|
358
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
359
|
+
pvc.metadata.labels = {
|
|
360
|
+
...pvc.metadata.labels,
|
|
361
|
+
...this._app.config.driver.options.projectLabels
|
|
362
|
+
}
|
|
363
|
+
}
|
|
340
364
|
console.log(`PVC: ${JSON.stringify(pvc, null, 2)}`)
|
|
341
365
|
return pvc
|
|
342
366
|
}
|
|
@@ -553,6 +577,16 @@ const createMQTTTopicAgent = async (broker) => {
|
|
|
553
577
|
team: broker.Team.hashid,
|
|
554
578
|
broker: agent ? 'team-broker' : broker.hashid
|
|
555
579
|
}
|
|
580
|
+
if (this._app.config.driver.options?.projectLabels) {
|
|
581
|
+
localPod.spec.labels = {
|
|
582
|
+
...localPod.spec.labels,
|
|
583
|
+
...this._app.config.driver.options.projectLabels
|
|
584
|
+
}
|
|
585
|
+
localService.metadata.labels = {
|
|
586
|
+
...localService.metadata.labels,
|
|
587
|
+
...this._app.config.driver.options.projectLabels
|
|
588
|
+
}
|
|
589
|
+
}
|
|
556
590
|
localService.spec.selector.name = `mqtt-schema-agent-${broker.Team.hashid.toLowerCase()}-${agent ? 'team-broker' : broker.hashid.toLowerCase()}`
|
|
557
591
|
|
|
558
592
|
// TODO remove registry entry
|