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

Deprecate Service.Spec.LoadBalancerIP #107235

Merged
merged 2 commits into from
Jan 4, 2022

Conversation

uablrek
Copy link
Contributor

@uablrek uablrek commented Dec 27, 2021

What type of PR is this?

/kind documentation
/kind deprecation
/sig network

What this PR does / why we need it:

Service.Spec.LoadBalancerIP can't be used for dual-stack services. A plural LoadBalancerIPs was proposed in PR1992. The discussions around that PR revealed that the Service.Spec.LoadBalancerIP field was under-specified and and its meaning varies across implementations. So the final proposal was to deprecate Service.Spec.LoadBalancerIP rather than introducing a plural LoadBalancerIPs.

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Please read the comments in PR1992.

Does this PR introduce a user-facing change?

Deprecate Service.Spec.LoadBalancerIP. This field was under-specified and its meaning varies across implementations.  As of Kubernetes v1.24, users are encouraged to use implementation-specific annotations when available.  This field may be removed in a future API version.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/documentation Categorizes issue or PR as related to documentation. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. sig/network Categorizes an issue or PR as relevant to SIG Network. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 27, 2021
@k8s-ci-robot
Copy link
Contributor

@uablrek: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Dec 27, 2021
@k8s-ci-robot k8s-ci-robot added the sig/apps Categorizes an issue or PR as relevant to SIG Apps. label Dec 27, 2021
@uablrek
Copy link
Contributor Author

uablrek commented Dec 27, 2021

/assign @thockin

@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@aojea
Copy link
Member

aojea commented Dec 27, 2021

@liggitt do we need to add code for adding the warning headers? any pointer?

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 3, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: thockin, uablrek

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

The pull request process is described 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 3, 2022
@k8s-triage-robot
Copy link

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@aojea
Copy link
Member

aojea commented Nov 16, 2022

@thockin @uablrek it seems that this fields is in use by all the cloud providers and the warning about removal is forcing them to move to annotations kubernetes/cloud-provider-gcp#371

I don't know if we can do a breaking change like that of removing it in the future, should we relax the wording ?

@uablrek
Copy link
Contributor Author

uablrek commented Nov 16, 2022

it seems that this fields is in use by all the cloud providers and the warning about removal is forcing them to move to annotations

I think that's the intention. I assume no cloud provider just use the LoadBalancerIP address without other configurations as well, so this really is a cloud provider specific setting and should be an annotation.

@aojea
Copy link
Member

aojea commented Nov 16, 2022

But I don't think we can remove it without breaking users and keep compatibility with old clients?

apiVersion: v1
kind: Service
metadata:
  name:test
  namespace: default
spec:
  nonExistingField: test
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP
  selector:
    app: echoserver
  type: ClusterIP
$ kubectl create -f svc2.yaml
Error from server (BadRequest): error when creating "svc2.yaml": Service in version "v1" cannot be handled as a Service: strict decoding error: unknown field "spec.nonExistingField"

@liggitt @thockin is realistic we can remove this field without going through a large process of deprecation?
how do we deal with stored objects that already has the field set?

@liggitt
Copy link
Member

liggitt commented Nov 16, 2022

Agree we would not drop the field, but marking it deprecated/undefined behavior is fair game.

@aojea
Copy link
Member

aojea commented Nov 18, 2022

Just to avoid more confusion on this topic, deprecating API and remove fields on GA APIs has to obey some rules

See API changes

https://kubernetes.io/docs/concepts/overview/kubernetes-api/#api-changes

Elimination of resources or fields requires following the API deprecation policy.

See the rules

https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-parts-of-the-api

Fields of REST resources
As with whole REST resources, an individual field which was present in API v1 must exist and function until API v1 is removed. Unlike whole resources, the v2 APIs may choose a different representation for the field, as long as it can be round-tripped. For example a v1 field named "magnitude" which was deprecated might be named "deprecatedMagnitude" in API v2. When v1 is eventually removed, the deprecated field can be removed from v2.

@uablrek uablrek deleted the deprecate-loadbalancerip branch April 29, 2023 15:31
dduportal added a commit to jenkins-infra/azure that referenced this pull request May 26, 2023
Related to
jenkins-infra/helpdesk#3351 (comment)

This PR adds a DNS record for the private Nginx ingress of the
`publick8s` cluster.
It's required to migrate keycloak (which exposes the
`admin.accounts.jenkins.io` ingress through the private-nginx).


Please note the following elements:

- Nit: this PR renames the 2 terraform resources for the existing DNS
records of the public loadbalancer, to have homogeneous names
  - Will need a subsequent PR to delete the `moved` blocks once applied

- The private IP is written "raw": automation of this could be done
through
[AKS](https://learn.microsoft.com/en-us/azure/aks/static-ip#apply-a-dns-label-to-the-service)
or as seen below, but it's not needed immediatly at all:
- The change of value for this one does not happen often (once?) so
automation value is not obvious on short term
- The IP is created AFTER the whole cluster initialization, when the
`private-nginx` helm release is installed for the first time: it
dynamically allocates the IP in the private network as per a Kubernetes
event: liefcylce is NOT coupeld to terraform
- Automation could be to manage the private Azure LB as a Terraform
resource and pass it as an argument to the private-nginx helm-release
(like it's done witht the public one). But
kubernetes/kubernetes#107235 shows that the
`loadBalancdrIP` field for Service is uncertain (so another reason to
delay automation)

- No IPv6 DNS record for the private ingress. We don't need toi use Ipv6
today to reach these internal services.

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
tamcore added a commit to gitgrave/traccar-helm that referenced this pull request Dec 9, 2023
required, as spec.loadBalancerIP is deprecated kubernetes/kubernetes#107235
Ornias1993 pushed a commit to truecharts/library-charts that referenced this pull request Dec 24, 2023
… use annotations (#650)

**Description**
<!--
Please include a summary of the change and which issue is fixed. Please
also include relevant motivation and context. List any dependencies that
are required for this change.
-->
⚒️ Fixes  # <!--(issue)-->

kubernetes/kubernetes#107235

```sh
Failed to allocate IP for "ix-blocky/blocky-dot": service can not have both metallb.universe.tf/loadBalancerIPs and svc.Spec.LoadBalancerIP
```

**⚙️ Type of change**

- [ ] ⚙️ Feature/App addition
- [x] 🪛 Bugfix
- [ ] ⚠️ Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] 🔃 Refactor of current code

**🧪 How Has This Been Tested?**
<!--
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration
-->

**📃 Notes:**
<!-- Please enter any other relevant information here -->

**✔️ Checklist:**

- [x] ⚖️ My code follows the style guidelines of this project
- [x] 👀 I have performed a self-review of my own code
- [x] #️⃣ I have commented my code, particularly in hard-to-understand
areas
- [ ] 📄 I have made corresponding changes to the documentation
- [x] ⚠️ My changes generate no new warnings
- [x] 🧪 I have added tests to this description that prove my fix is
effective or that my feature works
- [x] ⬆️ I increased versions for any altered app according to semantic
versioning

**➕ App addition**

If this PR is an app addition please make sure you have done the
following.

- [ ] 🪞 I have opened a PR on
[truecharts/containers](https://github.com/truecharts/containers) adding
the container to TrueCharts mirror repo.
- [ ] 🖼️ I have added an icon in the Chart's root directory called
`icon.png`

---

_Please don't blindly check all the boxes. Read them and only check
those that apply.
Those checkboxes are there for the reviewer to see what is this all
about and
the status of this PR with a quick glance._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/deprecation Categorizes issue or PR as related to a feature/enhancement marked for deprecation. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants