Skip to content

Commit

Permalink
Adding cors config to ingress definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bergsalex committed Sep 3, 2024
1 parent aecc848 commit f619d79
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 1 deletion.
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
5 changes: 5 additions & 0 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 Down
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 f619d79

Please sign in to comment.