zabbix-community / helm-zabbix

Helm chart for Zabbix
https://artifacthub.io/packages/helm/zabbix-community/zabbix
Apache License 2.0
77 stars 45 forks source link

[zabbix-community/zabbix] helm upgrade failed with statefulset "zabbix-postgresql" #85

Closed bonzonkim closed 1 month ago

bonzonkim commented 2 months ago

Describe the bug A clear and concise description of what the bug is.

Version of Helm and Kubernetes: helm: 3.14.4 kubernets: 1.29.3

What happened: I added "postgresql.persistence.storageClass" then I upgrade with my custom values.yaml file it fails to upgrade with this error

# helm upgrade zabbix zabbix-community/zabbix -f values.yaml -n zabbix
W0428 14:23:46.946410  101725 warnings.go:70] unknown field "spec.metadata"
Error: UPGRADE FAILED: cannot patch "zabbix-postgresql" with kind StatefulSet: StatefulSet.apps "zabbix-postgresql" is invalid: spec: Forbidden: updates to statefulset spec for fields other than 'replicas', 'ordinals', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden

What you expected to happen: it should upgrade with my custom value but it didn't went well.. I've already checked template file and I feel like i did nothing wrong

How to reproduce it (as minimally and precisely as possible): add "postgresql.persistence.storageClass" first time it upgrade but pods "CrashLoopBackOff" for zabbix-server and zabbix-web after remove the option "postgresql.persistence.storageClass" it fails to upgrade with error I provide above

Anything else we need to know:

ViperousTiger commented 2 months ago

@bonzonkim Due to how statefulset works in kubernetes only a couple attributes can be changed which includes replicas, ordinals, template, updatestrategy, persistentvolumeclaimretentionpolicy, and minreadysecounds. Anything else like in this case spec.metadata is not one of the allowed fields for updates. What you'll need to do so you can use the storageclass if fully tear down the statefulset then redeploy with the storageclass. What I would recommend is to separate yourself from this deployment of a database and use a postgres operator! I have a environment im working in with this zabbix community helm chart and using cloud native postgres to handle my databases and its been nothing but bliss!

Hopefully I answered your question!