@Elena Fomina , Thank you for your question.
If you do a
kubectl describe cm omsagent-rs-config -n kube-system you shall find an interesting label:
As discussed here,
Addons with label
addonmanager.kubernetes.io/mode=Reconcile will be periodically reconciled. Direct manipulation to these addons through apiserver is discouraged because addon-manager will bring them back to the original state. In particular:
- Addon will be re-created if it is deleted.
- Addon will be reconfigured to the state given by the supplied fields in the template file periodically.
- Addon will be deleted when its manifest file is deleted from the
$ADDON_PATH by default is set to
/etc/kubernetes/addons/ on the control plane node(s).
For more information please check this document.
Since AKS is a managed Kubernetes Service you will not be able to access
$ADDON_PATH. We strongly recommend against forcing changes to
kube-system resources as these are critical for the proper functioning of the cluster.
- Please check the configurable Container Insights Data collection settings and Metric collection settings.
- Also check the Prometheus scraping settings.
- To configure and deploy the custom configmap please check the Container Insights instructions here and the Prometheus
scraping instructions here.
[ Very Important: Please remember that the downloadable Configmap YAML shared in both the instruction links are the same. You have to download it once and update both settings in the same YAML manifest. Then perform
kubectl apply -f <configmap_yaml_file.yaml> where
configmap_yaml_file.yaml contains the modified configurations for both Container Insights data and Metrics collection as well as Prometheus scraping.]
The configuration change can take a few minutes to finish before taking effect, and all omsagent pods in the cluster will restart. The restart is a rolling restart for all omsagent pods, not all restart at the same time. When the restarts are finished, a message is displayed that's similar to the following and includes the result:
configmap "container-azm-ms-agentconfig" created.
To verify the configuration was successfully applied to a cluster please follow the instructions here.
Hope this helps.
Please "Accept as Answer" if it helped, so that it can help others in the community looking for help on similar topics.