-
Notifications
You must be signed in to change notification settings - Fork 10
K8s ‐ Verify web console disabled
This rule verifies that the OpenShift web console is properly disabled on edge/SNO (Single Node OpenShift) clusters. It checks two conditions:
- The console operator
managementStateis explicitly set toRemovedorUnmanaged - No pods remain running in the
openshift-consolenamespace
On edge clusters, the web console should be disabled to reduce resource usage and minimize the attack surface.
- Access to the OpenShift cluster with permissions to read the console operator configuration and list pods
- The
occommand-line tool configured and authenticated - The console operator must be explicitly disabled (
managementStateset toRemovedorUnmanaged)
If the console operator is in Managed state, the rule is marked as Not Applicable since the web console is intentionally enabled.
If the web console is supposed to be disabled but pods remain in the openshift-console namespace:
- Resource waste: Console pods consume CPU and memory on resource-constrained edge/SNO nodes
- Security exposure: An unnecessary web interface increases the attack surface
- Configuration drift: Indicates the console operator removal did not complete cleanly
Common scenarios that may lead to leftover console pods:
- The console operator
managementStatewas changed toRemovedbut the operator failed to clean up pods - A previous rollback or upgrade left orphaned resources in the
openshift-consolenamespace - Manual intervention created pods in the namespace after the console was disabled
- Network or API server issues prevented the operator from completing the teardown
oc get console.operator.openshift.io cluster -o jsonpath='{.spec.managementState}'Expected output for a disabled console: Removed or Unmanaged
oc get pods -n openshift-consoleExpected output when console is properly disabled: No resources found in openshift-console namespace.
oc describe console.operator.openshift.io clusterLook for:
-
managementStatein the spec - Conditions indicating errors during removal
- Recent events related to console teardown
oc get all -n openshift-consoleForce removal of console pods:
# Delete remaining pods
oc delete pods --all -n openshift-console
# Verify pods are gone
oc get pods -n openshift-consoleIf pods keep reappearing, ensure the operator state is correct:
# Verify managementState is Removed
oc get console.operator.openshift.io cluster -o jsonpath='{.spec.managementState}'
# If not, set it to Removed
oc patch console.operator.openshift.io cluster --type merge -p '{"spec":{"managementState":"Removed"}}'If the operator itself is stuck:
# Check the console-operator pod in openshift-console-operator namespace
oc get pods -n openshift-console-operator
oc logs -n openshift-console-operator deployment/console-operator# Re-enable the console
oc patch console.operator.openshift.io cluster --type merge -p '{"spec":{"managementState":"Managed"}}'
# Verify console pods come up
oc get pods -n openshift-console -w# Confirm no pods in openshift-console namespace
oc get pods -n openshift-console
# Confirm operator state
oc get console.operator.openshift.io cluster -o jsonpath='{.spec.managementState}'