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

Rework labels, deprecate old compatibility switches #150

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

fibbs
Copy link
Contributor

@fibbs fibbs commented Jan 10, 2025

What this PR does / why we need it:

Adjust labels of all manifests: Formerly, the labels of all manifests were all defined decentrally and containing some wrong entries. Now we have them unified, using the template in _helpers.yaml and concluding to the best practices of Helm

This is a breaking-breaking change
It will force you to re-install the Release, due to selector label matchers being immutable for Deployments, Statefulsets, ....

Also I have removed the service for the Zabbix Agent in sidecar mode: tt makes no sense to have a service in such case, as these sidecar containers are there solely to show up the built-in "Zabbix server" host's interface availability to get green. This is done by using "localhost" as a Zabbix host interface address, which no Service is needed for.

A Service indeed implements loadbalancing over all matched pods, which in this case would lead to connections being round-robined between Zabbix Agent containers on different Zabbix Server pods, if using Zabbix Server HA, which is senseless.

I have also raised version of Zabbix to 7.0.8!

Some values in values.yaml have been changed: Their names were misleading: there is no such thing as a "ContainerLabel" or "ContainerAnnotation"... as the lowest level resource one can set labels on is the Pod.

Last but not least, I have reworked the NOTES.txt to give better instructions on how to get access to Zabbix Web.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Actually, @aeciopires, I changed mind regarding version for the chart. After this PR, it is a very breaking change so that 7.0.0 would actually be the better new major version. I have already changed README.md.gotmpl accordingly.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Variables are documented in values.yaml with Helm-Docs comments, as we build README.md using this utility

Christian Anton added 8 commits January 10, 2025 21:06
Formerly, the labels of all manifests were all defined decentrally and
containing some wrong entries. Now we have them unified, using the
template in _helpers.yaml and concluding to the best practices of Helm
It makes no sense to have a service in such case, as these sidecar
containers are there solely to show up the built-in "Zabbix server"
host's interface availability to get green. This is done by using
"localhost", which no Service is needed for.

A Service indeed implements loadbalancing over all matched pods, which
in this case would lead to connections being round-robined between
Zabbix Agent containers on different Zabbix Server pods, if using Zabbix
Server HA, which is senseless.
There is no such thing as a "ContainerLabel" or "ContainerAnnotation"...
@fibbs fibbs requested a review from aeciopires as a code owner January 10, 2025 22:02
helm.sh/chart: {{ include "zabbix.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ include "zabbix.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fibbs

Here, can we change app.kubernetes.io/managed-by: {{ .Release.Service }}by app.kubernetes.io/managed-by: Helm?

{{- if .Values.zabbixServer.zabbixServerHA.enabled }}
{{ .Values.zabbixServer.zabbixServerHA.haLabelsSidecar.labelName }}: "active"
{{- end }}
{{- end }}


{{- if and .Values.zabbixAgent.enabled .Values.zabbixAgent.runAsDaemonSet }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fibbs!

Why the zabbix-agent service was removed from here?

helm.sh/chart: {{ include "zabbix.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-zabbix-server
app.kubernetes.io/managed-by: {{ .Release.Service }}-zabbix-server
{{- include "zabbix.labels" . | nindent 4 }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @fibbs!

Is only this labbels sufficient to reference by zabbix-server and HA files?

# -- Labels to add to the statefulset
statefulSetLabels: {}
extraStatefulSetLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Labels to add to the statefulset
statefulSetLabels: {}
extraStatefulSetLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Labels to add to the deployment
deploymentLabels: {}
extraDeploymentLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Labels to add to the deployment
deploymentLabels: {}
extraDeploymentLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Labels to add to the deployment
deploymentLabels: {}
extraDeploymentLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Labels to add to the deployment
deploymentLabels: {}
extraDeploymentLabels: {}
# -- Annotations to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

# -- Annotations to add to the containers
containerAnnotations: {}
extraPodAnnotations: {}
# -- Labels to add to the containers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need change:
-containers
+pods

Copy link
Member

@aeciopires aeciopires left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work @fibbs!

Thanks for your time and contruibution. The helm chart is better now.

I made some comments to fix in this PR.

@aeciopires aeciopires added bug Something isn't working documentation Improvements or additions to documentation break change A change in one part of a software system that potentially causes other components to fail labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
break change A change in one part of a software system that potentially causes other components to fail bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong labels in metadata of manifests files
2 participants