Last active
April 19, 2025 06:26
-
-
Save AlexGluck/aca78a90520a929b1b1efc933540e60c to your computer and use it in GitHub Desktop.
Revisions
-
AlexGluck revised this gist
Jun 9, 2022 . 1 changed file with 8 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,7 +41,7 @@ metadata: name: nexus-ingress-api annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/$1$is_args$args" spec: ingressClassName: nginx rules: @@ -64,7 +64,7 @@ metadata: name: nexus-ingress-docker-push annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/repository/$2/$1/$2/$2/$3/blobs/uploads/$is_args$args" spec: ingressClassName: nginx rules: @@ -87,7 +87,7 @@ metadata: name: nexus-ingress-docker-login annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/repository/docker-login/$1/$2$is_args$args" spec: ingressClassName: nginx rules: @@ -110,7 +110,7 @@ metadata: name: nexus-ingress-docker-search annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/repository/docker-group/$1/$2$is_args$args" spec: ingressClassName: nginx rules: @@ -132,7 +132,7 @@ kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback-latest annotations: nginx.ingress.kubernetes.io/app-root: "/repository/docker-group/$1/$2$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; spec: @@ -157,7 +157,7 @@ metadata: name: nexus-ingress-docker-pull-norepo annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = /nexus-ingress-docker-registry-fallback-latest; proxy_intercept_errors on; @@ -189,7 +189,7 @@ metadata: name: nexus-ingress-docker annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/app-root: "/repository/$2/$1/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = /nexus-ingress-docker-registry-fallback; proxy_intercept_errors on; @@ -220,7 +220,7 @@ kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback annotations: nginx.ingress.kubernetes.io/app-root: "/repository/$2/$1/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; error_page 404 500 = /nexus-ingress-docker-registry-fallback-latest; -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -142,7 +142,7 @@ spec: http: paths: - path: "/nexus-ingress-docker-registry-fallback-latest" pathType: Exact backend: service: name: nexus @@ -238,7 +238,7 @@ spec: http: paths: - path: "/nexus-ingress-docker-registry-fallback" pathType: Exact backend: service: name: nexus -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 0 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,6 @@ kind: Ingress metadata: name: nexus-ingress annotations: nginx.ingress.kubernetes.io/proxy-body-size: "0" nginx.ingress.kubernetes.io/proxy-buffering: "off" nginx.ingress.kubernetes.io/server-snippet: | @@ -41,7 +40,6 @@ kind: Ingress metadata: name: nexus-ingress-api annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/$1$is_args$args" spec: @@ -65,7 +63,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-push annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$2/$3/blobs/uploads/$is_args$args" spec: @@ -89,7 +86,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-login annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-login/$1/$2$is_args$args" spec: @@ -113,7 +109,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-search annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" spec: @@ -137,7 +132,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback-latest annotations: nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; @@ -162,7 +156,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-pull-norepo annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | @@ -195,7 +188,6 @@ kind: Ingress metadata: name: nexus-ingress-docker annotations: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | @@ -228,7 +220,6 @@ kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback annotations: nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 8 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -139,13 +139,15 @@ metadata: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/nexus-ingress-docker-registry-fallback-latest" pathType: Prefix backend: service: @@ -164,7 +166,7 @@ metadata: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = /nexus-ingress-docker-registry-fallback-latest; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; @@ -197,7 +199,7 @@ metadata: nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = /nexus-ingress-docker-registry-fallback; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; @@ -229,7 +231,8 @@ metadata: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | internal; error_page 404 500 = /nexus-ingress-docker-registry-fallback-latest; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; @@ -243,7 +246,7 @@ spec: - host: nexus.example.org http: paths: - path: "/nexus-ingress-docker-registry-fallback" pathType: Prefix backend: service: -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 18 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,22 @@ --- apiVersion: v1 kind: ConfigMap metadata: name: ingress-nginx-controller data: http-snippet: "proxy_cache_path /tmp/nginx_cache levels=1:2 keys_zone=nexus:100m inactive=30d max_size=2g use_temp_path=off;" ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/proxy-body-size: "0" nginx.ingress.kubernetes.io/proxy-buffering: "off" nginx.ingress.kubernetes.io/server-snippet: | proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header X-Forwarded-Proto $scheme; @@ -35,7 +42,7 @@ metadata: name: nexus-ingress-api annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/$1$is_args$args" spec: ingressClassName: nginx @@ -59,7 +66,7 @@ metadata: name: nexus-ingress-docker-push annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$2/$3/blobs/uploads/$is_args$args" spec: ingressClassName: nginx @@ -83,7 +90,7 @@ metadata: name: nexus-ingress-docker-login annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-login/$1/$2$is_args$args" spec: ingressClassName: nginx @@ -107,7 +114,7 @@ metadata: name: nexus-ingress-docker-search annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" spec: ingressClassName: nginx @@ -154,7 +161,7 @@ metadata: name: nexus-ingress-docker-pull-norepo annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = @fallback2; @@ -187,7 +194,7 @@ metadata: name: nexus-ingress-docker annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: "true" nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = @fallback; -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -156,7 +156,7 @@ metadata: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = @fallback2; proxy_intercept_errors on; recursive_error_pages on; @@ -189,7 +189,7 @@ metadata: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = @fallback; proxy_intercept_errors on; recursive_error_pages on; @@ -221,7 +221,7 @@ metadata: annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$3$is_args$args" nginx.ingress.kubernetes.io/configuration-snippet: | error_page 404 500 = @fallback2; proxy_intercept_errors on; recursive_error_pages on; -
AlexGluck revised this gist
Jun 8, 2022 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -162,7 +162,8 @@ metadata: recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_min_uses 3; proxy_cache_valid 404 15m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx @@ -194,7 +195,8 @@ metadata: recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_min_uses 3; proxy_cache_valid 404 15m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx @@ -225,7 +227,8 @@ metadata: recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_min_uses 3; proxy_cache_valid 404 15m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx -
AlexGluck created this gist
Jun 8, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,244 @@ --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress annotations: kubernetes.io/ingress.class: nginx nginx.org/client-max-body-size: "0" nginx.org/proxy-buffering: "off" nginx.org/http-snippets: | proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=nexus:100m inactive=30d max_size=2g; nginx.org/server-snippets: | proxy_http_version 1.1; proxy_set_header Connection ""; proxy_set_header X-Forwarded-Proto $scheme; spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: / pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-api annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/$1$is_args$args" spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/api/(.*)" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-push annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$2/$3/blobs/uploads/$is_args$args" spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: '/(v1|v2)/([-_0-9a-z\.]+)/(.*)/blobs/uploads/$' pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-login annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-login/$1/$2$is_args$args" spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/(v1|v2)/$" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-search annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/(v1|v2)/(_catalog|search)$" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback-latest annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: "/repository/docker-group/$1/$2$is_args$args" spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "@fallback2" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-pull-norepo annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/library/$1/library/library/$2/$3$is_args$args" nginx.org/location-snippets: | error_page 404 500 = @fallback2; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_valid 404 10m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/(v1|v2)/([-_0-9a-z\\.]+)/(blobs/sha256.*|manifests/.*)$" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/use-regex: true nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$2/$3$is_args$args" nginx.org/location-snippets: | error_page 404 500 = @fallback; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_valid 404 10m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "/(v1|v2)/([-_0-9a-z\\.]+)/(.*)$" pathType: Prefix backend: service: name: nexus port: name: nexus ... --- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: nexus-ingress-docker-registry-fallback annotations: kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/rewrite-target: "/repository/$2/$1/$3$is_args$args" nginx.org/location-snippets: | error_page 404 500 = @fallback2; proxy_intercept_errors on; recursive_error_pages on; proxy_cache nexus; proxy_cache_valid 500 10d; proxy_cache_valid 404 10m; proxy_cache_use_stale http_500; spec: ingressClassName: nginx rules: - host: nexus.example.org http: paths: - path: "@fallback" pathType: Prefix backend: service: name: nexus port: name: nexus ...