-
Notifications
You must be signed in to change notification settings - Fork 16.8k
use default k8s cluster plugin from rabbitmq #4591
Conversation
/assign @tompizmor same than before but with a matching email |
pullPolicy: IfNotPresent | ||
|
||
## set to true if you would like to see extra information on logs | ||
## it turns BASH and NAMI debuggin in minideb |
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.
typo: debuggin
-> debugging
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.
thanks, will fix
stable/rabbitmq/values.yaml
Outdated
tag: 3.7.4-r1 | ||
|
||
## set to true if you would like to see extra information on logs | ||
## it turns BASH and NAMI debuggin in minideb |
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.
same typo
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.
ta!
stable/rabbitmq/values.yaml
Outdated
cpu: 100m | ||
resources: {} | ||
|
||
## Replica count, set to 3 to provide a default available cluster |
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.
Comment and below value mismatch
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.
oops, copy paste :)
[rabbitmq_management,rabbitmq_peer_discovery_k8s]. | ||
|
||
rabbitmq.conf: | | ||
## Clustering |
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.
I think this configuration should come from the values.yaml.
Example: https://github.com/kubernetes/charts/blob/master/stable/mariadb/templates/configmap.yaml
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.
ok, I have moved the main body of both config files, but left the user and password configuration as that is configure via other variables. you cant reference other variables via values.yaml
- path: {{ default "/" .path }} | ||
backend: | ||
serviceName: {{ template "rabbitmq.fullname" . }} | ||
servicePort: {{ default "15672" .Values.rabbitmq.managerPort }} |
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.
Use "default" in the template is not recommended. We should rely on the default value set in the values.yaml file
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.
good to know , thanks
- secretName: {{ .Values.ingress.tlsSecret }} | ||
{{- end }} | ||
{{- end }} | ||
--- |
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.
I would say you don't need this dashes. I have seen it in some other charts but they were creating several ingress resources. For example https://github.com/kubernetes/charts/blob/master/stable/wordpress/templates/ingress.yaml
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.
ok removed
{{- if .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- range .Values.image.pullSecrets }} | ||
- name: {{.}} |
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.
{{.}}
-> {{ . }}
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.
ok
A lot of this looks like the beginning of merging this into the |
@coreypobrien I am not sure why rabbitmq-ha was created to start with, seems like it should have been itself a PR to this chart. My prefer option would be to merge this PR once the comments are addressed and see how we want to proceed. |
@@ -0,0 +1,14 @@ | |||
apiVersion: v1 |
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.
you are missing labels in this file:
labels:
app: {{ template "rabbitmq.name" . }}
chart: {{ template "rabbitmq.chart". }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
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.
I noticed that PVC has this also missing so I fixed both
metadata: | ||
name: "{{ template "rabbitmq.fullname" . }}" | ||
labels: | ||
app: {{ template "rabbitmq.fullname" . }} |
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.
As stated in the best-practices the app labels should use the {{ template "rabbitmq.name" . }}
and not {{ template "rabbitmq.fullname" . }}
This change in the labels applies to all files
name: "{{ template "rabbitmq.fullname" . }}" | ||
labels: | ||
app: {{ template "rabbitmq.fullname" . }} | ||
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
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.
instead of using "{{ .Chart.Name }}-{{ .Chart.Version }}"
you should create the following template and use it here:
chart: {{ template "rabbitmq.chart" . }}
Template:
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "rabbitmq.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
This change in the labels applies to all files
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.
mmm,seems over kill - is there a guideline about when to do this?
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.
done
- name: epmd | ||
containerPort: 4369 | ||
- name: amqp | ||
containerPort: {{ default "5672" .Values.rabbitmq.nodePort }} |
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.
there are several default
values in this file. can you remove all of them?
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.
done
stable/rabbitmq/templates/svc.yaml
Outdated
@@ -14,13 +14,13 @@ spec: | |||
port: 4369 | |||
targetPort: epmd | |||
- name: amqp | |||
port: {{ default "5672" .Values.rabbitmqNodePort }} | |||
port: {{ default "5672" .Values.rabbitmq.nodePort }} |
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.
more defaults
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.
in my defence, they were there before :) - changed
image: | ||
registry: docker.io | ||
repository: bitnami/rabbitmq | ||
tag: 3.7.4-r1 |
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.
can you update this tag to 3.7.4
? The tag already 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.
ok, I didnt know if that was the case. will do.
/ok-to-test |
/lgtm |
… when starting the pod
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: tompizmor, vtuson The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Why is this madness being merged into |
Seems that new |
* use default k8s cluster plugin from rabbitmq * changes to reflect pr review comments * remove trailing spaces * futher changes from PR review * doing sed in the copy as it fails in gce due to filesystem permisions when starting the pod
@vtuson @tompizmor for future reference, this should have been a major version bump. |
@@ -0,0 +1,150 @@ | |||
apiVersion: apps/v1 |
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.
Works only with Kubernetes 1.9+, before this was a beta API 😭
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.
see #4908
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.
#4909 should fix it
* use default k8s cluster plugin from rabbitmq * changes to reflect pr review comments * remove trailing spaces * futher changes from PR review * doing sed in the copy as it fails in gce due to filesystem permisions when starting the pod
* use default k8s cluster plugin from rabbitmq * changes to reflect pr review comments * remove trailing spaces * futher changes from PR review * doing sed in the copy as it fails in gce due to filesystem permisions when starting the pod Signed-off-by: voron <[email protected]>
* use default k8s cluster plugin from rabbitmq * changes to reflect pr review comments * remove trailing spaces * futher changes from PR review * doing sed in the copy as it fails in gce due to filesystem permisions when starting the pod
What this PR does / why we need it:
This PR modifies the existing chart to be able to be horizontally scaled by adding additional replicas of rabbitmq. It uses the default http://www.rabbitmq.com/cluster-formation.html#peer-discovery-k8s which is prepackage in 3.7+ versions of rabbitmq.
In order to achieve this I have moved from a deployment to a statefulselt for a stable network configuration.
This PR also provides rbac Service account, role and role-binding since the rabbitmq plugin configures the cluster by monitoring endpoint on a given service.
Additionally this PR provides an ingress resource (optional) for the management interface of rabbitmq.
I have also provided an additional values yaml file for high availability configuration.
This PR adds additional configurability for the chart, including the option of using a private registry, control over probe settings and a few other things.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #It is an improvement pr - addresses some of the concern in this issue #3075
Special notes for your reviewer:
@tompizmor @sameersbn @prydonius followed the discuss approach to provide both default setup and also production set up.