Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Unable to turn off tserver UI service due to inconsistencies in the CRD #33

Open
srteam2020 opened this issue Aug 30, 2021 · 1 comment

Comments

@srteam2020
Copy link

Describe the bug

The code in func (r *ReconcileYBCluster) reconcileUIServices(cluster *yugabytev1alpha1.YBCluster) indicates that we can turn off the tserver UI service by changing the port number to <= 0:

} else if err == nil && cluster.Spec.Tserver.TserverUIPort <= 0 {
	// Delete the service if it existed before & it is not needed going forward.
	logger.Info("deleting tserver ui service")
	if err := r.client.Delete(context.TODO(), found); err != nil {
		logger.Errorf("failed to delete tserver ui service object. err: %+v", err)
		return err
	}
}

However, we find the feature is actually not supported as the min value of Spec.Tserver.TserverUIPort specified in the CRD (yugabyte.com_ybclusters_crd.yaml) is 1. Kubernetes will prevent the users from trying to set the TserverUIPort to <= 0, so the tserver UI service will never be turned off.

A follow-up question: In convention, port 0 is a wildcard port that tells the system to find a suitable port number. So maybe setting cluster.Spec.Tserver.TserverUIPort to -1 would be a better choice for deleting the service.

To reproduce

  1. Create YBCluster with cluster.Spec.Tserver.TserverUIPort set to a 7000, which creates the tserverUI service.
  2. Set Spec.Tserver.TserverUIPort to -1 to delete the tserverUI service. The will not work as -1 is a forbidden value for this field by Kubernetes.

Expected behavior

Users should be able to turn off the tserverUI service by setting Spec.Tserver.TserverUIPort to a negative value as indicated in the code.

Fix

We are willing to issue a fix to solve this inconsistency.
We can just remove the min: 1 constraint on Spec.Tserver.TserverUIPort or change the min value to -1 in yugabyte.com_ybclusters_crd.yaml.

@srteam2020
Copy link
Author

We sent a PR to remove the min value for TserverUIPort here: #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant