Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gcp migrering #5631

Draft
wants to merge 67 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a42ff1f
teste gcp deploy
vebnor Mar 1, 2024
030c4db
autoformattering ødela yaml
vebnor Mar 1, 2024
c76ed5c
GITHUB_ENV, ikke GITHUB_OUTPUT
vebnor Mar 1, 2024
c2470c3
bruke en ingress som ikke er deprecated :D
vebnor Mar 1, 2024
2c546cc
legger inn upstream hosts som kan nås fra gcp
vebnor Mar 1, 2024
a9cf021
prøve å redeploye
vebnor Mar 1, 2024
a1582c1
¯\_(ツ)_/¯
vebnor Mar 1, 2024
7004ecf
problem med nginx reverse proxy og SSL
vebnor Mar 1, 2024
35e99bc
prøve igjen
vebnor Mar 1, 2024
5b02e7f
Access policy outbound :-)
vebnor Mar 1, 2024
1523e1c
rydde
vebnor Mar 1, 2024
4964327
prøver å fjerne error page og ser hva vi får
vebnor Mar 1, 2024
e446039
test
vebnor Mar 1, 2024
23e3da2
rydde
vebnor Mar 1, 2024
4ecc669
boop
vebnor Mar 1, 2024
910c5ca
access policy
vebnor Mar 4, 2024
b6667f7
proxy ssl server name
vebnor Mar 4, 2024
88706a2
fjerne access policy igjen
vebnor Mar 4, 2024
3ff0f39
access policy
vebnor Mar 4, 2024
aec9c55
test
vebnor Mar 4, 2024
422e6ee
debug
vebnor Mar 4, 2024
b2e8f07
prøve å logge upstream address
vebnor Mar 4, 2024
f032e30
debug
vebnor Mar 4, 2024
eb953fa
debug
vebnor Mar 4, 2024
ab22daa
debug
vebnor Mar 4, 2024
8d03e6b
debug
vebnor Mar 4, 2024
9139253
debug
vebnor Mar 4, 2024
fd0b477
debug
vebnor Mar 4, 2024
07c007f
debug
vebnor Mar 4, 2024
0a95040
debug
vebnor Mar 4, 2024
83bb122
debug
vebnor Mar 4, 2024
9431dfc
debug
vebnor Mar 4, 2024
f972555
debug
vebnor Mar 4, 2024
256cece
debug
vebnor Mar 4, 2024
6473bd2
.
vebnor Mar 4, 2024
bbbc17a
Merge branch 'master' into GCP-migrering
vebnor Mar 4, 2024
31d51db
debug
vebnor Mar 4, 2024
a385506
Merge branch 'GCP-migrering' of https://github.com/navikt/k9-sak-web …
vebnor Mar 4, 2024
b99cae5
csp
vebnor Mar 4, 2024
f0e4e8e
debug
vebnor Mar 4, 2024
28097f4
debug
vebnor Mar 4, 2024
1c3b0b4
debug
vebnor Mar 4, 2024
d8ecc84
debug
vebnor Mar 4, 2024
04365f9
debug
vebnor Mar 4, 2024
2ac8d2a
debug
vebnor Mar 4, 2024
ffdb742
debug
vebnor Mar 4, 2024
3fea2c2
debug
vebnor Mar 4, 2024
37b6565
debug
vebnor Mar 4, 2024
d0e9f5b
fjerner :latest tag
vebnor Mar 4, 2024
bf7e4de
headers
vebnor Mar 4, 2024
8f41acf
stdout
vebnor Mar 4, 2024
ec7ee5d
stdout
vebnor Mar 4, 2024
f360868
trigge deploy
vebnor Mar 4, 2024
8b2db72
Fjerner host header da vi får 404 når den settes
vebnor Mar 4, 2024
bc88467
fjerner debug-logging
vebnor Mar 4, 2024
dc16094
teste å inkludere host
vebnor Mar 5, 2024
4913ad1
test
vebnor Mar 5, 2024
60d8da3
test
vebnor Mar 5, 2024
4a4ea0d
ugh
vebnor Mar 5, 2024
b00018a
test
vebnor Mar 5, 2024
ccc1fc4
location
vebnor Mar 5, 2024
9b0247d
test
vebnor Mar 5, 2024
be48f5c
gå tilbake til hvordan det var
vebnor Mar 5, 2024
f72e3b3
debug
vebnor Mar 8, 2024
182d8f4
proxy host
vebnor Mar 8, 2024
7795b2f
debug
vebnor Mar 8, 2024
e0ff844
navn på workflow så man kan skille de
vebnor Apr 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/deploy-docker-image-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy Docker image GCP
on:
push:
branches:
- GCP-migrering

jobs:
deploy-docker-image:
name: Deploy Docker image
runs-on: ubuntu-latest
permissions:
issues: write
contents: read
id-token: write
outputs:
image: ${{ steps.docker-push.outputs.image }}
steps:
- name: Hente kode
uses: actions/checkout@v4

- name: Setup .yarnrc.yml
run: |
yarn config set npmScopes.navikt.npmRegistryServer "https://npm.pkg.github.com"
yarn config set npmScopes.navikt.npmAlwaysAuth true
yarn config set npmScopes.navikt.npmAuthToken $NPM_AUTH_TOKEN
env:
NPM_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}

- name: Sette opp Node
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'

- name: Set timestamp
run: echo "TIMESTAMP=$(expr $(date +%Y%m%d%H%M%S))" >> $GITHUB_ENV

- name: Installere dependencies
run: HUSKY=0 yarn install --immutable

- name: Bygge dist
run: yarn build

- uses: nais/docker-build-push@v0
id: docker-push
with:
team: k9saksbehandling
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}

- name: Sett image for nais deploy
run: |
echo "IMAGE=${{steps.docker-push.outputs.image}}" >> $GITHUB_ENV

- name: Promoter til cluster og namespace
uses: nais/deploy/actions/deploy@v2
env:
PRINT_PAYLOAD: true
CLUSTER: dev-gcp
RESOURCE: deploy/dev-gcp.yml

trivy:
needs: [deploy-docker-image]
uses: navikt/sif-gha-workflows/.github/workflows/trivy.yml@main
permissions:
contents: write
id-token: write
security-events: write
actions: read
secrets: inherit
with:
image: ${{ needs.deploy-docker-image.outputs.image }}
team: k9saksbehandling
1 change: 1 addition & 0 deletions .github/workflows/deploy-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
team: k9saksbehandling
project_id: ${{ vars.NAIS_MANAGEMENT_PROJECT_ID }}
identity_provider: ${{ secrets.NAIS_WORKLOAD_IDENTITY_PROVIDER }}

- name: Sett image for nais deploy
run: |
echo "IMAGE=${{steps.docker-push.outputs.image}}" >> $GITHUB_OUTPUT
Expand Down
104 changes: 104 additions & 0 deletions deploy/dev-gcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: k9-sak-web
namespace: k9saksbehandling
labels:
team: k9saksbehandling
annotations:
nais.io/run-as-user: "101" # Fix permissions for nginx
nais.io/read-only-file-system: "false" # Fix permissions for nginx
nginx.ingress.kubernetes.io/proxy-buffer-size: "32k"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
spec:
image: {{ image }}
port: 9000
liveness:
path: /isAlive
initialDelay: 20
timeout: 1
periodSeconds: 5
failureThreshold: 10
readiness:
path: /isReady
initialDelay: 20
timeout: 1
replicas:
min: 2
max: 3
cpuThresholdPercentage: 50
resources:
limits:
cpu: 500m
memory: 64Mi
requests:
cpu: 200m
memory: 32Mi
ingresses:
- "https://k9.intern.dev.nav.no"
accessPolicy:
outbound:
external:
- host: "k9-sak.dev-fss-pub.nais.io"
env:
- name: APP_NAME
value: k9-sak-web
- name: APP_URL
value: "https://k9-sak.dev-fss-pub.nais.io"
- name: APP_PORT
value: "9000"
- name: APP_URL_K9FORMIDLING
value: "https://k9-formidling.dev-fss-pub.nais.io"
- name: APP_URL_K9FORMIDLING_DD
value: "https://k9-formidling-dokumentdata.dev-fss-pub.nais.io"
- name: APP_URL_K9OPPDRAG
value: "https://k9-oppdrag.dev-fss-pub.nais.io"
- name: APP_URL_KLAGE
value: "https://k9-klage.dev-fss-pub.nais.io"
- name: APP_URL_K9TILBAKE
value: "https://k9-tilbake.dev-fss-pub.nais.io"
- name: APP_URL_K9FORDEL
value: "https://k9-fordel.dev-fss-pub.nais.io"
- name: ENDRINGSLOGG_URL
value: "https://familie-endringslogg.intern.dev.nav.no/"

# Feature-flag
- name: KLAGE_KABAL
value: "true"
- name: VARSELTEKST
value: "true"
- name: DOKUMENTDATA
value: "true"
- name: UNNTAKSBEHANDLING
value: "true"
- name: KLAGEBEHANDLING
value: "true"
- name: TILBAKE
value: "true"
- name: SOKNADPERIODESTRIPE
value: "false"
- name: TYPE_MEDISINSKE_OPPLYSNINGER_BREV
value: "true"
- name: LOS_MARKER_BEHANDLING
value: "true"
- name: LOS_MARKER_BEHANDLING_SUBMIT
value: "true"
- name: AKSJONSPUNKT_9014
value: "true"
- name: AKSJONSPUNKT_9015
value: "true"
- name: FRITEKST_REDIGERING
value: "true"
- name: INKLUDER_KALENDER_PILS
value: "true"
- name: SKJUL_AVSLUTTET_ARBEIDSGIVER
value: "true"
- name: OMS_PUNSJSTRIPE
value: "true"
- name: OMSORGEN_FOR_PERIODISERT
value: "true"
- name: OVERSTYR_BEREGNING
value: "true"
- name: "OVERSTYRING_UTTAK"
value: "true"
100 changes: 100 additions & 0 deletions deploy/prod-fss-k9saksbehandling copy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: k9-sak-web
namespace: k9saksbehandling
labels:
team: k9saksbehandling
annotations:
nais.io/run-as-user: "101" # Fix permissions for nginx
nais.io/read-only-file-system: "false" # Fix permissions for nginx
nginx.ingress.kubernetes.io/proxy-buffer-size: "32k"
nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "600"
spec:
image: {{ image }}
port: 9000
liveness:
path: /isAlive
initialDelay: 20
timeout: 1
periodSeconds: 5
failureThreshold: 10
readiness:
path: /isReady
initialDelay: 20
timeout: 1
replicas:
min: 2
max: 3
cpuThresholdPercentage: 50
resources:
limits:
cpu: 500m
memory: 64Mi
requests:
cpu: 200m
memory: 32Mi
ingresses:
- "https://k9.intern.nav.no/"
env:
- name: APP_NAME
value: k9-sak-web
- name: APP_URL
value: "http://k9-sak"
- name: APP_PORT
value: "9000"
- name: APP_URL_K9FORMIDLING
value: "http://k9-formidling"
- name: APP_URL_K9FORMIDLING_DD
value: "http://k9-formidling-dokumentdata.k9saksbehandling"
- name: APP_URL_K9OPPDRAG
value: "http://k9-oppdrag.k9saksbehandling"
- name: APP_URL_KLAGE
value: "http://k9-klage.k9saksbehandling"
- name: APP_URL_K9TILBAKE
value: "http://k9-tilbake.k9saksbehandling"
- name: APP_URL_K9FORDEL
value: "http://k9-fordel.k9saksbehandling"
- name: ENDRINGSLOGG_URL
value: "https://familie-endringslogg.intern.nav.no/"

# Feature-flag
- name: KLAGE_KABAL
value: "true"
- name: VARSELTEKST
value: "false"
- name: DOKUMENTDATA
value: "false"
- name: UNNTAKSBEHANDLING
value: "false"
- name: KLAGEBEHANDLING
value: "true"
- name: TILBAKE
value: "true"
- name: SOKNADPERIODESTRIPE
value: "false"
- name: TYPE_MEDISINSKE_OPPLYSNINGER_BREV
value: "true"
- name: LOS_MARKER_BEHANDLING
value: "true"
- name: LOS_MARKER_BEHANDLING_SUBMIT
value: "false"
- name: AKSJONSPUNKT_9014
value: "true"
- name: AKSJONSPUNKT_9015
value: "true"
- name: FRITEKST_REDIGERING
value: "true"
- name: INKLUDER_KALENDER_PILS
value: "false"
- name: SKJUL_AVSLUTTET_ARBEIDSGIVER
value: "false"
- name: OMS_PUNSJSTRIPE
value: "true"
- name: OMSORGEN_FOR_PERIODISERT
value: "true"
- name: OVERSTYR_BEREGNING
value: "false"
- name: "OVERSTYRING_UTTAK"
value: "false"
3 changes: 2 additions & 1 deletion packages/rest-api/src/requestApi/RequestRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ class RequestRunner {
if (popupWindow === null) {
const location = `${response.headers.location}`;
const queryParamAddition = location.includes('?') ? '&' : '?';
const redirectLocation = `${location}${queryParamAddition}redirectTo=/k9/web/close`;
const redirectLocation = `${location}${queryParamAddition}redirectTo=/k9/web/close`
console.log('redirectLocation', redirectLocation);
popupWindow = window.open(redirectLocation, undefined, 'height=600,width=800');
}
const timer = setInterval(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/sak-app/src/app/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const Home = ({ headerHeight }: OwnProps) => (
<Route path="/" element={<DashboardResolver />} />
<Route path={fagsakRoutePath} element={<FagsakIndex />} />
<Route path={aktoerRoutePath} element={<AktoerIndex />} />
<Route path="/close" element={<CloseWindow />} />
{/* <Route path="/close" element={<CloseWindow />} /> */}
<Route path="*" element={<NotFoundPage />} />
</Routes>
</div>
Expand Down
1 change: 0 additions & 1 deletion proxy.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ server {
proxy_intercept_errors on;
error_page 401 = @401_json;
error_page 403 = @403_json;
error_page 404 = @404_json;
error_page 504 = @504_json;
}

Expand Down
2 changes: 1 addition & 1 deletion start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export APP_PORT="${APP_PORT:-443}"
export APP_NAME="${APP_NAME:-devimg}"
export APP_VERSION="${APP_VERSION:-localhost}"

envsubst '$APP_URL $APP_PORT $APP_HOSTNAME $APP_NAME $APP_VERSION $APP_PATH_PREFIX $APP_URL_K9FORMIDLING $APP_URL_K9FORMIDLING_DD $APP_URL_K9OPPDRAG $APP_URL_KLAGE $APP_URL_K9TILBAKE $APP_URL_K9FORDEL $ENDRINGSLOGG_URL' < /etc/nginx/conf.d/app.conf.template > /etc/nginx/conf.d/default.conf
envsubst '$APP_URL $APP_PORT $APP_HOSTNAME $APP_NAME $APP_VERSION $APP_URL_K9FORMIDLING $APP_URL_K9FORMIDLING_DD $APP_URL_K9OPPDRAG $APP_URL_KLAGE $APP_URL_K9TILBAKE $APP_URL_K9FORDEL $ENDRINGSLOGG_URL' < /etc/nginx/conf.d/app.conf.template > /etc/nginx/conf.d/default.conf

echo "### Nginx conf ###"
cat /etc/nginx/conf.d/default.conf
Expand Down
Loading