Skip to content

Commit

Permalink
Rydder opp i naiserator.yaml for redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
espenwaaga committed Sep 17, 2024
1 parent 3880f4e commit a633768
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 21 deletions.
6 changes: 4 additions & 2 deletions .deploy/engangsstonad/dev-gcp-teamforeldrepenger.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "engangsstonad",
"autentisering": true,
"ingressClassName": "nais-ingress",
"redirectFrom": "engangsstonad.intern.dev.nav.no",
"ingress": "https://www.intern.dev.nav.no/engangsstonad/soknad",
"redirect": {
"host": "engangsstonad.intern.dev.nav.no",
"ingressClassName": "nais-ingress"
},
"env": {
"PUBLIC_PATH": "/engangsstonad/soknad",
"INNSYN": "https://www.intern.dev.nav.no/foreldrepenger/oversikt",
Expand Down
6 changes: 4 additions & 2 deletions .deploy/engangsstonad/prod-gcp-teamforeldrepenger.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "engangsstonad",
"autentisering": true,
"ingressClassName": "nais-ingress-external",
"redirectFrom": "engangsstonad.nav.no",
"ingress": "https://www.nav.no/engangsstonad/soknad",
"redirect": {
"host": "engangsstonad.nav.no",
"ingressClassName": "nais-ingress-external"
},
"env": {
"PUBLIC_PATH": "/engangsstonad/soknad",
"INNSYN": "https://www.nav.no/foreldrepenger/oversikt",
Expand Down
6 changes: 4 additions & 2 deletions .deploy/foreldrepengeoversikt/dev-gcp-teamforeldrepenger.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "foreldrepengeoversikt",
"autentisering": true,
"ingressClassName": "nais-ingress",
"redirectFrom": "foreldrepenger.intern.dev.nav.no",
"ingress": "https://www.intern.dev.nav.no/foreldrepenger/oversikt",
"redirect": {
"host": "foreldrepenger.intern.dev.nav.no",
"ingressClassName": "nais-ingress"
},
"env": {
"ENV": "dev",
"PUBLIC_PATH": "/foreldrepenger/oversikt"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "foreldrepengeoversikt",
"autentisering": true,
"ingressClassName": "nais-ingress-external",
"redirectFrom": "foreldrepenger.nav.no",
"ingress": "https://www.nav.no/foreldrepenger/oversikt",
"redirect": {
"host": "foreldrepenger.nav.no",
"ingressClassName": "nais-ingress-external"
},
"env": {
"ENV": "prod",
"PUBLIC_PATH": "/foreldrepenger/oversikt"
Expand Down
6 changes: 4 additions & 2 deletions .deploy/foreldrepengesoknad/dev-gcp-teamforeldrepenger.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "foreldrepengesoknad",
"autentisering": true,
"ingressClassName": "nais-ingress",
"redirectFrom": "foreldrepengesoknad.intern.dev.nav.no",
"ingress": "https://www.intern.dev.nav.no/foreldrepenger/soknad",
"redirect": {
"host": "foreldrepengesoknad.intern.dev.nav.no",
"ingressClassName": "nais-ingress"
},
"env": {
"PUBLIC_PATH": "/foreldrepenger/soknad",
"INNSYN": "https://www.intern.dev.nav.no/foreldrepenger/oversikt",
Expand Down
6 changes: 4 additions & 2 deletions .deploy/foreldrepengesoknad/prod-gcp-teamforeldrepenger.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "foreldrepengesoknad",
"autentisering": true,
"ingressClassName": "nais-ingress-external",
"redirectFrom": "foreldrepengesoknad.nav.no",
"ingress": "https://www.nav.no/foreldrepenger/soknad",
"redirect": {
"host": "foreldrepengesoknad.nav.no",
"ingressClassName": "nais-ingress-external"
},
"env": {
"PUBLIC_PATH": "/foreldrepenger/soknad",
"INNSYN": "https://www.nav.no/foreldrepenger/oversikt",
Expand Down
10 changes: 5 additions & 5 deletions .deploy/naiserator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ spec:
- name: NODE_ENV
value: 'production'

{{#if redirectFrom}}
{{#with redirect}}
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{app}}-redirect
name: {{../app}}-redirect
namespace: teamforeldrepenger
labels:
team: teamforeldrepenger
annotations:
nginx.ingress.kubernetes.io/rewrite-target: {{ingress}}/$1
nginx.ingress.kubernetes.io/rewrite-target: {{../ingress}}/$1
spec:
ingressClassName: {{ingressClassName}}
rules:
- host: {{redirectFrom}}
- host: {{host}}
http:
paths:
- path: "/(.*)"
Expand All @@ -91,4 +91,4 @@ spec:
name: {{app}}
port:
number: 80
{{/if}}
{{/with}}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "svangerskapspengesoknad",
"autentisering": true,
"ingressClassName": "nais-ingress",
"redirectFrom": "svangerskapspengesoknad.intern.dev.nav.no",
"ingress": "https://www.intern.dev.nav.no/svangerskapspenger/soknad",
"redirect": {
"host": "svangerskapspengesoknad.intern.dev.nav.no",
"ingressClassName": "nais-ingress"
},
"env": {
"PUBLIC_PATH": "/svangerskapspenger/soknad",
"INNSYN": "https://www.intern.dev.nav.no/foreldrepenger/oversikt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"app": "svangerskapspengesoknad",
"autentisering": true,
"ingressClassName": "nais-ingress-external",
"redirectFrom": "svangerskapspengesoknad.nav.no",
"ingress": "https://www.nav.no/svangerskapspenger/soknad",
"redirect": {
"host": "svangerskapspengesoknad.nav.no",
"ingressClassName": "nais-ingress-external"
},
"env": {
"PUBLIC_PATH": "/svangerskapspenger/soknad",
"INNSYN": "https://www.nav.no/foreldrepenger/oversikt",
Expand Down

0 comments on commit a633768

Please sign in to comment.