ansible / awx-operator

An Ansible AWX operator for Kubernetes built with Operator SDK and Ansible. 🤖
https://www.github.com/ansible/awx
Apache License 2.0
1.17k stars 587 forks source link

CRDs not updated by awx-operator helm deployment #1855

Closed pombaer closed 1 week ago

pombaer commented 2 weeks ago

Please confirm the following

Bug Summary

I tried to upgrade from awx-operator 2.12.2 with postgres-13 to awx-operator 2.16.1 using postgres-15 and received error: "spec.postgres_init_container_commands" The postgresql-15 pod logged following error: "mkdir: cannot create directory '/var/lib/pgsql/data/userdata': Permission denied" I also tried installing all operator version between 2.12.2 and 2.16.1 to get a working 2.16.1 operator, but always same errors. After a lot of debugging and searching i realized that the CRDs were always still the old ones and were not updated by newly installed operators and also were not deleted on unistalling the awx-operator using helm uninstall. After deleting all CRDs:

kubectl delete crds awxbackups.awx.ansible.com
kubectl delete crds awxmeshingresses.awx.ansible.com
kubectl delete crds awxrestores.awx.ansible.com
kubectl delete crds awxs.awx.ansible.com

and redeploying the helm awx-operator chart everything worked as expected. I don't know if this is a Bug or this is a normal behavior but it took a lot of time for me to find this issue, so i report it as issue, so please delete if this is a known behavior or if i did something wrong.

AWX Operator version

2.16.1

AWX version

latest

Kubernetes platform

other (please specify in additional information)

Kubernetes/Platform version

rke2 1.26

Modifications

no

Steps to reproduce

Install awx-operator 2.12.2 with helm Upgrade to 2.26.1 with helm

Expected results

CRD's should be updated on redeployment with helm or should be deleted when running helm uninstall

Actual results

CRD's are not updated and are always first installed version.

Additional information

No response

Operator Logs

No response

kurokobo commented 2 weeks ago

@pombaer Hi, this is designed behavior of Helm. Helm does not upgrade or remove existing CRDs. See the doc on this repository: https://github.com/ansible/awx-operator/tree/devel/.helm/starter#caveats-on-upgrading-existing-installation Also there is an official doc that describes this behavior: https://helm.sh/docs/chart_best_practices/custom_resource_definitions/#some-caveats-and-explanations

pombaer commented 2 weeks ago

Thank your for clarifying this