Kubernetes – Enable GZip For Nginx Ingress Controller

It may feel obvious, like something that just should… be there? I am of course speaking of GZip compression for NGinx Ingress on Kubernetes… Duh.

Here’s how to enable it (once deployed):

First, edit the configmap

~$ kubectl -n ingress-nginx edit configmaps ingress-nginx-controller

Second, Add the following

apiVersion: v1
data:
  allow-snippet-annotations: "true"
  gzip-types: '*'          <--------- Add this line
  use-gzip: "true"         <--------- Add this line
kind: ConfigMap
metadata:
  annotations:
...........

:wq to save

This should GZIP compress everything

Compress all the things ?

Leave a Reply

Your email address will not be published. Required fields are marked *