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

docs for migration of ingress resources in K8s v1.22 and beyond #7441

Closed
wants to merge 1 commit into from
Closed

docs for migration of ingress resources in K8s v1.22 and beyond #7441

wants to merge 1 commit into from

Conversation

longwuyuan
Copy link
Contributor

@longwuyuan longwuyuan commented Aug 5, 2021

What this PR does / why we need it:

Placeholder for the docs needed as per #7397, for the builds of controller version 1.0.0.
This is Work-In-Progress

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Which issue/s this PR fixes

7397 (don;t change this)

How Has This Been Tested?

TODO

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. 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 Aug 5, 2021
@k8s-ci-robot
Copy link
Contributor

@longwuyuan: This issue is currently awaiting triage.

If Ingress contributors 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
Copy link
Contributor

Hi @longwuyuan. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: longwuyuan
To complete the pull request process, please assign thockin after the PR has been reviewed.
You can assign the PR to them by writing /assign @thockin in a comment when ready.

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

Copy link
Contributor

@rikatz rikatz left a comment

Choose a reason for hiding this comment

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

@longwuyuan thanks

Some examples:

I only have one Ingress Controller in my cluster, what can I do?

In this case, you need to make your Controller aware of the objects. If you have too many Ingress objects and they don't have yet the ingressClassName attribute or the ingress annotation (put the annotation here, can't remember it!) you should start your controller with the option --watch-ingress-without-class=true" or configure your helm chart values with .controller.watchIngressWithoutClass: true` (we need to fix this in the helm chart, if someone wants to make a PR ) https://github.com/kubernetes/ingress-nginx/blob/dev-v1/charts/ingress-nginx/templates/controller-deployment.yaml#L79

We highly recommend anyway to create the ingressClass as the following:

apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
  labels:
    app.kubernetes.io/component: controller
  name: nginx
  annotations:
    ingressclass.kubernetes.io/is-default-class: "true"
spec:
  controller: k8s.io/ingress-nginx

And add the value "spec.ingressClassName=nginx" in your Ingress objects

I have more than one controller in my cluster and already use the annotation

No problem. This should still keep working, but we highly recommend you to test!

I have more than one controller running in my cluster, and want to use the new spec

So you need to create multiple Ingress Classes (see example one). But be aware that ingressClass works on a different way: you will need to change the .spec.controller value in your IngressClass and point the controller to the correct ingress class. Let's see some example, supposing that you have two Ingress Classes:

  • nginx1 with .spec.controller equals to "k8s.io/ingress-nginx"
  • nginx2 with .spec.controller equals to "k8s.io/ingress-nginx2"

When deploying your ingress controllers, you will have to change their --controller-class as following:

  • controller-nginx1 with "k8s.io/ingress-nginx"
  • controller-nginx2 with "k8s.io/ingress-nginx2"

So, when you create an Ingress Object with ingressClassName = nginx2, it will look for controllers with "controller-class=k8s.io/ingress-nginx2" and as controller-nginx2 is watching objects that points to ingressClass="k8s.io/ingress-nginx2" it will serve that object, while controller-nginx1 will ignore it

Bare in mind that if your controller-nginx2 is started with "--watch-ingress-without-class=true" it will serve objects without ingress-class, objects with the annotation configured in flag "--ingress-class" and same class value, and also objects pointing to the ingressClass that have the same .spec.controller as configured in --controller-class

docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 7, 2021
@longwuyuan longwuyuan changed the title [WIP - do not merge]docs for migration of ingress resources in K8s v1.22 and beyond docs for migration of ingress resources in K8s v1.22 and beyond Aug 10, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 10, 2021
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/user-guide/migration.md Outdated Show resolved Hide resolved
docs/index.md Outdated Show resolved Hide resolved
@longwuyuan
Copy link
Contributor Author

longwuyuan commented Aug 13, 2021 via email

@longwuyuan
Copy link
Contributor Author

Closing this one and will reopen a new one so I can PR into the dev-v1 branch and also make the review simpler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants