Kubernetes Ingress Configuration are not updated on GKE cluster?

1/23/2020

I want to update the ingress configuration and which will apply on ingress instance running on kuberntes cluter on gcloud.

For this I have performed two steps:

  1. Firstly, people ask that set both annotation in ingress.yml and then re-create ingress will solve the issue mentioned on this.
kubernetes.io/ingress.class: "gce"
nginx.ingress.kubernetes.io/proxy-body-size: 20m

After deleting the ingress from cluster and create the ingress again also declared me unlucky.

ingress.yml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "gce"
    nginx.ingress.kubernetes.io/proxy-body-size: 20m
    nginx.org/client-max-body-size: "20m"
  1. Secondly, configure the ConfigMap file on the gcloul cluster, so that our ingress configuration will update, but come up with the negative result mentioned on this.

nginx-config.yml

apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-config
  namespace: default
data:
  proxy-body-size: "20m"

So how can I update my ingress properties such as annotation nginx.ingress.kubernetes.io/proxy-body-size, so that I can upload data more than 1 MB (where my cluster deployed on GKE)?

Any help would be appreciated. Thanks

-- Zeb
google-kubernetes-engine
kubernetes
kubernetes-ingress
nginx

1 Answer

1/27/2020

You are misinterpreting the annotations part in your Ingress resource. Let me elaborate on that.

The problem is that you trying to use GCE controller and apply annotations specifically for NGINX Ingress controller. You cannot use NGINX Ingress controller annotations with GCE controller.

For your configuration to work you would need to deploy NGINX Ingress controller.

You can deploy it by following official documentation.

After deploying NGINX Ingress controller the part of the Ingress definition should look like that:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/proxy-body-size: "20m"

Take a specific look at part below:

    kubernetes.io/ingress.class: "nginx"
    nginx.ingress.kubernetes.io/proxy-body-size: "20m"

Please refer to official documentation when applying annotations for NGINX Ingress controller.

-- Dawid Kruk
Source: StackOverflow