How to set up Kubernetes Ingress that gzips

4/24/2020

I have the following kubernetes ingress and I was wondering whether there is a way to tell it to gzip all responses. I am running this on google kubernetes engine. I tried adding the following annotations but no dice:

kubernetes.io/ingress.class: "nginx"
    nginx.org/server-snippets: "gzip on;\ngzip_comp_level 5;\ngzip_http_version 1.1;\ngzip_min_length 16;\ngzip_proxied any;\n;"

my kubernetes code is:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: the_ingress
  annotations:
    kubernetes.io/ingress.global-static-ip-name: some_static_up
    networking.gke.io/managed-certificates: some_cert
spec:
  backend:
    serviceName: some-app-web-client
    servicePort: 60000

Does anyone know how to accomplish this?

-- HeronAlgoSearch
google-kubernetes-engine
gzip
kubernetes

0 Answers