Skip to content

Commit

Permalink
Fixes #327: OCI Registry for use with path-based-routing (#313)
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Sanford <[email protected]>
  • Loading branch information
jessesanford authored Sep 16, 2024
1 parent 9bb8d89 commit 5c47cf7
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 6 deletions.
70 changes: 67 additions & 3 deletions hack/gitea/ingress.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,75 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path-oci-root
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
- host: {{ .IngressHost }}
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2
pathType: Prefix
- host: localhost
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path-oci-repo
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /v2/$2
spec:
ingressClassName: nginx
rules:
- host: {{ .IngressHost }}
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2/gitea(/|$)(.*)
pathType: ImplementationSpecific
- host: localhost
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2/gitea(/|$)(.*)
pathType: ImplementationSpecific
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
Expand Down Expand Up @@ -40,7 +104,7 @@ metadata:
name: my-gitea-custom
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
Expand All @@ -61,7 +125,7 @@ kind: Ingress
metadata:
name: my-gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
Expand Down
70 changes: 67 additions & 3 deletions pkg/controllers/localbuild/resources/gitea/k8s/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -601,11 +601,75 @@ spec:
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path-oci-root
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
- host: {{ .IngressHost }}
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2
pathType: Prefix
- host: localhost
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2
pathType: Prefix
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path-oci-repo
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /v2/$2
spec:
ingressClassName: nginx
rules:
- host: {{ .IngressHost }}
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2/gitea(/|$)(.*)
pathType: ImplementationSpecific
- host: localhost
http:
paths:
- backend:
service:
name: my-gitea-http
port:
number: 3000
path: /v2/gitea(/|$)(.*)
pathType: ImplementationSpecific
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-gitea-path
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$2
spec:
Expand Down Expand Up @@ -639,7 +703,7 @@ metadata:
name: my-gitea-custom
namespace: gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
Expand All @@ -660,7 +724,7 @@ kind: Ingress
metadata:
name: my-gitea
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 512m
nginx.ingress.kubernetes.io/proxy-body-size: 1024m
spec:
ingressClassName: nginx
rules:
Expand Down

0 comments on commit 5c47cf7

Please sign in to comment.