Skip to content

The controller doesn't generate %s-generated-kubeletconfig-%s files for new MCPs #5521

@therealak12

Description

@therealak12

We have an OKD cluster with approximately 10 MachineConfigPools (MCPs) that inherit from the worker MCP.
When we add a new MCP, the 97 and 98 kubelet configurations are not generated for it.
They are only created after restarting the Machine Config Controller pod.

I suspect this happens because the kubelet config controller does not register any event handlers on the MCP informer. As a result, adding a new MCP does not trigger reconciliation. When the operator is restarted, the FeatureGate informer emits an initial ADD event, which then triggers reconciliation and leads to the generation of the missing kubeletConfigs.

To reproduce the issue, watch the MachineConfigs (oc get machineconfig -w) and apply a new MCP, for example, as shown below.
The expected behavior is that three MachineConfigs are generated: 97-demo-generated-kubelet, 98-demo-generated-kubelet, and rendered-demo-uuid.

In practice, only rendered-demo-uuid is created. The 97 and 98 kubelet MachineConfigs are generated only after the controller pod is restarted.

apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfigPool
metadata:
  labels:
    machineconfiguration.openshift.io/role: demo
    pools.operator.machineconfiguration.openshift.io/demo: ""
  name: demo
spec:
  machineConfigSelector:
    matchExpressions:
      - key: machineconfiguration.openshift.io/role
        operator: In
        values:
        - worker
        - demo
  maxUnavailable: 1
  nodeSelector:
    matchLabels:
      node-role.kubernetes.io/demo: ""
  paused: false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions