Skip to content

Commit

Permalink
feat: Allow to configure resources for each container (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardillb committed Jan 15, 2024
2 parents 2b65df9 + ad8dd5a commit 4330d52
Show file tree
Hide file tree
Showing 5 changed files with 95 additions and 0 deletions.
4 changes: 4 additions & 0 deletions helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ If using an external PostgreSQL Database you will need to create the database an
- `forge.branding` Object holding branding inserts (default not set)
- `forge.projectDeploymentTolerations` tolerations settings for Project instances. Default is `[]`.
- `forge.clusterRole.name` custom name for the ClusterRole (default `create-pod`)
- `forge.resources` allows to configure [resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the core application container
- `forge.podSecurityContext` allows to configure [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for the core application pod


note: `forge.projectSelector` and `forge.managementSelector` defaults mean that you must have at least 2 nodes in your cluster and they need to be labeled before installing.

Expand Down Expand Up @@ -76,6 +78,7 @@ To use STMP to send email
- `forge.broker.url` URL to access the broker from inside the cluster (default `mqtt://flowforge-broker.[namespace]:1883`)
- `forge.broker.public_url` URL to access the broker from outside the cluster (default `ws://mqtt.[forge.domain]`, uses `wss://` if `forge.https` is `true`)
- `forge.broker.affinity` allows to configure [affinity or anti-affinity](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) for the broker pod
- `forge.broker.resources` allows to configure [resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the broker container
- `forge.broker.podSecurityContext` allows to configure [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for the broker pod

### Telemetry
Expand Down Expand Up @@ -124,6 +127,7 @@ Enables FlowForge Telemetry
- `forge.fileStore.context.type` Choice of backends for Persistent Context `sequelize`
- `forge.fileStore.context.options` Options to pass to Persistent Context Driver (See [file-server](https://github.com/flowforge/flowforge-file-server) for details)
- `forge.fileStore.context.quota` Sets the maximum number of bytes that a project can store in Persistent Context (default `1048576`)
- `forge.fileStore.resources` allows to configure [resources](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for the file-server container
- `forge.fileStore.podSecurityContext` allows to configure [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/) for the flowforge-file pod

### Private Certificate Authority
Expand Down
3 changes: 3 additions & 0 deletions helm/flowforge/templates/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ spec:
# httpGet:
# path: /ping.html
# port: 1884
{{- if .Values.forge.broker.resources }}
resources: {{- toYaml .Values.forge.broker.resources | nindent 12 }}
{{- end }}
{{- if .Values.forge.registrySecrets }}
imagePullSecrets:
{{- range .Values.forge.registrySecrets }}
Expand Down
3 changes: 3 additions & 0 deletions helm/flowforge/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ spec:
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if .Values.forge.resources }}
resources: {{- toYaml .Values.forge.resources | nindent 12 }}
{{- end }}
{{- if .Values.forge.registrySecrets }}
imagePullSecrets:
{{- range .Values.forge.registrySecrets }}
Expand Down
3 changes: 3 additions & 0 deletions helm/flowforge/templates/file-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
{{- if .Values.forge.fileStore.resources }}
resources: {{- toYaml .Values.forge.fileStore.resources | nindent 12 }}
{{- end }}
{{- if .Values.forge.registrySecrets }}
imagePullSecrets:
{{- range .Values.forge.registrySecrets }}
Expand Down
82 changes: 82 additions & 0 deletions helm/flowforge/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,33 @@
"affinity": {
"type": "object"
},
"resources": {
"type": "object",
"properties": {
"limits": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
},
"requests": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
}
}
},
"podSecurityContext": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -319,6 +346,33 @@
"options": {
"type": "object"
},
"resources": {
"type": "object",
"properties": {
"limits": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
},
"requests": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
}
}
},
"podSecurityContext": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -434,6 +488,33 @@
}
}
},
"resources": {
"type": "object",
"properties": {
"limits": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
},
"requests": {
"type": "object",
"properties": {
"cpu": {
"type": ["number","string"]
},
"memory": {
"type": ["number","string"]
}
}
}
}
},
"podSecurityContext": {
"type": "object",
"properties": {
Expand All @@ -459,6 +540,7 @@
}
}
}

},
"required": [
"domain",
Expand Down

0 comments on commit 4330d52

Please sign in to comment.