mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Short port names for service load balancer
If a port name is longer than 15 characters we are unable to create the associated service load balancer containers. Use our own short name of `lb-port-{port}` to avoid naming issues. For rancher/k3s/issues/90
This commit is contained in:
parent
dc91c4850b
commit
7e1abf28f1
@ -272,11 +272,8 @@ func (h *handler) newDeployment(svc *core.Service) (*apps.Deployment, error) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for i, port := range svc.Spec.Ports {
|
for _, port := range svc.Spec.Ports {
|
||||||
portName := port.Name
|
portName := fmt.Sprintf("lb-port-%d", port.Port)
|
||||||
if portName == "" {
|
|
||||||
portName = fmt.Sprintf("port-%d", i)
|
|
||||||
}
|
|
||||||
container := core.Container{
|
container := core.Container{
|
||||||
Name: portName,
|
Name: portName,
|
||||||
Image: image,
|
Image: image,
|
||||||
|
Loading…
Reference in New Issue
Block a user