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

User Supplied "podAntiAffinity" is overwritten by "reloader-podAntiAffinity" set in deployment in 1.0.54 #593

Closed
Sanghamitra-PERSONAL opened this issue Dec 21, 2023 · 4 comments
Labels
kind/bug Something isn't working

Comments

@Sanghamitra-PERSONAL
Copy link
Contributor

Sanghamitra-PERSONAL commented Dec 21, 2023

Hello Team,

Describe the bug
In the Values file there is reloader.deployment.affinity option .

When I set the affinity block with enable HA = true : ->
deployment:
replicas: 3
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- reloader-reloader
- key: release
operator: In
values:
- reloader
topologyKey: topology.kubernetes.io/zone

During the installation it always gets overwritten by below block, :
_helpers.tpl :
{{- define "reloader-podAntiAffinity" -}}
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:

  • weight: 100
    podAffinityTerm:
    labelSelector:
    matchExpressions:
    - key: app
    operator: In
    values:
    - {{ template "reloader-fullname" . }}
    topologyKey: "kubernetes.io/hostname"
    {{- end -}}

Due to the reason below :
Deployment.yaml :->
{{ toYaml .Values.reloader.deployment.affinity | indent 8 }}
{{- end}}
{{ include "reloader-podAntiAffinity" . | indent 8 }}
{{- end }}

So at the end the deployment from the cluster is :
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- reloader-reloader
topologyKey: kubernetes.io/hostname
weight: 100
containers:

Expected behavior
From the above output , because of "include "reloader-podAntiAffinity"" this is happening.
I expect that this "include "reloader-podAntiAffinity" shouldnot be set after the line " toYaml .Values.reloader.deployment.affinity" in order helm chart takes into consideration user assigned podAntiAffinity as part of User Assigned Values file.

Deployment.yaml :->
{{ toYaml .Values.reloader.deployment.affinity | indent 8 }}
{{- end}}
{{ include "reloader-podAntiAffinity" . | indent 8 }}
{{- end }}

Environment

  • Operator Version: 1.0.54
  • Kubernetes Version: AKS 1.27.3

Thanks,
Sanghamitra

@Sanghamitra-PERSONAL Sanghamitra-PERSONAL added the kind/bug Something isn't working label Dec 21, 2023
@MuneebAijaz
Copy link
Contributor

hi @Sanghamitra-PERSONAL , can you open a PR for the said issue?

@Sanghamitra-PERSONAL
Copy link
Contributor Author

Thanks for the reply @MuneebAijaz . Should I raise PR to 1.0.54 version or to the latest version?

Please let me know.

Thanks,
Sanghamitra

@MuneebAijaz
Copy link
Contributor

hi @Sanghamitra-PERSONAL , you can raise the PR again latest version, master branch

@Sanghamitra-PERSONAL
Copy link
Contributor Author

Hi @MuneebAijaz , I have raised a PR #596 for the same. Please review.

Thanks,
Sanghamitra

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants