Skip to content

Commit 34f652c

Browse files
michaelbeaumontsmira
authored andcommitted
feat: add well-known app.kubernetes.io labels to control-plane pods
This PR adds most of the recommended labels. Signed-off-by: Mike Beaumont <mjboamail@gmail.com> Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
1 parent fc89dc2 commit 34f652c

1 file changed

Lines changed: 21 additions & 6 deletions

File tree

internal/app/machined/pkg/controllers/k8s/control_plane_static_pod.go

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,13 @@ func (ctrl *ControlPlaneStaticPodController) manageAPIServer(ctx context.Context
462462
constants.AnnotationStaticPodConfigVersion: configResource.Metadata().Version().String(),
463463
},
464464
Labels: map[string]string{
465-
"tier": "control-plane",
466-
"k8s-app": k8s.APIServerID,
465+
"tier": "control-plane",
466+
"k8s-app": k8s.APIServerID,
467+
"component": k8s.APIServerID,
468+
"app.kubernetes.io/name": k8s.APIServerID,
469+
"app.kubernetes.io/version": compatibility.VersionFromImageRef(cfg.Image).String(),
470+
"app.kubernetes.io/component": "control-plane",
471+
"app.kubernetes.io/managed-by": "Talos",
467472
},
468473
},
469474
Spec: v1.PodSpec{
@@ -635,8 +640,13 @@ func (ctrl *ControlPlaneStaticPodController) manageControllerManager(ctx context
635640
constants.AnnotationStaticPodConfigVersion: configResource.Metadata().Version().String(),
636641
},
637642
Labels: map[string]string{
638-
"tier": "control-plane",
639-
"k8s-app": k8s.ControllerManagerID,
643+
"tier": "control-plane",
644+
"k8s-app": k8s.ControllerManagerID,
645+
"component": k8s.ControllerManagerID,
646+
"app.kubernetes.io/name": k8s.ControllerManagerID,
647+
"app.kubernetes.io/version": compatibility.VersionFromImageRef(cfg.Image).String(),
648+
"app.kubernetes.io/component": "control-plane",
649+
"app.kubernetes.io/managed-by": "Talos",
640650
},
641651
},
642652
Spec: v1.PodSpec{
@@ -820,8 +830,13 @@ func (ctrl *ControlPlaneStaticPodController) manageScheduler(ctx context.Context
820830
constants.AnnotationStaticPodConfigVersion: configResource.Metadata().Version().String(),
821831
},
822832
Labels: map[string]string{
823-
"tier": "control-plane",
824-
"k8s-app": k8s.SchedulerID,
833+
"tier": "control-plane",
834+
"k8s-app": k8s.SchedulerID,
835+
"component": k8s.SchedulerID,
836+
"app.kubernetes.io/name": k8s.SchedulerID,
837+
"app.kubernetes.io/version": compatibility.VersionFromImageRef(cfg.Image).String(),
838+
"app.kubernetes.io/component": "control-plane",
839+
"app.kubernetes.io/managed-by": "Talos",
825840
},
826841
},
827842
Spec: v1.PodSpec{

0 commit comments

Comments
 (0)