Skip to content

Commit

Permalink
fix(filtering): change label for storage pods|dynnode pods
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorres committed May 7, 2024
1 parent e45d948 commit 1e74a01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions pkg/rolling/restarters/common_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ func newK8sRestarter(logger *zap.SugaredLogger) k8sRestarter {
func (r *k8sRestarter) createK8sClient(kubeconfigPath string) *kubernetes.Clientset {
config, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
if err != nil {
r.logger.Fatalf("Failed to build config from flags %w", err)
r.logger.Fatalf(
"Failed to build kubeconfig from kubeconfig file %s: %s",
kubeconfigPath,
err.Error(),
)
}

clientset, err := kubernetes.NewForConfig(config)
if err != nil {
panic(err.Error())
r.logger.Fatalf("Failed to create a k8s client from config: %s", err.Error())
}

return clientset
Expand Down
2 changes: 1 addition & 1 deletion pkg/rolling/restarters/storage_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (r *StorageK8sRestarter) Filter(
spec FilterNodeParams,
cluster ClusterNodesInfo,
) []*Ydb_Maintenance.Node {
storageLabelSelector := "app.kubernetes.io/instance=storage"
storageLabelSelector := "app.kubernetes.io/component=storage-node"

r.prepareK8sState(r.Opts.kubeconfigPath, storageLabelSelector, r.Opts.namespace)

Expand Down
2 changes: 1 addition & 1 deletion pkg/rolling/restarters/tenant_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (r TenantK8sRestarter) RestartNode(node *Ydb_Maintenance.Node) error {
}

func (r *TenantK8sRestarter) Filter(spec FilterNodeParams, cluster ClusterNodesInfo) []*Ydb_Maintenance.Node {
databaseLabelSelector := "app.kubernetes.io/instance=database"
databaseLabelSelector := "app.kubernetes.io/component=dynamic-node"

r.prepareK8sState(r.Opts.kubeconfigPath, databaseLabelSelector, r.Opts.namespace)

Expand Down

0 comments on commit 1e74a01

Please sign in to comment.