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

FlowForge helm: 1. Editors: service account. 2. Broker: propagate ingress. 3. README #148

Merged
merged 8 commits into from
Jul 31, 2023
18 changes: 18 additions & 0 deletions helm/flowforge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ If using an external PostgreSQL Database you will need to create the database an
- `forge.localPostrgresql` Deploy a PostgreSQL v14 Database into Kubernetes cluster (default `true`)
- `forge.postgres.host` the hostname of an external PostgreSQL database (default not set)
- `forge.postgres.port` the port of an external PostgreSQL database (default `5432`)
- `forge.postgres.ssl` sets the connection to the database to use SSL/TLS (default `false`)
- `forge.cloudProvider` currently only accepts `aws` but will include more as needed (default not set)
- `forge.projectSelector` a collection of labels and values to filter nodes that Project Pods will run on (default `role: projects`)
- `forge.managementSelector` a collection of labels and values to filter nodes the Forge App will run on (default `role: management`)
Expand Down Expand Up @@ -121,3 +122,20 @@ Enables FlowForge Telemetry
### Ingress
- `ingress.annotations` ingress annotations (default is `{}`). This value is also applied to Editor instances created by FlowForge.
- `ingress.className` ingress class name (default is `"""`). This value is also applied to Editor instances created by FlowForge.

### Editors IAM
Provision default service account for Editors if `editors.serviceAccount.create` is `true`.

- `editors.serviceAccount.create` flag, indicates whether default Editors service account is going to be provisioned.
- `editors.serviceAccount.annotations` k8s service account annotations.
- `editors.serviceAccount.name` name of the service account for Editors.

Example for <i>AWS</i>:
```yaml
editors:
serviceAccount:
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::${ACCOUNT_ID}:role/${ROLE_NAME}
create: true
name: editors
```
6 changes: 6 additions & 0 deletions helm/flowforge/templates/broker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ metadata:
labels:
app: flowforge-broker
annotations:
{{- if .Values.ingress.annotations }}
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- end }}
spec:
{{- if $.Values.ingress.className }}
ingressClassName: {{ $.Values.ingress.className }}
{{- end }}
rules:
- host: mqtt.{{ .Values.forge.domain }}
http:
Expand Down
3 changes: 3 additions & 0 deletions helm/flowforge/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ data:
user: {{ .Values.forge.dbUsername }}
password: {{ .Values.forge.dbPassword }}
db: {{ .Values.forge.dbName }}
{{- if and (hasKey .Values.forge "postgres") (hasKey .Values.forge.postgres "ssl") }}
ssl: {{ .Values.forge.postgres.ssl }}
{{- end }}
driver:
type: kubernetes
options:
Expand Down
4 changes: 4 additions & 0 deletions helm/flowforge/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spec:
- name: INGRESS_CLASS_NAME
value: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.editors.serviceAccount }}
- name: EDITOR_SERVICE_ACCOUNT
value: {{ .Values.editors.serviceAccount.name }}
{{- end }}
{{- if .Values.forge.projectDeploymentTolerations }}
- name: DEPLOYMENT_TOLERATIONS
value: {{ .Values.forge.projectDeploymentTolerations | toJson | quote }}
Expand Down
20 changes: 18 additions & 2 deletions helm/flowforge/templates/service-account.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,27 @@ metadata:
eks.amazonaws.com/sts-regional-endpoints: "true"
{{- end }}
{{- end }}


{{- if .Values.editors.serviceAccount.create }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.editors.serviceAccount.name }}
namespace: {{ .Values.forge.projectNamespace }}
{{- with .Values.editors.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: create-pod
name: {{ .Release.Name }}-create-pod
rules:
- apiGroups: [""]
resources: ["pods", "pods/log", "pods/exec", "pods/status"]
Expand Down Expand Up @@ -45,5 +61,5 @@ subjects:
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: create-pod
name: {{ .Release.Name }}-create-pod
apiGroup: rbac.authorization.k8s.io
48 changes: 48 additions & 0 deletions helm/flowforge/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
},
"port": {
"type": "integer"
},
"ssl": {
"type": "boolean"
}
},
"required": [
Expand All @@ -113,6 +116,28 @@
"projectSelector": {
"type": "object"
},
"projectDeploymentTolerations": {
"type": "array",
"items": {
"type": "object",
"properties": {
"effect": {
"type": "string"
},
"key": {
"type": "string"
},
"operator": {
"type": "string"
},
"value": {
"type": "string"
}
},
"required": ["effect", "key", "operator", "value"]
},
"default": []
},
"managementSelector": {
"type": "object"
},
Expand Down Expand Up @@ -306,6 +331,29 @@
"type": "string"
}
}
},
"editors": {
"type": "object",
"properties": {
"serviceAccount": {
"type": "object",
"properties": {
"annotations": {
"type": "object",
"minProperties": 0
},
"create": {
"type": "boolean"
},
"name": {
"type": "string",
"description": "Name of service account (scope of uniqueness is a 'Projects' namespace)"
}
},
"required": ["annotations", "name"]
}
},
"required": ["serviceAccount"]
}
},
"required": [
Expand Down
25 changes: 19 additions & 6 deletions helm/flowforge/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ forge:
projectNamespace: flowforge
projectSelector:
role: projects

projectDeploymentTolerations: []
# - key: purpose
# operator: Equal
# value: flowforge-projects
# effect: NoSchedule
# - key: purpose
# operator: Equal
# value: flowforge-projects
# effect: NoSchedule
managementSelector:
role: management
telemetry:
Expand All @@ -32,17 +31,31 @@ forge:
type: postgres
host: flowforge-postgresql
username: forge
password: Zai1Wied
password: ""
hardillb marked this conversation as resolved.
Show resolved Hide resolved
database: ff-context
support:
enabled: false

domain: ""
entryPoint: ""
environment: {}
image: ""
registry: ""

postgresql:
postgresqlPostgresPassword: Moomiet0
postgresqlUsername: forge
postgresqlPassword: Zai1Wied
postgresqlDatabase: flowforge
global:
storageClass: default

ingress:
annotations: {}
className: ""

editors:
serviceAccount:
create: true
annotations: {}
name: editors