@flowfuse/driver-kubernetes 2.22.1 → 2.22.2-ad004bd-202510200727.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.
- package/.github/workflows/release-publish.yml +1 -1
- package/README.md +5 -0
- package/kubernetes.js +20 -2
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ jobs:
|
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
11
|
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
12
|
-
- uses: actions/setup-node@
|
|
12
|
+
- uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
|
13
13
|
with:
|
|
14
14
|
node-version: 18
|
|
15
15
|
- run: npm ci
|
package/README.md
CHANGED
|
@@ -44,6 +44,10 @@ driver:
|
|
|
44
44
|
- `projectSelector` a list of labels that should be used to select which nodes Project Pods
|
|
45
45
|
should run on
|
|
46
46
|
- `projectLabels` a list of custom labels that should be applied to all resources created for Projects (Pods, Services, Ingresses, PVCs)
|
|
47
|
+
- `projectProbes` optional configuration for liveness, readiness and startup probes for project containers
|
|
48
|
+
- `projectProbes.livenessProbe` custom liveness probe configuration (default not set)
|
|
49
|
+
- `projectProbes.readinessProbe` custom readiness probe configuration (default not set)
|
|
50
|
+
- `projectProbes.startupProbe` custom startup probe configuration (default not set)
|
|
47
51
|
- `cloudProvider` normally not set, but can be `aws` This triggers the adding of
|
|
48
52
|
AWS EKS specific annotation for ALB Ingress. or `openshift` to allow running on OpenShift (Enterprise license only)
|
|
49
53
|
- `privateCA` name of ConfigMap holding PEM CA Cert Bundle (file name `certs.pem`) Optional
|
|
@@ -61,6 +65,7 @@ AWS EKS specific annotation for ALB Ingress. or `openshift` to allow running on
|
|
|
61
65
|
- `storage.storageClassEFSTag` Used instead of `storage.storageClass` when needing to shard across multiple EFS file systems (default not set)
|
|
62
66
|
- `storage.size` Size of the volume to request (default not set)
|
|
63
67
|
- `podSecurityContext` Settings linked to the [security context of the pod](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
|
|
68
|
+
- `containerSecurityContext` Settings linked to the [security context of the container](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
|
|
64
69
|
- `service.type` Type of service to create for the editor (allowed `ClusterIP` or `NodePort`, default `ClusterIP`)
|
|
65
70
|
|
|
66
71
|
Expects to pick up K8s credentials from the environment
|
package/kubernetes.js
CHANGED
|
@@ -194,6 +194,14 @@ const createDeployment = async (project, options) => {
|
|
|
194
194
|
this._app.log.info('[k8s] OpenShift, removing PodSecurityContext')
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
if (this._app.config.driver.options?.containerSecurityContext) {
|
|
198
|
+
localPod.spec.containers[0].securityContext = this._app.config.driver.options.containerSecurityContext
|
|
199
|
+
this._app.log.info(`[k8s] Using custom ContainerSecurityContext ${JSON.stringify(this._app.config.driver.options.containerSecurityContext)}`)
|
|
200
|
+
} else if (this._app.license.active() && this._cloudProvider === 'openshift') {
|
|
201
|
+
localPod.spec.containers[0].securityContext = {}
|
|
202
|
+
this._app.log.info('[k8s] OpenShift, removing ContainerSecurityContext')
|
|
203
|
+
}
|
|
204
|
+
|
|
197
205
|
if (stack.memory && stack.cpu) {
|
|
198
206
|
localPod.spec.containers[0].resources.requests.memory = `${stack.memory}Mi`
|
|
199
207
|
// increase limit to give npm more room to run in
|
|
@@ -213,6 +221,16 @@ const createDeployment = async (project, options) => {
|
|
|
213
221
|
}
|
|
214
222
|
}
|
|
215
223
|
|
|
224
|
+
if (this._app.config.driver.options?.projectProbes?.livenessProbe) {
|
|
225
|
+
localPod.spec.containers[0].livenessProbe = this._app.config.driver.options.projectProbes.livenessProbe
|
|
226
|
+
}
|
|
227
|
+
if (this._app.config.driver.options?.projectProbes?.readinessProbe) {
|
|
228
|
+
localPod.spec.containers[0].readinessProbe = this._app.config.driver.options.projectProbes.readinessProbe
|
|
229
|
+
}
|
|
230
|
+
if (this._app.config.driver.options?.projectProbes?.startupProbe) {
|
|
231
|
+
localPod.spec.containers[0].startupProbe = this._app.config.driver.options.projectProbes.startupProbe
|
|
232
|
+
}
|
|
233
|
+
|
|
216
234
|
const ha = await project.getSetting('ha')
|
|
217
235
|
if (ha?.replicas > 1) {
|
|
218
236
|
localDeployment.spec.replicas = ha.replicas
|
|
@@ -777,8 +795,8 @@ module.exports = {
|
|
|
777
795
|
},
|
|
778
796
|
container: {
|
|
779
797
|
label: 'Container Location',
|
|
780
|
-
// taken from https://stackoverflow.com/a/
|
|
781
|
-
validate: '^(([a-
|
|
798
|
+
// taken from https://stackoverflow.com/a/74073589
|
|
799
|
+
validate: '^((?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])(?:(?:\\.(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]))+)?(?::[0-9]+)?/)?[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?(?:(?:/[a-z0-9]+(?:(?:(?:[._]|__|[-]*)[a-z0-9]+)+)?)+)?)(?::([\\w][\\w.-]{0,127}))?(?:@([A-Za-z][A-Za-z0-9]*(?:[-_+.][A-Za-z][A-Za-z0-9]*)*[:][[:xdigit:]]{32,}))?$',
|
|
782
800
|
invalidMessage: 'Invalid value - must be a Docker image',
|
|
783
801
|
description: 'Container image location, can include a tag'
|
|
784
802
|
}
|