-
Notifications
You must be signed in to change notification settings - Fork 17
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
Drop the cdk-addons label on ceph and keystone components #233
Conversation
f1c0382
to
b11f151
Compare
b11f151
to
39f1468
Compare
4a3d491
to
d8b1923
Compare
d8b1923
to
d6be0af
Compare
cdk-addons/apply
Outdated
# it has our label but isn't a current addon | ||
if resource in ignored_addons: | ||
# either actively ignore it | ||
print("Ignoring %s %s/%s" % resource) | ||
args = ["label", kind, name, "-n", namespace, "cdk-addons-"] | ||
else: | ||
# or delete it! | ||
print("Deleting %s %s/%s" % resource) | ||
args = ["delete", "--wait=false", kind, name, "-n", namespace] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with these changes the snap outputs this on apply when keystone is enabled:
Retiring addon: keystone
Checking for addons to prune
from /root/snap/cdk-addons/x1/addons/kube-state-metrics-deployment.yaml
from /root/snap/cdk-addons/x1/addons/auth-delegator.yaml
from /root/snap/cdk-addons/x1/addons/kube-state-metrics-cluster-role.yaml
from /root/snap/cdk-addons/x1/addons/core-dns.yaml
from /root/snap/cdk-addons/x1/addons/metrics-apiservice.yaml
from /root/snap/cdk-addons/x1/addons/metrics-server-deployment.yaml
from /root/snap/cdk-addons/x1/addons/kube-state-metrics-cluster-role-binding.yaml
from /root/snap/cdk-addons/x1/addons/resource-reader.yaml
from /root/snap/cdk-addons/x1/addons/auth-reader.yaml
from /root/snap/cdk-addons/x1/addons/kube-state-metrics-service.yaml
from /root/snap/cdk-addons/x1/addons/kube-state-metrics-service-account.yaml
from /root/snap/cdk-addons/x1/addons/kubernetes-dashboard.yaml
from /root/snap/cdk-addons/x1/addons/metrics-server-service.yaml
Checking for addons to ignore
from /root/snap/cdk-addons/x1/addons-retired/keystone-auth-certs-secret.yaml
from /root/snap/cdk-addons/x1/addons-retired/keystone-deployment.yaml
from /root/snap/cdk-addons/x1/addons-retired/keystone-rbac.yaml
from /root/snap/cdk-addons/x1/addons-retired/keystone-service.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and the label is removed:
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: k8s-keystone-auth
cdk-restart-on-ca-change: "true"
name: k8s-keystone-auth
namespace: kube-system
hmm -- i wonder about that other label cdk-restart-on-ca-change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, now we can remove BOTH labels 🗡️
0d53605
to
8ea6a3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @addyess; this is a great step towards moving mgmt of included snap addons into individually configurable charms. Nice job!
* Drop the cdkaddons label on ceph and keystone components * remove ceph-csi reboot workaround, address retirement collection * Add ceph and k8s keyston to retire commit list * remove cdk-restart-on-ca-change label as well * consolidate kubectl calls in prune method * update calls to ruff * Adjust call to _try_kubectl * Retire components: gpu and cloud-providers * relabel retired components with cdk-addons-retired=true
* Drop the cdkaddons label on ceph and keystone components * remove ceph-csi reboot workaround, address retirement collection * Add ceph and k8s keyston to retire commit list * remove cdk-restart-on-ca-change label as well * consolidate kubectl calls in prune method * update calls to ruff * Adjust call to _try_kubectl * Retire components: gpu and cloud-providers * relabel retired components with cdk-addons-retired=true
Addresses Issues
LP#2068770
LP#2070053
LP#2070379
Overview
Actively retire certain addons from cdk-addons management by rendering them into a new directory for the snap to manipulate called
addons-retired
, then dropping the cdk-addon label for each component.Details
cdk-addons.apply
called by the charm on each hook, will apply any templates which get rendered into the/root/snap/cdk-addons/current/addons
directory. We should ensure than some components are notkubectl
applied in 1.29 and beyond because they may be charm managed or managed manually.cdk-addons.apply
also prunes component which shouldn't be installed. It will find resource with the labelcdk-addons=true
in cluster, and if they aren't rendered into theaddons
directory, they will be removed. So it's not enough to stop rendering retired components -- we must actively ignore themSince, Ceph and Keystone are being actively dropped starting in the 1.29 release and the cdk-addons snap needs to stop managing them -- the charm will not change the configuration on the stop starting in 1.29, so components like ceph and keystone may still be enabled. If they were enabled pre 1.29, the snap would still be actively managing them.
These changes tell the snap to remove the label from each resource, and to not re-apply the resources if they are removed or changed in the cluster.