Skip to content

Commit 22ca4a7

Browse files
kylos101claude
andcommitted
Remove obsolete node labels for ws-daemon and registry-facade readiness
Removes the node labels `gitpod.io/ws-daemon_ready_ns_*` and `gitpod.io/registry-facade_ready_ns_*` as they are no longer necessary since workspace scheduling now relies on taints instead of positive labels. Changes: - ws-manager-mk2: Remove NodeSelectorRequirements for obsolete labels - node-labeler: Remove label constants and management logic while preserving taint functionality - Documentation: Update to reflect taint-based scheduling approach 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 79b857a commit 22ca4a7

File tree

3 files changed

+5
-66
lines changed

3 files changed

+5
-66
lines changed

components/node-labeler/cmd/run.go

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ import (
4444
)
4545

4646
const (
47-
registryFacadeLabel = "gitpod.io/registry-facade_ready_ns_%v"
48-
wsdaemonLabel = "gitpod.io/ws-daemon_ready_ns_%v"
49-
5047
registryFacade = "registry-facade"
5148
wsDaemon = "ws-daemon"
5249

@@ -351,10 +348,6 @@ func (r *NodeReconciler) reconcileAll(ctx context.Context) error {
351348
continue
352349
}
353350

354-
err := updateNodeLabel(node.Name, r.Client)
355-
if err != nil {
356-
log.WithError(err).WithField("node", node.Name).Error("failed to initialize labels on node")
357-
}
358351
r.Reconcile(ctx, reconcile.Request{NamespacedName: types.NamespacedName{Name: node.Name}})
359352
}
360353

@@ -378,10 +371,6 @@ func (r *NodeReconciler) Reconcile(ctx context.Context, req reconcile.Request) (
378371
if err != nil {
379372
return reconcile.Result{}, fmt.Errorf("cannot list pods: %w", err)
380373
}
381-
err = updateNodeLabel(node.Name, r.Client)
382-
if err != nil {
383-
log.WithError(err).WithField("node", node.Name).Error("failed to initialize labels on node")
384-
}
385374
isWsdaemonTaintExists := isNodeTaintExists(wsDaemonTaintKey, node)
386375
isRegistryFacadeTaintExists := isNodeTaintExists(registryFacadeTaintKey, node)
387376
isWsDaemonReady, isRegistryFacadeReady := false, false
@@ -735,45 +724,3 @@ func isWorkspaceNode(node corev1.Node) bool {
735724
_, isHeadlessWorkspaceNode := node.Labels[workspacesHeadlessLabel]
736725
return isRegularWorkspaceNode || isHeadlessWorkspaceNode
737726
}
738-
739-
func updateNodeLabel(nodeName string, client client.Client) error {
740-
return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
741-
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
742-
defer cancel()
743-
744-
var node corev1.Node
745-
err := client.Get(ctx, types.NamespacedName{Name: nodeName}, &node)
746-
if err != nil {
747-
return err
748-
}
749-
750-
registryFacadeLabelForNamespace := fmt.Sprintf(registryFacadeLabel, namespace)
751-
wsDaemonLabelForNamespace := fmt.Sprintf(wsdaemonLabel, namespace)
752-
753-
needUpdate := false
754-
755-
if node.Labels == nil {
756-
node.Labels = make(map[string]string)
757-
}
758-
759-
if v := node.Labels[registryFacadeLabelForNamespace]; v != "true" {
760-
needUpdate = true
761-
}
762-
if v := node.Labels[wsDaemonLabelForNamespace]; v != "true" {
763-
needUpdate = true
764-
}
765-
766-
if !needUpdate {
767-
return nil
768-
}
769-
node.Labels[registryFacadeLabelForNamespace] = "true"
770-
node.Labels[wsDaemonLabelForNamespace] = "true"
771-
772-
err = client.Update(ctx, &node)
773-
if err != nil {
774-
return err
775-
}
776-
777-
return nil
778-
})
779-
}

components/ws-manager-mk2/controllers/create.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,6 @@ func createDefiniteWorkspacePod(sctx *startWorkspaceContext) (*corev1.Pod, error
339339
Key: "gitpod.io/workload_workspace_" + workloadType,
340340
Operator: corev1.NodeSelectorOpExists,
341341
},
342-
{
343-
Key: "gitpod.io/ws-daemon_ready_ns_" + sctx.Config.Namespace,
344-
Operator: corev1.NodeSelectorOpExists,
345-
},
346-
{
347-
Key: "gitpod.io/registry-facade_ready_ns_" + sctx.Config.Namespace,
348-
Operator: corev1.NodeSelectorOpExists,
349-
},
350342
}
351343

352344
affinity := &corev1.Affinity{

memory-bank/components/node-labeler.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,12 @@ The Node-Labeler component integrates with:
7777

7878
## Usage Patterns
7979

80-
### Node Label Management
81-
The component adds the following labels to nodes:
82-
- `gitpod.io/registry-facade_ready_ns_<namespace>`: Indicates registry-facade is ready
83-
- `gitpod.io/ws-daemon_ready_ns_<namespace>`: Indicates ws-daemon is ready
80+
### Node Taint Management
81+
The component manages node taints to control workspace scheduling:
82+
- `gitpod.io/registry-facade-not-ready`: Added when registry-facade is not ready
83+
- `gitpod.io/ws-daemon-not-ready`: Added when ws-daemon is not ready
8484

85-
These labels are used by the workspace scheduler to ensure workspaces are only scheduled on nodes with the required services.
85+
These taints prevent workspace pods from being scheduled on nodes where required services are not available.
8686

8787
### Cluster-Autoscaler Annotation Management
8888
The component adds or removes the following annotation:

0 commit comments

Comments
 (0)