-
Notifications
You must be signed in to change notification settings - Fork 6
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
Working minimal authn/authz configuration for blueapi #284
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -50,6 +50,16 @@ app.kubernetes.io/name: {{ include "blueapi.name" . }} | |||||||||||||||||||||||||||||||||||
app.kubernetes.io/instance: {{ .Release.Name }} | ||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
{{/* | ||||||||||||||||||||||||||||||||||||
Metadata labels | ||||||||||||||||||||||||||||||||||||
*/}} | ||||||||||||||||||||||||||||||||||||
{{- define "blueapi.metadataLabels" -}} | ||||||||||||||||||||||||||||||||||||
{{ include "blueapi.selectorLabels" . }} | ||||||||||||||||||||||||||||||||||||
{{- range $key, $value := .Values.extraLabels }} | ||||||||||||||||||||||||||||||||||||
{{- $key }}: {{ $value | quote }} # N.B. ensures your labels are correctly String->String | ||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||
{{- end }} | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
Comment on lines
+53
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||
{{/* | ||||||||||||||||||||||||||||||||||||
Create the name of the service account to use | ||||||||||||||||||||||||||||||||||||
*/}} | ||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,3 @@ metadata: | |
data: | ||
config.yaml: |- | ||
{{- toYaml .Values.worker | nindent 4 }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ spec: | |
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
{{- include "blueapi.selectorLabels" . | nindent 8 }} | ||
{{- include "blueapi.metadataLabels" . | nindent 8 }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. {{- include "blueapi.selectorLabels" . | nindent 8 }} I think it'd make more sense to present the extraLabels alongside the selectorLabels, rather than folding both into a single function: there are selectorLabels which are used by this release to map between resources and extraLabels, which have some meaning in a wider context. |
||
spec: | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
|
@@ -35,6 +35,9 @@ spec: | |
- secret: | ||
name: {{ . }} | ||
{{- end }} | ||
{{- with .Values.extraVolumes -}} | ||
{{ toYaml . | nindent 6 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
|
@@ -56,6 +59,9 @@ spec: | |
- "/config/secret.yaml" | ||
{{- end }} | ||
- "serve" | ||
{{- with .Values.extraContainers }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
|
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -75,13 +75,41 @@ worker: | |||||||||
env: | ||||||||||
sources: | ||||||||||
- kind: deviceFunctions | ||||||||||
module: blueapi.startup.example | ||||||||||
module: blueapi.startup.example_devices | ||||||||||
- kind: planFunctions | ||||||||||
module: blueapi.startup.example_plans | ||||||||||
- kind: planFunctions | ||||||||||
module: blueapi.plans | ||||||||||
stomp: | ||||||||||
auth: | ||||||||||
username: guest | ||||||||||
passcode: guest | ||||||||||
host: rabbitmq | ||||||||||
username: foo | ||||||||||
passcode: bar | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm going to make a ticket for describing how to make SealedSecret for BlueAPI and RabbitMQ shared information, I think for this default/example config, we can keep guest/guest and add to the readme for deploying that these values will need to be overwritten if rabbitmq.enabled and not exposed on localhost
Comment on lines
+85
to
+86
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
host: localhost | ||||||||||
port: 61613 | ||||||||||
# Config for the worker goes here, will be mounted into a config file | ||||||||||
|
||||||||||
extraLabels: {} | ||||||||||
extraVolumes: {} | ||||||||||
extraContainers: {} | ||||||||||
|
||||||||||
rabbitmq: | ||||||||||
persistence: | ||||||||||
enabled: true # TODO: Best approach for storage | ||||||||||
auth: | ||||||||||
username: foo | ||||||||||
password: bar | ||||||||||
Comment on lines
+99
to
+100
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
extraPlugins: rabbitmq_stomp | ||||||||||
rbac: | ||||||||||
create: false | ||||||||||
serviceAccount: | ||||||||||
name: default-full-access-mounted # TODO: use only required permissions | ||||||||||
create: false | ||||||||||
extraContainerPorts: | ||||||||||
- name: stomp | ||||||||||
containerPort: 61613 | ||||||||||
service: | ||||||||||
extraPorts: | ||||||||||
- name: stomp | ||||||||||
port: 61613 | ||||||||||
targetPort: stomp | ||||||||||
nodePort: null |
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.
If we add this to the conditions, we can also add
rabbitmq:
enabled: false
to our values.yaml to disable rabbitmq (once we have BlueAPI not requiring a message bus)