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

Add ability to configure custom ports for experiment services that differ from ReplicaSet container ports. #3428

Open
farid-akhoundov opened this issue Mar 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@farid-akhoundov
Copy link

farid-akhoundov commented Mar 6, 2024

Summary

Hey Argo team!

I noticed when configuring A/B experiments that the port definitions for the generated services are set to use the same ones as on the ReplicaSet container, and I can't see any way to override this and specify custom ports. I was wondering if this is something to consider adding (or already on the team's radar)?

From what I can tell, the changes would need to be made here to override the value with those from the experiment TemplateSpec if they exist:

for _, ctr := range rs.Spec.Template.Spec.Containers {
    for _, port := range ctr.Ports {
	servicePort := corev1.ServicePort{
            Protocol:   port.Protocol,
            Port:       port.ContainerPort,
            TargetPort: intstr.FromInt(int(port.ContainerPort)),
	}
	if port.Name != "" {
            servicePort.Name = port.Name
	}
	ports = append(ports, servicePort)
    }
}

There was some discussion on doing this here, but it seems like the PR that resolved that issue may not have covered that specific use case. Also from what I can tell there's no strict requirement from Kubernetes for the service ports to match the ones on the ReplicaSet container.

Use Cases

Cases where the service ports should differ from the ones on the ReplicaSet container.


Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

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

No branches or pull requests

1 participant