rancher / aks-operator

Azure Kubernetes Service operator for Rancher
Apache License 2.0
9 stars 29 forks source link

Add support for Disabling container monitoring once enabled #584

Closed valaparthvi closed 6 days ago

valaparthvi commented 2 months ago
  1. Create an AKS cluster with container monitoring enabled. OR, Edit an existing cluster and enable container monitoring.
  2. Once the cluster has finished provisioning/updating, edit it again and disable the container monitoring.

The cluster goes into updating state after a few seconds, but when it finishes updating, the container monitoring is still enabled.

Previously it was perhaps not possible to disable container monitoring once enabled, but now it is possible via az cli; ref: https://learn.microsoft.com/en-us/azure/azure-monitor/containers/kubernetes-monitoring-disable.

valaparthvi commented 2 weeks ago

Disabling container monitoring is not working as expected. AKSConfig.Monitoring is updated, but the changes are not reflected on Azure Console, AKSStatus.UpstreamSpec.Monitoring showed no sign of change(disabling) even after waiting for 20 min.

I checked for both import and provisioning.

Tested on BUILD_DATE: 20240828 Rancher: v2.9-b8675800666b9e53c340e2f6ab8a19a31d93f0dd-head

valaparthvi commented 2 weeks ago

Talked with @yiannistri offline, and it seems we will need to wait for rancher release to test this.

cpinjani commented 6 days ago

Validation passed on build, able to enable/disable container monitoring for provisioned, imported AKS clusters.

v2.9-65df012014c22ba29006fca8c97aa6b8c2ba1105-head
aks-operator:v1.9.2-rc.1

Logs:

time="2024-09-10T09:05:54Z" level=info msg="Checking configuration for cluster [cpinjani-aks (id: c-zcq4k)]"
time="2024-09-10T09:05:55Z" level=info msg="Updating monitoring addon to false for cluster [cpinjani-aks (id: c-zcq4k)]"
time="2024-09-10T09:05:55Z" level=info msg="Disabling monitoring addon for cluster [cpinjani-aks (id: c-zcq4k)]"
time="2024-09-10T09:08:02Z" level=info msg="Checking configuration for cluster [cpinjani-aks (id: c-zcq4k)]"
time="2024-09-10T09:08:03Z" level=info msg="Cluster [cpinjani-aks (id: c-zcq4k)] finished updating"
time="2024-09-10T09:08:04Z" level=info msg="Checking configuration for cluster [cpinjani-aks (id: c-zcq4k)]"
time="2024-09-10T09:08:05Z" level=info msg="Configuration for cluster [cpinjani-aks (id: c-zcq4k)] was verified"