ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

Changing of cors-* annotations has no effect

Open vnesbee opened this issue 3 years ago • 6 comments

NGINX Ingress controller version (exec into the pod and run nginx-ingress-controller --version.): 1.1.0, 1.1.1

Kubernetes version (use kubectl version): 1.21.5

Environment:

  • Cloud provider or hardware configuration: GCP

  • How was the ingress-nginx-controller installed: kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.1/deploy/static/provider/cloud/deploy.yaml

What happened:

I set these annotations for an ingress of my application:

    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/cors-allow-methods: PUT, GET, POST, OPTIONS
    nginx.ingress.kubernetes.io/cors-allow-origin: 'http://localhost:3000'
    nginx.ingress.kubernetes.io/enable-cors: 'true'

When I'm trying to change any CORS-related annotation, these sections of nginx.conf of the controller doesn't change. For applying needed changes I need to delete and recreate the Ingress manifest.

What you expected to happen:

The changes was applied successfully.

How to reproduce it:

  1. Install nginx ingress as usual
  2. Create an Ingress resource with annotations mentioned above
  3. Check your server configuration at nginx.conf in the pod of the controller
  4. Make some changes in the CORS* annotations (except enable-cors)
  5. Go to step 3

vnesbee avatar Feb 10 '22 12:02 vnesbee

@vnesbee: 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 avatar Feb 10 '22 12:02 k8s-ci-robot

/remove-kind bug /kind support

kundan2707 avatar Mar 02 '22 17:03 kundan2707

@vnesbee It should be nginx.ingress.kubernetes.io/enable-cors: "true" update and check once

kundan2707 avatar Mar 02 '22 17:03 kundan2707

@vnesbee
please check and close issue if resolved

kundan2707 avatar Mar 10 '22 10:03 kundan2707

I think this might be related if not the same issue: https://github.com/kubernetes/ingress-nginx/issues/8469

villesau avatar May 05 '22 08:05 villesau

curious, do you have any of these error / warning logs in your ingress-controller logs? https://github.com/kubernetes/ingress-nginx/blob/32306381606c249b86cb2d5015c79f994251dad8/internal/ingress/annotations/cors/main.go#L136

larivierec avatar Jul 26 '22 11:07 larivierec

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 24 '22 12:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Nov 23 '22 13:11 k8s-triage-robot

i have the same problem. my setup is with latest microk8s snap on ubuntu 22.04

phpwutz avatar Dec 12 '22 21:12 phpwutz

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Jan 11 '23 22:01 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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 avatar Jan 11 '23 22:01 k8s-ci-robot