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

Annotation in an Ingress resource overwriting default value defined in ConfigMap for all Ingresses (and perhaps vice versa) #1479

Closed
juissi-t opened this issue Oct 5, 2017 · 3 comments · Fixed by #1486

Comments

@juissi-t
Copy link

juissi-t commented Oct 5, 2017

Our ConfigMap for nginx-ingress-controller looks like this:

apiVersion: v1
data:
  proxy-body-size: "10m"
kind: ConfigMap
metadata:
  name: nginx-load-balancer-conf
  labels:
    app: nginx-ingress-lb

We use an annotation in one of our Ingress resources to use a different value for proxy-body-size:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: api
  annotations:
    ingress.kubernetes.io/proxy-body-size: "5500m"
spec:
  rules:
  - host: api.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: api
          servicePort: 8000

When using nginx-0.9.0-beta.11, the value looks like this in nginx.conf:

# grep client_max_body_size /etc/nginx/nginx.conf
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "5500m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";

We upgraded to nginx-0.9.0-beta.14 and the result was this:

# grep client_max_body_size /etc/nginx/nginx.conf
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";
            client_max_body_size                    "10m";

I then re-applied the Ingress resource, and now it looks like this:

# grep client_max_body_size /etc/nginx/nginx.conf
            client_max_body_size                    "5500m";
            client_max_body_size                    "5500m";
            client_max_body_size                    "5500m";
            client_max_body_size                    "5500m";
            client_max_body_size                    "5500m";
            client_max_body_size                    "5500m";

So, it looks like the default value from the configmap was used regardless of the annotation when upgrading to the new container and nginx.tmpl, and when applying an annotation to a single Ingress, the value is seen in all Ingresses.

@juissi-t juissi-t changed the title Annotation in an Ingress resource overwriting value defined in ConfigMap (and perhaps vice versa) Annotation in an Ingress resource overwriting default value defined in ConfigMap for all Ingresses (and perhaps vice versa) Oct 5, 2017
@juissi-t
Copy link
Author

juissi-t commented Oct 5, 2017

More info: I tried to reproduce this in another cluster, and can't get the annotation to be seen in any of the ingresses. All of them have 10m as the client_max_body_size and deleting and applying or re-applying the Ingress resource doesn't do anything.

@aledbf
Copy link
Member

aledbf commented Oct 5, 2017

Please post the nginx.conf file from the container

@juissi-t
Copy link
Author

juissi-t commented Oct 5, 2017

Anonymized nginx.conf

I removed most of the redundant custom error locations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants