Skip to content

Commit

Permalink
Allow to configure resources for each container
Browse files Browse the repository at this point in the history
  • Loading branch information
ppawlowski committed Jan 12, 2024
1 parent 6791985 commit f904233
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 0 deletions.
3 changes: 3 additions & 0 deletions helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ 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

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 @@ -75,6 +76,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

### Telemetry

Expand Down Expand Up @@ -122,6 +124,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

### 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 @@ -88,6 +88,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 @@ -77,6 +77,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 @@ -83,6 +83,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 @@ -218,6 +218,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"]
}
}
}
}
}
},
"required": [
Expand Down Expand Up @@ -293,6 +320,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"]
}
}
}
}
}
},
"required": [
Expand Down Expand Up @@ -383,7 +437,35 @@
"description": "Name of cluster role"
}
}
},
"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"]
}
}
}
}
}

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

0 comments on commit f904233

Please sign in to comment.