Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

299
Vistas
Apply nginx-ingress annotations at path level

We are migrating from a traditional nginx deployment to a kubernetes nginx-ingress controller. I'm trying to apply settings at a location level, but can't see how to do so with annotations.

For example, we had:

server {
  listen 80;
  server_name example.com;

  location /allow-big-uploads {
    client_max_body_size 100M;
    ...
  }
}

And we translate to something like this:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: web-ingress
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: 100m <-- this now applies globally
spec:
  rules:
    - host: example.com
      http:
        paths:
          - path: /allow-big-uploads
            backend:
              serviceName: example-svc
              servicePort: 5009

Adding that annotation under the path section doesn't seem to work. Am I missing something?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Annotations can only be set on the whole kubernetes resource, as they are part of the resource metadata. The ingress spec doesn't include that functionality at a lower level.

If you are looking for more complex setups, traefik have built a custom resource definition for their ingress controller that allows more configuration per service. The downside is the definition is not compatible with other ingress controllers.

over 4 years ago · Santiago Trujillo Denunciar

0

If you have 2 locations on the same host and you want to apply a setting on just one location , you can create 2 ingresses with the same hosts , and apply on the ingress you are interested the configuration snippet annotation:

https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet

nginx.ingress.kubernetes.io/configuration-snippet: |

  more_set_headers "Request-Id: $req_id";

i have tried for this example and it works.

However, when i try to change the client_max_body_size via the configuration snippet , i get the error :

"client_max_body_size" directive is duplicate
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda