简体   繁体   中英

Kubernetes Ingress Configuration are not updated on GKE cluster?

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM