From 1eca4d3fd1221c48145f91f99000eb2fbf33d217 Mon Sep 17 00:00:00 2001 From: songtianlun Date: Tue, 15 Apr 2025 11:58:33 +0800 Subject: [PATCH] chore: update ingress configurations - Enable snippet annotations for nginx ingress controller - Comment out a previous configuration snippet that redirects JPG files This update allows the use of snippet annotations, giving more control over ingress configurations. The previously commented snippet suggested a redirect for JPG files but is now ignored to simplify configuration and focus on the current requirements. --- imagehost/ingress.yaml | 4 ++++ nginx-ingress/vaules.yaml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/imagehost/ingress.yaml b/imagehost/ingress.yaml index eee9b20..58eac7d 100644 --- a/imagehost/ingress.yaml +++ b/imagehost/ingress.yaml @@ -6,6 +6,10 @@ metadata: namespace: imagehost annotations: cert-manager.io/cluster-issuer: "dnspod-cluster-issuer" + #nginx.ingress.kubernetes.io/configuration-snippet: | + # location ~ ^/([^/]+\.jpg)$ { + # return 301 $scheme://$host/i/$1; + # } spec: ingressClassName: nginx tls: diff --git a/nginx-ingress/vaules.yaml b/nginx-ingress/vaules.yaml index a028358..1a8525c 100644 --- a/nginx-ingress/vaules.yaml +++ b/nginx-ingress/vaules.yaml @@ -98,7 +98,7 @@ controller: # their own *-snippet annotations, otherwise this is forbidden / dropped # when users add those annotations. # Global snippets in ConfigMap are still respected - allowSnippetAnnotations: false + allowSnippetAnnotations: true # -- Required for use with CNI based kubernetes installations (such as ones set up by kubeadm), # since CNI and hostport don't mix yet. Can be deprecated once https://github.com/kubernetes/kubernetes/issues/23920 # is merged