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
Helm Chart: Add support for only one replica #18577
base: master
Are you sure you want to change the base?
Conversation
using ``replicas: 1`` used to render something like this: ``` "/usr/bin/docker-entrypoint.sh minio server http://release-name-minio-{0...0}.release-name-minio-svc.platform-datawarehouse-develop.svc.cluster.local/export -S /etc/minio/certs/ --address :9000 --console-address :9001" ``` Where ``{0...0}`` is not supported by the minio server. Now extended with the if statement it will render out the following: ``` "/usr/bin/docker-entrypoint.sh minio server http://release-name-minio-0.release-name-minio-svc.platform-datawarehouse-develop.svc.cluster.local/export -S /etc/minio/certs/ --address :9000 --console-address :9001" ```
@@ -100,7 +100,7 @@ spec: | |||
command: [ | |||
"/bin/sh", | |||
"-ce", | |||
"/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{ else }}{{ $bucketRoot }}{{end }}{{- end }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}" | |||
"/usr/bin/docker-entrypoint.sh minio server {{- range $i := until $poolCount }}{{ $factor := mul $i $nodeCount }}{{ $endIndex := add $factor $nodeCount }}{{ $beginIndex := mul $i $nodeCount }} {{ $scheme }}://{{ template `minio.fullname` $ }}-{{ if lt ($beginIndex) (sub $endIndex 1) }}{{ `{` }}{{ $beginIndex }}...{{ sub $endIndex 1 }}{{ `}`}}{{ else }}{{ $beginIndex }}{{ end }}.{{ template `minio.fullname` $ }}-svc.{{ $.Release.Namespace }}.svc.{{ $.Values.clusterDomain }}{{if (gt $drivesPerNode 1)}}{{ $bucketRoot }}-{{ `{` }}0...{{ sub $drivesPerNode 1 }}{{ `}` }}{{ else }}{{ $bucketRoot }}{{end }}{{- end }} -S {{ .Values.certsPath }} --address :{{ .Values.minioAPIPort }} --console-address :{{ .Values.minioConsolePort }} {{- template `minio.extraArgs` . }}" |
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.
For single replica it must be just single disk local so there is no reason to provide headless 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.
What is a headless name 🙈. I Am not following sorry.
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.
where you are specifying minio server https://hostname/local/disk
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.
Is that a problem I introduced? Or something unrelated you want me to fix? Does providing the headless name break something? It has been over 2 months so I have to look closely at this mess of a one liner again but at first glance it seems to me like it would require the line to grow even longer. Adding another condition in front of {{ $scheme }}://...
if that fixes no actual issues I do not think its worth the complexity it adds.
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
Add support for only one replica in the helm chart
Motivation and Context
using
replicas: 1
used to render something like this:Where
{0...0}
is not supported by the minio server. Now extended with the if statement it will render out the following:The line I edited is one big cluster fuck its basically looping over num pools and then creating a range for num replicas. And I added a additional if else statement in the loop saying it should not create a range if start and end are equal and instead just put the digit as is.
How to test this PR?
I used the helm template preview vscode extension to look at the rendered yaml. But any helm template renderer should work fine.
Then play with the
pools:
andreplicas:
amount and ensure it never produces invalid urls such as{0...0}
while still maintaing multi pool support where every url is unique. Here a few examples so you don't have to do it:The default
The case im trying to fix which used to render {0...0}:
Support for multiple pools is still kept:
And support for multi pool and multi node:
Types of changes
Checklist:
commit-id
orPR #
here)