Skip to content

Commit

Permalink
Merge pull request #94 from TheJacksonLaboratory/G3-406-add-cors-conf…
Browse files Browse the repository at this point in the history
…iguration-to-gene-expression-and-geneweaver-ingress-resources

G3-406: Adding CORS config to ingress definitions
  • Loading branch information
bergsalex authored Sep 3, 2024
2 parents aecc848 + fe18b65 commit 10dfdc6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
9 changes: 9 additions & 0 deletions deploy/k8s/overlays/jax-cluster-dev-10--dev/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ metadata:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/auth-url: "http://oauth2-proxy.oauth2-proxy.svc.cluster.local/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://auth.jax-cluster-dev-10.jax.org/oauth2/start?rd=https://$http_host$escaped_request_uri"
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://*.jax.org, http://localhost:4200, http://localhost:8080"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/auth-snippet: |
if ($request_method = "OPTIONS") {
return 202;
}
spec:
ingressClassName: nginx
tls:
Expand Down
9 changes: 9 additions & 0 deletions deploy/k8s/overlays/jax-cluster-dev-10--sqa/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ metadata:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/auth-url: "http://oauth2-proxy.oauth2-proxy.svc.cluster.local/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://auth.jax-cluster-dev-10.jax.org/oauth2/start?rd=https://$http_host$escaped_request_uri"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://*.jax.org"
nginx.ingress.kubernetes.io/auth-snippet: |
if ($request_method = "OPTIONS") {
return 202;
}
spec:
ingressClassName: nginx
tls:
Expand Down
11 changes: 8 additions & 3 deletions deploy/k8s/overlays/jax-cluster-prod-10--prod/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ metadata:
# so that you don't hit the rate limit for the production issuer.
# cert-manager.io/cluster-issuer: "letsencrypt-staging"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://*.jax.org"
spec:
ingressClassName: nginx
tls:
Expand All @@ -25,7 +30,7 @@ spec:
path: "/api"
backend:
service:
name: geneweaver-legacy
name: geneweaver-api
port:
number: 8000
- host: "geneweaver.jax.org"
Expand Down Expand Up @@ -55,7 +60,7 @@ spec:
path: "/api"
backend:
service:
name: geneweaver-legacy
name: geneweaver-api
port:
number: 8000
- host: "classic.geneweaver.org"
Expand All @@ -65,6 +70,6 @@ spec:
path: "/api"
backend:
service:
name: geneweaver-legacy
name: geneweaver-api
port:
number: 800
9 changes: 9 additions & 0 deletions deploy/k8s/overlays/jax-cluster-prod-10--stage/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ metadata:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/auth-url: "http://oauth2-proxy.oauth2-proxy.svc.cluster.local/oauth2/auth"
nginx.ingress.kubernetes.io/auth-signin: "https://auth.jax-cluster-prod-10.jax.org/oauth2/start?rd=https://$http_host$escaped_request_uri"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-credentials: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT"
nginx.ingress.kubernetes.io/cors-allow-headers: "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization"
nginx.ingress.kubernetes.io/cors-allow-origin: "https://*.jax.org"
nginx.ingress.kubernetes.io/auth-snippet: |
if ($request_method = "OPTIONS") {
return 202;
}
spec:
ingressClassName: nginx
tls:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "geneweaver-api"
version = "0.8.0"
version = "0.8.1a0"
description = "The Geneweaver API"
authors = [
"Alexander Berger <[email protected]>",
Expand Down

0 comments on commit 10dfdc6

Please sign in to comment.