canonical / kubernetes-charm-libraries

Charm libraries for interacting with Kubernetes.
https://charmhub.io/kubernetes-charm-libraries
Apache License 2.0
0 stars 0 forks source link

fix: TELCO-887 Cleanup annotations #25

Closed markbeierl closed 10 months ago

markbeierl commented 10 months ago

On remove event, the library needs to also remove the networks annotation, and drop privileges

Description

Please include a summary of the change. Please also include relevant motivation and context. List any dependencies that are required for this change.

Checklist:

markbeierl commented 10 months ago

Do we need to do this? We're about to remove the StatefulSet so why do we care to revert the patch on the container? It's clear that we need to cleanup NADs, which belong to the namespace, but security context and annotations belong to the container we're removing.

We are not necessarily removing the statefulset. If you scale the unit down to 0, and then scale it back up, this prevents the pod from restarting as the annotations cannot be satisfied and Juju loses control of the pod, resulting in the need for --force removal

markbeierl commented 10 months ago

https://github.com/canonical/sdcore-upf-k8s-operator/issues/54

Gmerold commented 10 months ago

Do we need to do this? We're about to remove the StatefulSet so why do we care to revert the patch on the container? It's clear that we need to cleanup NADs, which belong to the namespace, but security context and annotations belong to the container we're removing.

We are not necessarily removing the statefulset. If you scale the unit down to 0, and then scale it back up, this prevents the pod from restarting as the annotations cannot be satisfied and Juju loses control of the pod, resulting in the need for --force removal

Ups :D