openshift / openshift/machine-config-operator
The controller doesn't generate `%s-generated-kubeletconfig-%s` files for new MCPs
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 269
- Forks
- 529
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 83
Description
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/controller/kubelet-config/kubelet_config_controller.go, especially the MCP informer setup around the referenced line, and reproduce the issue with oc get machineconfig -w while applying the example MCP. Done means adding the new MCP causes 97-demo-generated-kubelet, 98-demo-generated-kubelet, and rendered-demo-uuid to appear without restarting the controller.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100