diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0d085e5d..ed5903a0 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -54,6 +54,7 @@ jobs: run: aws eks update-kubeconfig --name $CLUSTER_NAME - name: Install Nginx Ingress run: | + kubectl apply -f custom-error-pages/custom-error.yaml -n ingress-nginx helm upgrade ingress-nginx ingress-nginx \ --repo https://kubernetes.github.io/ingress-nginx \ --namespace=ingress-nginx --create-namespace \ diff --git a/custom-error-pages/custom-error.yaml b/custom-error-pages/custom-error.yaml new file mode 100644 index 00000000..a910047d --- /dev/null +++ b/custom-error-pages/custom-error.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: custom-error-pages +data: + 500: | + + +
+The server encountered an internal error or + misconfiguration and was unable to complete + your request.
+Please contact the server administrator to inform them of the time this error occurred, + and the actions you performed just before this error.
+More information about this error may be available + in the server error log.
+ + diff --git a/values/ingress_config.yaml b/values/ingress_config.yaml index 08ebc0fe..f1065490 100644 --- a/values/ingress_config.yaml +++ b/values/ingress_config.yaml @@ -5,6 +5,7 @@ controller: listen 2443; return 308 https://$host$request_uri; } + custom-http-errors: "500" containerPort: http: 80 https: 443 @@ -18,3 +19,21 @@ controller: service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https" service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600' service.beta.kubernetes.io/aws-load-balancer-type: nlb +defaultBackend: + enabled: true + image: + registry: registry.k8s.io + image: ingress-nginx/nginx-errors + tag: "v20220916-gd32f8c343@sha256:09c421ac743bace19ab77979b82186941c5125c95e62cdb40bdf41293b5c275c" + extraVolumes: + - name: custom-error-pages + configMap: + name: custom-error-pages + items: + - key: "500" + path: "500.html" + - key: "500" + path: "500.json" + extraVolumeMounts: + - name: custom-error-pages + mountPath: /www