-
Notifications
You must be signed in to change notification settings - Fork 15
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: Team Broker #484
Merged
Merged
feat: Team Broker #484
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
3eae59f
stash work in progress
hardillb 22f9694
stash changes
hardillb c0e4738
Getting closer
hardillb 6d2fa77
Add to default and schema
hardillb 4d104cb
Update README.md
hardillb 12a8341
Fix values vs schema
hardillb e11aa27
Update customizations-teambroker.yml
hardillb f9bf6dd
Move to 1 secret
hardillb d7cc13d
Merge branch 'emqx' of https://github.com/FlowFuse/helm into emqx
hardillb af936ea
Fix if/else/end order
hardillb 0d8c28a
Move Team Broker settings
hardillb 31889a4
Add empty line for lint
hardillb a8840c0
Update helm/flowforge/templates/emqx.yaml
hardillb 4b5733e
Update helm/flowforge/templates/emqx.yaml
hardillb 8609dc9
Add existing secret for emqx dashboard
hardillb 00582d9
Merge branch 'main' into emqx
hardillb 0b2d191
Add flag to test teamBroker UI
hardillb c453982
Merge branch 'emqx' of https://github.com/FlowFuse/helm into emqx
hardillb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,259 @@ | ||
{{- if and ( eq .Values.forge.broker.enabled true) ( eq .Values.forge.broker.teamBroker.enabled true ) -}} | ||
{{- if .Capabilities.APIVersions.Has "apps.emqx.io/v2beta1" }} | ||
apiVersion: apps.emqx.io/v2beta1 | ||
kind: EMQX | ||
metadata: | ||
name: emqx | ||
spec: | ||
image: emqx:5 | ||
imagePullPolicy: IfNotPresent | ||
config: | ||
data: | | ||
authentication = [ | ||
{ | ||
backend = http | ||
body = { | ||
clientId = "${clientid}" | ||
username = "${username}" | ||
password = "${password}" | ||
} | ||
enable = true | ||
connect_timeout = "15s" | ||
enable_pipelining = 100 | ||
headers { | ||
content-type = "application/json" | ||
} | ||
mechanism = password_based | ||
method = post | ||
pool_size = 8 | ||
request_timeout = "8s" | ||
ssl { | ||
enable = false | ||
} | ||
url = "http://forge.{{ .Release.Namespace }}/api/comms/v2/auth" | ||
} | ||
] | ||
authorization { | ||
cache { | ||
enable = true | ||
excludes = [] | ||
max_size = 32 | ||
ttl = "1m" | ||
} | ||
deny_action = ignore | ||
no_match = allow | ||
sources = [ | ||
{ | ||
enable = true | ||
enable_pipelining = 100 | ||
connect_timeout = "15s" | ||
request_timeout = "30s" | ||
pool_size = 8 | ||
body { | ||
action = "${action}" | ||
topic = "${topic}" | ||
username = "${username}" | ||
} | ||
headers { | ||
content-type = "application/json" | ||
} | ||
method = post | ||
type = http | ||
ssl { | ||
enable = false | ||
} | ||
url = "http://forge.{{ .Release.Namespace }}/api/comms/v2/acls" | ||
} | ||
] | ||
} | ||
listeners { | ||
tcp { | ||
default { | ||
bind = "0.0.0.0:1883" | ||
access_rules = [ | ||
"allow all" | ||
] | ||
enable = true | ||
enable_authn = true | ||
mountpoint = "${client_attrs.team}" | ||
max_connections = infinity | ||
acceptors = 16 | ||
proxy_protocol = false | ||
proxy_protocol_timeout = 3s | ||
tcp_options { | ||
backlog = 1024 | ||
send_timeout = 15s | ||
recbuf = 2KB | ||
sndbuf = 4KB | ||
buffer = 4KB | ||
high_watermark = 1MB | ||
nodelay = true | ||
reuseaddr = true | ||
keepalive = "none" | ||
} | ||
} | ||
} | ||
ssl { | ||
default { | ||
enable = false | ||
} | ||
} | ||
wss { | ||
default { | ||
enable = false | ||
} | ||
} | ||
ws { | ||
default { | ||
bind = "0.0.0.0:8080" | ||
access_rules = [ | ||
"allow all" | ||
] | ||
enable = true | ||
enable_authn = true | ||
mountpoint = "${client_attrs.team}" | ||
max_connections = infinity | ||
proxy_protocol = false | ||
proxy_protocol_timeout = 3s | ||
tcp_options { | ||
backlog = 1024 | ||
send_timeout = 15s | ||
recbuf = 2KB | ||
sndbuf = 4KB | ||
buffer = 4KB | ||
high_watermark = 1MB | ||
nodelay = true | ||
reuseaddr = true | ||
keepalive = "none" | ||
} | ||
websocket { | ||
mqtt_path = "/" | ||
allow_origin_absence = true | ||
check_origin_enable = false | ||
fail_if_no_subprotocol = true | ||
supported_subprotocols = "mqtt, mqtt-v3, mqtt-v3.1.1 mqtt-v5" | ||
mqtt_piggyback = multiple | ||
compress = false | ||
idle_timeout = 7200s | ||
max_frame_size = infinity | ||
proxy_address_header = "x-forwarded-for" | ||
proxy_port_header = "x-forwarded-port" | ||
} | ||
} | ||
} | ||
} | ||
api_key { | ||
bootstrap_file = "/mounted/config/api-keys" | ||
} | ||
coreTemplate: | ||
spec: | ||
{{- if .Values.forge.registrySecrets }} | ||
imagePullSecrets: | ||
{{- range .Values.forge.registrySecrets }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
env: | ||
- name: EMQX_DASHBOARD__DEFAULT_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
{{- if .Values.broker.exisitingSecret }} | ||
name: {{ .Values.broker.exisitingSecret }} | ||
{{- else }} | ||
name: emqx-config-secrets | ||
{{- end }} | ||
key: EMQX_DASHBOARD__DEFAULT_PASSWORD | ||
volumeClaimTemplates: | ||
{{- if .Values.broker.storageClassName }} | ||
storageClassName: {{ .Values.broker.storageClassName }} | ||
{{- end}} | ||
resources: | ||
requests: | ||
storage: 5Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
extraVolumes: | ||
- name: config | ||
secret: | ||
{{- if .Values.broker.exisitingSecret }} | ||
secretName: {{ .Values.broker.exisitingSecret }} | ||
{{- else }} | ||
secretName: emqx-config-secrets | ||
{{- end }} | ||
extraVolumeMounts: | ||
- name: config | ||
mountPath: /mounted/config/api-keys | ||
subPath: api-keys | ||
{{- if .Values.forge.broker.affinity }} | ||
affinity: {{ toYaml .Values.forge.broker.affinity | indent 12 }} | ||
{{- end }} | ||
{{- if .Values.forge.broker.tolerations}} | ||
tolerations: | ||
{{ toYaml .Values.forge.broker.tolerations | nindent 12 }} | ||
{{- end }} | ||
listenersServiceTemplate: | ||
spec: | ||
{{- if .Values.broker.listenersServiceTemplate }} | ||
{{ toYaml .Values.broker.listenersServiceTemplate | indent 12 }} | ||
{{ else }} | ||
type: ClusterIP | ||
{{- end }} | ||
dashboardServiceTemplate: | ||
spec: | ||
{{- if .Values.broker.dashboardServiceTemplate }} | ||
{{ toYaml .Values.broker.dashboardServiceTemplate | indent 12 }} | ||
{{ else }} | ||
type: ClusterIP | ||
{{- end }} | ||
--- | ||
{{- if not .Values.broker.exisitingSecret }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: emqx-config-secrets | ||
namespace: {{ .Release.Namespace }} | ||
type: Opaque | ||
data: | ||
EMQX_DASHBOARD__DEFAULT_PASSWORD: {{ "topSecret" | b64enc | quote }} | ||
api-keys: | | ||
{{ "flowfuse:verySecret:administrator" | b64enc | quote }} | ||
--- | ||
{{- end }} | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: flowforge-broker | ||
labels: | ||
{{- include "forge.brokerSelectorLabels" . | nindent 4 }} | ||
annotations: | ||
{{- if .Values.ingress.certManagerIssuer }} | ||
cert-manager.io/cluster-issuer: {{ $.Values.ingress.certManagerIssuer }} | ||
{{- end }} | ||
{{- if and .Values.forge.broker.enabled .Values.forge.broker.ingress (hasKey .Values.forge.broker.ingress "annotations") }} | ||
{{ toYaml .Values.forge.broker.ingress.annotations | replace "{{ instanceHost }}" "{{ include forge.brokerDomain . }}" | replace "{{ serviceName }}" "flowforge-broker" | indent 4 }} | ||
{{- end }} | ||
spec: | ||
{{- if $.Values.ingress.className }} | ||
ingressClassName: {{ $.Values.ingress.className }} | ||
{{- end }} | ||
rules: | ||
- host: {{ include "forge.brokerDomain" . }} | ||
http: | ||
paths: | ||
- pathType: Prefix | ||
path: / | ||
backend: | ||
service: | ||
name: emqx-listeners | ||
port: | ||
number: 8080 | ||
{{- if .Values.ingress.certManagerIssuer }} | ||
tls: | ||
- hosts: | ||
- {{ include "forge.brokerDomain" . }} | ||
secretName: {{ include "forge.brokerDomain" . }} | ||
{{- end }} | ||
{{- else }} | ||
{{- fail "EMQX Operator not installed" }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With Capabilities we should check if this API exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will need to add
--api-versions=apps.emqx.io/v2beta1
to the template tests