Skip to content

Conversation

@tthvo
Copy link
Member

@tthvo tthvo commented Oct 31, 2025

kube-controller-manager expects the dualstack cluster and service CIDRs to be passed as comma-separated list arguments according to the kubernetes IPv4/IPv6 documentation.

This ensures the dualstack cluster and service cidrs are indeed passed as comma-separated lists.

Notes

There was previous unmerged work due to inactivity: #745, which has more details on why we need this.

Related Information

Tested with openshift/installer#9930

kube-controller-manager pod logs:

I1031 00:34:49.550011       1 flags.go:64] FLAG: --cluster-cidr="10.128.0.0/14,fd01::/48"
...output-omitted...
I1031 00:34:49.551226       1 flags.go:64] FLAG: --service-cluster-ip-range="172.30.0.0/16,fd02::/112"
...output-omitted...

KubeControllerManager CR is rendered:

$ oc get kubecontrollermanager cluster -o yaml | yq .spec
logLevel: Normal
managementState: Managed
observedConfig:
  extendedArguments:
    cluster-cidr:
      - 10.128.0.0/14,fd01::/48
    service-cluster-ip-range:
      - 172.30.0.0/16,fd02::/112
...output-omitted...

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Oct 31, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 31, 2025

@tthvo: This pull request references CORS-4220 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

In response to this:

kube-controller-manager expects the dualstack cluster and service CIDRs to be passed as comma-separated list arguments according to the kubernetes IPv4/IPv6 documentation.

This ensures the dualstack cluster and service cidrs are indeed passed as comma-separated lists.

Notes

There was previous unmerged work due to inactivity: #745, which has more details on why we need this.

Related Information

Tested with openshift/installer#9930

kube-controller-manager pod logs:

I1031 00:34:49.550011       1 flags.go:64] FLAG: --cluster-cidr="10.128.0.0/14,fd01::/48"
...output-omitted...
I1031 00:34:49.551226       1 flags.go:64] FLAG: --service-cluster-ip-range="172.30.0.0/16,fd02::/112"
...output-omitted...

KubeControllerManager CR is rendered:

$ oc get kubecontrollermanager cluster -o yaml | yq .spec
logLevel: Normal
managementState: Managed
observedConfig:
 extendedArguments:
   cluster-cidr:
     - 10.128.0.0/14,fd01::/48
   service-cluster-ip-range:
     - 172.30.0.0/16,fd02::/112
...output-omitted...

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tthvo
Copy link
Member Author

tthvo commented Oct 31, 2025

/jira refresh

@openshift-ci-robot
Copy link

openshift-ci-robot commented Oct 31, 2025

@tthvo: This pull request references CORS-4220 which is a valid jira issue.

In response to this:

/jira refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@tthvo
Copy link
Member Author

tthvo commented Oct 31, 2025

/cc @sadasu @mkowalski

service-cluster-ip-range: {{range .ServiceClusterIPRange}}
- {{.}}{{end}}
service-cluster-ip-range:
- {{range $i, $ipRange := .ServiceClusterIPRange}}{{if $i}},{{end}}{{$ipRange}}{{end}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, cluster-kube-apiserver-operator just does:

{{- if .ServiceCIDR | len}}
servicesSubnet: {{index .ServiceCIDR 0 -}}
{{- if .ServiceCIDR | len | eq 2}},{{index .ServiceCIDR 1}}{{end -}}
{{- end}}

both cluster-cidr and service-cluster-ip-range are required to be no more than 2 elements.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this always be the case? We thought similarly about VIP, that there will be always only 1; then we thought similarly about machine networks, that there will be always maximum 2...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but when we thought there was only going to be 1 before, we didn't know what the API was going to be for specifying 2, so we couldn't have pre-emptively supported 2 CIDRs here anyway. Same with if it gets extended to support more than 2 later. Probably it would work by just adding more commas and CIDRs, but we don't actually know that.

Also, it's possible we change the OCP config to allow more than 2 but the kcm arguments don't change, in which case adding all of the OCP config CIDRs would break the kcm config.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks guys for the discussion 🙏

IIUC, we know, as of now, cluster-cidr and service-cluster-ip-range cannot be more than 2 elements. So, we want to handle the max of 2 CIDRs each to ensure that we won't break kcm arguments in the future?

I updated the PR to address the discussion. It is similar to cluster-kube-apiserver-operator, but with a slight modification to make sure if multiple CIDRs are defined, kcm is passed the first 2 CIDRs that it can understand.

Please lmk if that's OK...

…d lists

kube-controller-manager expects the dualstack cluster and service CIDRs
to be passed as comma-separated list arguments [0].

This ensures the dualstack cluster and service cidrs are indeed passed
as comma-separated lists.

References

[0] https://kubernetes.io/docs/concepts/services-networking/dual-stack/#configure-ipv4-ipv6-dual-stack
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 31, 2025

@tthvo: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/okd-scos-e2e-aws-ovn 7d9db03 link false /test okd-scos-e2e-aws-ovn

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@mkowalski
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Nov 21, 2025
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 21, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mkowalski, tthvo
Once this PR has been reviewed and has the lgtm label, please assign ingvagabund for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants