@flowfuse/driver-kubernetes 3.1.1 → 3.1.2-2b64091-202610190954.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.
@@ -36,7 +36,7 @@ jobs:
36
36
  steps:
37
37
  - name: Generate a token
38
38
  id: generate_token
39
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
39
+ uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
40
40
  with:
41
41
  app-id: ${{ secrets.GH_BOT_APP_ID }}
42
42
  private-key: ${{ secrets.GH_BOT_APP_KEY }}
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  steps:
11
11
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
12
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
12
+ - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
13
13
  with:
14
14
  node-version: 24
15
15
  - run: npm ci
package/kubernetes.js CHANGED
@@ -219,11 +219,21 @@ const createDeployment = async (project, options) => {
219
219
  }
220
220
 
221
221
  if (stack.memory && stack.cpu) {
222
- localPod.spec.containers[0].resources.requests.memory = `${stack.memory}Mi`
223
- // increase limit to give npm more room to run in
224
- localPod.spec.containers[0].resources.limits.memory = `${parseInt(stack.memory) + 128}Mi`
225
- localPod.spec.containers[0].resources.requests.cpu = `${stack.cpu * 10}m`
226
- localPod.spec.containers[0].resources.limits.cpu = `${stack.cpu * 10}m`
222
+ if (stack.memoryRequest) {
223
+ localPod.spec.containers[0].resources.requests.memory = `${stack.memoryRequest}Mi`
224
+ localPod.spec.containers[0].resources.limits.memory = `${stack.memory}Mi`
225
+ } else {
226
+ localPod.spec.containers[0].resources.requests.memory = `${stack.memory}Mi`
227
+ // increase limit to give npm more room to run in
228
+ localPod.spec.containers[0].resources.limits.memory = `${parseInt(stack.memory) + 128}Mi`
229
+ }
230
+ if (stack.cpuRequest) {
231
+ localPod.spec.containers[0].resources.requests.cpu = `${stack.cpuRequest * 10}m`
232
+ localPod.spec.containers[0].resources.limits.cpu = `${stack.cpu * 10}m`
233
+ } else {
234
+ localPod.spec.containers[0].resources.requests.cpu = `${stack.cpu * 10}m`
235
+ localPod.spec.containers[0].resources.limits.cpu = `${stack.cpu * 10}m`
236
+ }
227
237
  }
228
238
 
229
239
  if (this._app.config.driver.options?.projectLabels) {
@@ -922,17 +932,29 @@ module.exports = {
922
932
  return {
923
933
  stack: {
924
934
  properties: {
935
+ cpuRequest: {
936
+ label: 'Minumum CPU Cores (in 1/100th units)',
937
+ validate: '^([1-9][0-9]{0,2}|1000)$',
938
+ invalidMessage: 'Invalid value - must be a number between 1 and 1000, where 100 represents 1 CPU core',
939
+ description: 'Defines the minimum CPU resources each Project should receive, in units of 1/100th of a CPU core. 100 equates to 1 CPU core. Optional, must be less than or equal to Max CPU'
940
+ },
925
941
  cpu: {
926
- label: 'CPU Cores (in 1/100th units)',
942
+ label: 'Max CPU Cores (in 1/100th units)',
927
943
  validate: '^([1-9][0-9]{0,2}|1000)$',
928
944
  invalidMessage: 'Invalid value - must be a number between 1 and 1000, where 100 represents 1 CPU core',
929
- description: 'Defines the CPU resources each Project should receive, in units of 1/100th of a CPU core. 100 equates to 1 CPU core'
945
+ description: 'Defines the maximum CPU resources each Project should receive, in units of 1/100th of a CPU core. 100 equates to 1 CPU core'
946
+ },
947
+ memoryRequest: {
948
+ label: 'Minimum Memory (MB)',
949
+ validate: '^[1-9]\\d*$',
950
+ invalidMessage: 'Invalid value - must be a number',
951
+ description: 'Lower limit on how much memory the container for each Project will be granted, recommended value 256 minimum'
930
952
  },
931
953
  memory: {
932
- label: 'Memory (MB)',
954
+ label: 'Max Memory (MB)',
933
955
  validate: '^[1-9]\\d*$',
934
956
  invalidMessage: 'Invalid value - must be a number',
935
- description: 'How much memory the container for each Project will be granted, recommended value 256'
957
+ description: 'Limit on how much memory the container for each Project will be granted, recommended value 256 minimum'
936
958
  },
937
959
  container: {
938
960
  label: 'Container Location',
@@ -1574,6 +1596,7 @@ module.exports = {
1574
1596
  getDefaultStackProperties: () => {
1575
1597
  // need to work out what the right container tag is
1576
1598
  const properties = {
1599
+ cpuRequest: 10,
1577
1600
  cpu: 10,
1578
1601
  memory: 256,
1579
1602
  container: 'flowfuse/node-red',
@@ -1643,7 +1666,7 @@ module.exports = {
1643
1666
 
1644
1667
  // Broker Agent
1645
1668
  startBrokerAgent: async (broker) => {
1646
- createMQTTTopicAgent(broker)
1669
+ await createMQTTTopicAgent(broker)
1647
1670
  },
1648
1671
  stopBrokerAgent: async (broker) => {
1649
1672
  const agent = broker.constructor.name === 'TeamBrokerAgent'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowfuse/driver-kubernetes",
3
- "version": "3.1.1",
3
+ "version": "3.1.2-2b64091-202610190954.0",
4
4
  "description": "Kubernetes driver for FlowFuse",
5
5
  "main": "kubernetes.js",
6
6
  "scripts": {