Skip to content

Split ServiceEndpoint into host-network and pod-network fields#4474

Open
coutinhop wants to merge 2 commits intotigera:masterfrom
coutinhop:pedro-CORE-12314
Open

Split ServiceEndpoint into host-network and pod-network fields#4474
coutinhop wants to merge 2 commits intotigera:masterfrom
coutinhop:pedro-CORE-12314

Conversation

@coutinhop
Copy link
Member

Description

Rename Host/Port to HostNetworkHost/HostNetworkPort and add new PodNetworkHost/PodNetworkPort fields to ServiceEndpoint. This allows the operator to configure different K8s API server endpoints for host-networked vs pod-networked pods.

For host-networked pods, EnvVars() uses HostNetworkHost/HostNetworkPort. For pod-networked pods, EnvVars() uses PodNetworkHost/PodNetworkPort. Both inject the standard KUBERNETES_SERVICE_HOST/PORT env var names.

The pod-network values are read from the kubernetes-services-endpoint ConfigMap using the KUBERNETES_SERVICE_HOST_POD_NETWORK and KUBERNETES_SERVICE_PORT_POD_NETWORK keys.

Release Note

Split kubernetes-services-endpoint configmap into KUBERNETES_SERVICE_HOST/PORT for host-networked pods (previous behaviour) and KUBERNETES_SERVICE_HOST_POD_NETWORK and KUBERNETES_SERVICE_PORT_POD_NETWORK for pod-networked pods.

For PR author

  • Tests for change.
  • If changing pkg/apis/, run make gen-files
  • If changing versions, run make gen-versions

For PR reviewers

A note for code reviewers - all pull requests must have the following:

  • Milestone set according to targeted release.
  • Appropriate labels:
    • kind/bug if this is a bugfix.
    • kind/enhancement if this is a a new feature.
    • enterprise if this PR applies to Calico Enterprise only.

coutinhop and others added 2 commits February 26, 2026 18:54
Rename Host/Port to HostNetworkHost/HostNetworkPort and add new
PodNetworkHost/PodNetworkPort fields to ServiceEndpoint. This allows
the operator to configure different K8s API server endpoints for
host-networked vs pod-networked pods.

For host-networked pods, EnvVars() uses HostNetworkHost/HostNetworkPort.
For pod-networked pods, EnvVars() uses PodNetworkHost/PodNetworkPort.
Both inject the standard KUBERNETES_SERVICE_HOST/PORT env var names.

The pod-network values are read from the kubernetes-services-endpoint
ConfigMap using the KUBERNETES_SERVICE_HOST_POD_NETWORK and
KUBERNETES_SERVICE_PORT_POD_NETWORK keys.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants