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

Change ipFamilyPolicy from RequiredDualStack to SingleStack for headless kubernetes services #590

Closed
Liwanshi opened this issue Oct 30, 2023 · 2 comments
Labels
done Issues in the state 'done' enhancement New feature or request

Comments

@Liwanshi
Copy link
Collaborator

What is missing?

IPv4/IPv6 dual-stack networking graduates to GA. Since 1.21, Kubernetes clusters are enabled to support dual-stack networking by default. In 1.23, the IPv6DualStack feature gate is removed.

For Headless Service , If the service doesn't have any selectors defined then it is defaulted to RequireDualStack on any cluster (single- or dual-stack)

caas-cluster-dc-1-additional-seed-service is a headless service so need to explicitly set it to IPv4 and SingleStack

Why is this needed?

Since 1.21, Kubernetes clusters are enabled to support dual-stack networking by default. In 1.23, the IPv6DualStack feature gate is removed.

@Liwanshi Liwanshi added the enhancement New feature or request label Oct 30, 2023
@Liwanshi
Copy link
Collaborator Author

What needs to be done

func newAdditionalSeedServiceForCassandraDatacenter(dc *api.CassandraDatacenter) *corev1.Service {
	labels := dc.GetDatacenterLabels()
	oplabels.AddOperatorLabels(labels, dc)
	var service corev1.Service
	service.ObjectMeta.Name = dc.GetAdditionalSeedsServiceName()
	service.ObjectMeta.Namespace = dc.Namespace
	service.ObjectMeta.Labels = labels
	// We omit the label selector because we will create the endpoints manually
	service.Spec.Type = "ClusterIP"
	service.Spec.ClusterIP = "None"
	service.Spec.PublishNotReadyAddresses = true
        // Adding ipFamilies and ipFamilyPolicy
	service.Spec.IPfamilies = []corev1.IPFamily{"IPv4"}
	service.Spec.IPFamilyPolicy = corev1.IPFamilyPolicySingleStack

	addAdditionalOptions(&service, &dc.Spec.AdditionalServiceConfig.AdditionalSeedService)


	utils.AddHashAnnotation(&service)

	return &service

@Liwanshi Liwanshi linked a pull request Nov 2, 2023 that will close this issue
5 tasks
@Liwanshi
Copy link
Collaborator Author

no need to implement, tested a new cluster creation on 1.23 k8s version without any changes

@adejanovski adejanovski added the done Issues in the state 'done' label Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done Issues in the state 'done' enhancement New feature or request
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants