How to set CoreDNS Operator into unmanaged state
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4
Issue
-
During troubleshooting an issue Red Hat Support Engineer has requested changes be performed to the
CoreDNSconfigurations and deployments, these configurations are controlled by theOpenShift Cluster DNS Operator, which manages most of the resources within theopenshift-dnsnamespace. -
To perform changes to these
managed resources, theCluster DNS Operatormust bedisabledfirst. -
The
Cluster Version Operator (CVO)manages theCluster DNS Operatorand most of the resources in theopenshift-dns-operatornamespace. Therefore, theCluster DNS Operatormust be removed from theCVOmanagement before it can bedisabledto allow changes to theDNSconfigurations.
NOTE: This should not be performed without the request of an Red Hat OpenShift Support Engineers and will result in the OpenShift Cluster in an unsupported state
Resolution
-
Ensure
Cluster DNS Operatoris removed fromCluster Version Operatormanagement by editing theClusterVersionobject as below:$ oc edit clusterversion version ... spec: overrides: - group: apps kind: Deployment name: dns-operator namespace: openshift-dns-operator unmanaged: true -
Scale down the
Cluster DNS Operator.
NOTE: This will result changes toDNS configurationspersisting and will only revert changes once the Operator isre-enabled.$ oc scale -n openshift-dns-operator --replicas=0 deploy/dns-operator -
Once complete, revert changes to the
DNSby configuring theCluster Version OperatortomanagetheCluster DNS Operatoragain as below:$ oc edit clusterversion version ... spec: overrides: []
NOTE: This change MUST be reverted before any cluster updates are performed
Root Cause
-
The
Cluster Version Operator (CVO)manages allCluster Operatordeployments withinOpenShiftand is responsible forCluster Operatorupgrades during anOpenShiftupgrade. -
The
CVOcan be configured toexcluderesources from itmanagement listusing theClusterVersionresource. -
The
clusterversion.spec.overrideslist allows the ability to specify resources that are included in the OpenShift management but should be temporarily excluded fortestingpurposes. -
Generally speaking, it is possible to set other
Cluster Operatorsasunmanagedfollowing the procedure of this article. For instance to set theIngress Cluster Operatorasunmanaged, you would add the following entry inclusterversion.spec.overrides:
- group: apps
kind: Deployment
name: ingress-operator
namespace: openshift-ingress-operator
unmanaged: true
- The general caveat mentioned above applies for all
Cluster Operators, this should not be performed without the request of an Red Hat OpenShift Support Engineers and will put theOpenShift Clusterin an unsupported state.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.