Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Helm chart v2 #279

Merged
merged 53 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
3624f9d
Initial pipeline version with configs
ppawlowski Nov 17, 2023
4c71ac3
Rename pipeline
ppawlowski Nov 17, 2023
768c8eb
Fix config path
ppawlowski Nov 17, 2023
b93cd52
Update ct config
ppawlowski Nov 17, 2023
c089619
Use multiple chart values
ppawlowski Nov 17, 2023
e07ff89
Update chart info file
ppawlowski Nov 17, 2023
6f6f4fb
Add bitnami repo
ppawlowski Nov 17, 2023
1139055
Fix new-line-at-end-of-file in default values file
ppawlowski Nov 17, 2023
871044b
Remove values from lint step
ppawlowski Nov 17, 2023
088f42f
Fix path to ci value file
ppawlowski Nov 17, 2023
60b8d6c
Do not fail fast on parallel runs
ppawlowski Nov 17, 2023
c03fbc2
Label nodes
ppawlowski Nov 20, 2023
7bd83ef
Add default domain value
ppawlowski Nov 20, 2023
aa294e3
Remove postgresql storageclass default values
ppawlowski Nov 20, 2023
d9ee223
Upgrade pgpassword secret reference in job
ppawlowski Nov 20, 2023
51df345
Debug ct install
ppawlowski Nov 20, 2023
0591985
Rearrange multiple values file
ppawlowski Nov 20, 2023
e65eaec
Update postgresql values to match new version
ppawlowski Nov 20, 2023
d5a7b57
Update pipeline to new values files approach
ppawlowski Nov 20, 2023
88decf9
Remove matrix strategy
ppawlowski Nov 20, 2023
0c3a3d3
Add chart validation against kubeapi
ppawlowski Nov 20, 2023
1750a77
Bump postgresql chart version to `11.9.13`
ppawlowski Nov 21, 2023
70e57a4
Merge branch 'main' into feat-postgres-chart-update
ppawlowski Dec 11, 2023
69501e1
Update values.yaml
ppawlowski Dec 11, 2023
7d931f7
Merge branch 'main' of github.com:flowforge/helm into feat-linter
ppawlowski Dec 20, 2023
9a3f5e2
Update branch and path restrictions in helm-chart.yml
ppawlowski Dec 20, 2023
f5dce35
Merge pull request #229 from FlowFuse/feat-postgres-chart-update
hardillb Dec 20, 2023
c1e850f
Merge pull request #221 from FlowFuse/feat-linter
hardillb Dec 20, 2023
7602b20
Add chart scanning to helm workflow
ppawlowski Dec 20, 2023
d3170da
Add kube-score scan to workflow
ppawlowski Dec 20, 2023
b0e2674
Update kube-score installation action
ppawlowski Dec 20, 2023
da875c5
Debug kube-score
ppawlowski Dec 20, 2023
bf056d1
Disable kube-score temporarily due to an issue with serif output
ppawlowski Dec 20, 2023
ed55592
Disable kube-score temporarily due to an issue with serif output
ppawlowski Dec 21, 2023
377a76a
Merge branch 'v2' of github.com:flowforge/helm into feat-misconfig-scan
ppawlowski Dec 21, 2023
63ee657
Merge pull request #248 from FlowFuse/feat-misconfig-scan
hardillb Dec 21, 2023
5edd1c3
Add possibility to configure securityContext for forge and broker pods
ppawlowski Jan 11, 2024
00f46d8
Add default podSecurityContext values
ppawlowski Jan 11, 2024
beaca82
Merge branch 'main' of github.com:flowforge/helm into feat-podsecurit…
ppawlowski Jan 11, 2024
6791985
Merge branch 'main' of github.com:flowforge/helm into v2
ppawlowski Jan 12, 2024
cbabaef
Merge branch 'v2' of github.com:flowforge/helm into feat-podsecurityc…
ppawlowski Jan 12, 2024
7de1742
Add podSecurityContext for flowforge-file pod
ppawlowski Jan 12, 2024
678d4d4
Remove seccompProfile from forge values
ppawlowski Jan 12, 2024
f904233
Allow to configure resources for each container
ppawlowski Jan 12, 2024
b6dbf87
feat: Add possibility to configure `securityContext` for each pod (#275)
hardillb Jan 12, 2024
5ab6fa3
Merge branch 'v2' into feat-resources-limits
ppawlowski Jan 12, 2024
ad8dd5a
Fix missing brackets
ppawlowski Jan 15, 2024
2b65df9
Merge branch 'main' of github.com:flowforge/helm into v2
ppawlowski Jan 15, 2024
4330d52
feat: Allow to configure resources for each container (#278)
hardillb Jan 15, 2024
015503b
Remove domain value from helm chart default values
ppawlowski Jan 17, 2024
802f942
Set forge.domain value on chart validation
ppawlowski Jan 17, 2024
30500bc
Set forge.domain value on chart templating for checkov
ppawlowski Jan 17, 2024
d1dd9b7
Remove reference to `v2` branch in hel chart validation workflow
ppawlowski Jan 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/configs/chart-testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
charts:
- ./helm/flowforge
validate-maintainers: false
141 changes: 141 additions & 0 deletions .github/workflows/helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
name: Helm chart validation
on:
push:
branches:
- main
- v2
paths:
- 'helm/*'
- '.github/workflows/helm-chart.yml'
pull_request:
branches:
- main
- v2
paths:
- 'helm/*'
- '.github/workflows/helm-chart.yml'

jobs:
lint:
name: Lint and install chart
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3.5
with:
version: v3.13.2

- name: Install Python
uses: actions/setup-python@v4.7.1
with:
python-version: 3.9

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.6.1

- name: Add bitami repo
run: helm repo add bitnami https://charts.bitnami.com/bitnami

- name: Lint helm chart
run: |
ct lint --config ./.github/configs/chart-testing.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.8.0

- name: Label cluster nodes
run: |
for node in $(kubectl get nodes -o name); do
kubectl label --overwrite $node "role=management"
done

- name: Run chart-testing (install)
run: ct install --config ./.github/configs/chart-testing.yaml

validate:
name: Validate chart against kubernetes API
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3.5
with:
version: v3.13.2

- name: Create kind cluster
uses: helm/kind-action@v1.8.0

- name: Validate chart
run: |
helm template flowforge ./helm/flowforge | kubectl apply --validate=true -f -

scan:
name: Scan chart
runs-on: ubuntu-latest
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
tool:
- checkov
# temporary disabled due to https://github.com/zegl/kube-score/issues/559
# - kube-score

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3.5
with:
version: v3.13.2

- name: Template chart
run: |
helm template flowforge ./helm/flowforge > ${{ github.workspace }}/templated_chart.yaml

- name: Scan chart with checkov
if: matrix.tool == 'checkov'
uses: bridgecrewio/checkov-action@v12
with:
directory: ${{ github.workspace }}
file: templated_chart.yaml
framework: kubernetes
output_format: cli,sarif
output_file_path: console,results.sarif
soft_fail: true

- name: Install kube-score
# temporary disabled due to https://github.com/zegl/kube-score/issues/559
if: false
uses: yokawasa/action-setup-kube-tools@v0.9.3
with:
setup-tools: "kube-score"
kube-score: '1.17.0'

- name: Scan chart with kube-score
# temporary disabled due to https://github.com/zegl/kube-score/issues/559
if: false
continue-on-error: true
run:
kube-score score ${{ github.workspace }}/templated_chart.yaml --output-format sarif > results.sarif

- name: "Upload SARIF file"
if: success() || failure()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: results.sarif
6 changes: 3 additions & 3 deletions helm/flowforge/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 10.14.0
digest: sha256:6d76d2bf60161ead8a4802b56a209720105e5007719aaf2679a59cf067538bbd
generated: "2021-12-29T20:24:10.223567318Z"
version: 11.9.13
digest: sha256:ea11617d363e174146b33ceafb5e2072d36731c2446178a91e5e6f705d0db067
generated: "2023-11-15T14:44:27.496269+01:00"
2 changes: 1 addition & 1 deletion helm/flowforge/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ keywords:
- node-red
dependencies:
- name: postgresql
version: 10.14.0
version: 11.9.13
repository: https://charts.bitnami.com/bitnami
condition: forge.localPostgresql
maintainers:
Expand Down
7 changes: 7 additions & 0 deletions helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +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 @@ -75,6 +78,8 @@ 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 @@ -122,6 +127,8 @@ 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
Binary file removed helm/flowforge/charts/postgresql-10.14.0.tgz
Binary file not shown.
Binary file added helm/flowforge/charts/postgresql-11.9.13.tgz
Binary file not shown.
75 changes: 75 additions & 0 deletions helm/flowforge/ci/ci-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
forge:
dbUsername: forge
dbPassword: Zai1Wied
dbName: flowforge
localPostgresql: true
https: true
projectNamespace: flowforge
projectSelector:
role: projects
projectDeploymentTolerations: []
# - key: purpose
# operator: Equal
# value: flowforge-projects
# effect: NoSchedule
managementSelector:
beta.kubernetes.io/os: linux
telemetry:
enabled: true
backend:
prometheus:
enabled: true
broker:
enabled: false
fileStore:
enabled: false
type: localfs
quota: 104857600
options:
root: var/root
context:
type: sequelize
quota: 1048576
options:
type: postgres
host: flowforge-postgresql
username: forge
password: Zai1Wied
database: ff-context
support:
enabled: false

rate_limits:
enabled: false
global: true
max: 1000
timeWindow: 60000

domain: "flowfuse-ci.com"
entryPoint: "lint"
environment: {}
image: ""
registry: ""

contentSecurityPolicy:
enabled: false
reportOnly: false

postgresql:
auth:
postgresPassword: Moomiet0
username: forge
password: Zai1Wied
database: flowforge
global:
storageClass: standard

ingress:
annotations: {}
className: ""

editors:
serviceAccount:
create: true
annotations: {}
name: editors
Empty file.
7 changes: 4 additions & 3 deletions helm/flowforge/templates/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ spec:
app: flowforge-broker
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
{{- toYaml .Values.forge.broker.podSecurityContext | nindent 8 }}
containers:
- name: broker
image: iegomez/mosquitto-go-auth
Expand All @@ -88,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
7 changes: 4 additions & 3 deletions helm/flowforge/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ spec:
spec:
serviceAccountName: flowforge
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
{{- toYaml .Values.forge.podSecurityContext | nindent 8 }}
containers:
- name: forge
{{- if .Values.forge.image }}
Expand Down Expand Up @@ -77,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
7 changes: 4 additions & 3 deletions helm/flowforge/templates/file-storage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ spec:
app: flowforge-file
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
{{- toYaml .Values.forge.fileStore.podSecurityContext | nindent 8 }}
containers:
- name: file-storage
image: {{ .Values.forge.registry }}{{- if .Values.forge.registry -}}/{{- end -}}flowforge/file-server:{{ .Chart.AppVersion }}
Expand All @@ -83,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
2 changes: 1 addition & 1 deletion helm/flowforge/templates/job-upgrade-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spec:
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-postgresql
key: postgresql-postgres-password
key: postgres-password
volumeMounts:
- name: upgrade-script
mountPath: /usr/local
Expand Down
Loading
Loading