What happened?
I'm using a helm chart to deploy an application, and I typically insert an specific proxy I need as a legacy sidecar (after init). However, this helm chart specifically does now allow specifying additional containers (again, legacy sidecar pattern), but it does allow specifying init containers using the newer Sidecar Containers feature.
The sidecar config might look like this with the new sidecar pattern:
initContainers:
- name: myproxy
image: myproxy
restartPolicy: Always
ports:
- containerPort: 8080
name: proxy-port
protocol: TCP
After deploying this:
- The
v1/Service has endpoints that point to the target pods
- Manually, I can connect to
<pod IP>:8080
- Attempting to connect to the service results in a connection refused.
What did you expect to happen?
The connection to the sidecar should work.
How can we reproduce it (as minimally and precisely as possible)?
- Create a pod with a named port in a container under
initContainers with restartPolicy: Always
- Create a
v1/Service that has a selector that targets the pod
- Attempt to lookup the SRV record
Anything else we need to know?
No response
Kubernetes version
Details
Client Version: v1.31.0
Kustomize Version: v5.4.2
Server Version: v1.30.5-gke.1443001
Cloud provider
Details
GKE
OS version
Details
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
Install tools
Details
Container runtime (CRI) and version (if applicable)
Details
Related plugins (CNI, CSI, ...) and versions (if applicable)
Details
What happened?
I'm using a helm chart to deploy an application, and I typically insert an specific proxy I need as a legacy sidecar (after init). However, this helm chart specifically does now allow specifying additional containers (again, legacy sidecar pattern), but it does allow specifying init containers using the newer Sidecar Containers feature.
The sidecar config might look like this with the new sidecar pattern:
After deploying this:
v1/Servicehas endpoints that point to the target pods<pod IP>:8080What did you expect to happen?
The connection to the sidecar should work.
How can we reproduce it (as minimally and precisely as possible)?
initContainerswithrestartPolicy: Alwaysv1/Servicethat has aselectorthat targets the podAnything else we need to know?
No response
Kubernetes version
Details
Cloud provider
Details
GKEOS version
Details
Install tools
Details
Container runtime (CRI) and version (if applicable)
Details
Related plugins (CNI, CSI, ...) and versions (if applicable)
Details