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

fix(statefulsets): port name not included in headless service #3077

Merged
merged 3 commits into from
Apr 7, 2024

Conversation

kochie
Copy link
Contributor

@kochie kochie commented Oct 10, 2023

If you have two different containers in a Stateful Set that both require port access Kubernetes (v.1.27) will fail with the following error:

The Service "SERVICE_NAME" is invalid:
* spec.ports[0].name: Required value
* spec.ports[1].name: Required value

This is because during creation of the headless service the name of the ports is not passed. This will also happen if you have a container with multiple ports.

Signed-off-by: Robert Koch <robert@kochie.io>
@kochie kochie changed the title Adds name to port mapping in headless service fix(statefulsets): Adds name to port mapping in headless service Oct 10, 2023
@sumupitchayan sumupitchayan changed the base branch from k8s-27/main to k8s-28/main February 22, 2024 17:21
@iliapolo iliapolo changed the title fix(statefulsets): Adds name to port mapping in headless service fix(statefulsets): port name not included in headless service Apr 7, 2024
@mergify mergify bot merged commit 46a7cb7 into cdk8s-team:k8s-28/main Apr 7, 2024
17 checks passed
cdk8s-automation pushed a commit that referenced this pull request Apr 7, 2024
If you have two different containers in a Stateful Set that both require port access Kubernetes (v.1.27) will fail with the following error:

```bash
The Service "SERVICE_NAME" is invalid:
* spec.ports[0].name: Required value
* spec.ports[1].name: Required value
```

This is because during creation of the headless service the name of the ports is not passed. This will also happen if you have a container with multiple ports.

(cherry picked from commit 46a7cb7)
Signed-off-by: Robert Koch <robert@kochie.io>
cdk8s-automation pushed a commit that referenced this pull request Apr 7, 2024
If you have two different containers in a Stateful Set that both require port access Kubernetes (v.1.27) will fail with the following error:

```bash
The Service "SERVICE_NAME" is invalid:
* spec.ports[0].name: Required value
* spec.ports[1].name: Required value
```

This is because during creation of the headless service the name of the ports is not passed. This will also happen if you have a container with multiple ports.

(cherry picked from commit 46a7cb7)
Signed-off-by: Robert Koch <robert@kochie.io>
@cdk8s-automation
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
k8s-26/main
k8s-27/main

Questions ?

Please refer to the Backport tool documentation

mergify bot pushed a commit that referenced this pull request Apr 7, 2024
…#3991)

# Backport

This will backport the following commits from `k8s-28/main` to `k8s-27/main`:
 - [fix(statefulsets): port name not included in headless service (#3077)](#3077)



### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
mergify bot pushed a commit that referenced this pull request Apr 7, 2024
…#3990)

# Backport

This will backport the following commits from `k8s-28/main` to `k8s-26/main`:
 - [fix(statefulsets): port name not included in headless service (#3077)](#3077)



### Questions ?
Please refer to the [Backport tool documentation](https://github.com/sqren/backport)
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

Successfully merging this pull request may close these issues.

3 participants