Skip to content

Commit 7e91c73

Browse files
authored
Merge pull request #95 from navikt/feature/flytte_til_gcp
[KAIZEN-0] flytte til gcp
2 parents 0a784ad + 3b5f91d commit 7e91c73

File tree

15 files changed

+223
-134
lines changed

15 files changed

+223
-134
lines changed

.github/workflows/main.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,23 @@ jobs:
7474
RESOURCE: .nais/preprod.yml
7575
VAR: image=${{ needs.build-and-push.outputs.image }}
7676

77+
deploy-dev-gcp:
78+
name: Deploy to dev-gcp
79+
needs: build-and-push
80+
if: github.ref == 'refs/heads/dev'
81+
runs-on: ubuntu-latest
82+
permissions:
83+
contents: read
84+
id-token: write
85+
steps:
86+
- uses: actions/checkout@v4
87+
- uses: nais/deploy/actions/deploy@v2
88+
env:
89+
PRINT_PAYLOAD: true
90+
CLUSTER: dev-gcp
91+
RESOURCE: .nais/dev.yml
92+
VAR: image=${{ needs.build-and-push.outputs.image }}
93+
7794
deploy-prod:
7895
name: Deploy to prod
7996
needs: build-and-push

.nais/dev.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
apiVersion: "nais.io/v1alpha1"
2+
kind: "Application"
3+
metadata:
4+
name: modia-robot-api
5+
namespace: personoversikt
6+
labels:
7+
team: personoversikt
8+
spec:
9+
image: {{image}}
10+
port: 7070
11+
liveness:
12+
path: /internal/isAlive
13+
initialDelay: 20
14+
timeout: 1
15+
periodSeconds: 5
16+
failureThreshold: 10
17+
readiness:
18+
path: /internal/isReady
19+
initialDelay: 20
20+
timeout: 1
21+
prometheus:
22+
enabled: true
23+
path: /internal/metrics
24+
secureLogs:
25+
enabled: true
26+
resources:
27+
requests:
28+
cpu: 50m
29+
memory: 256Mi
30+
limits:
31+
cpu: 2000m
32+
memory: 512Mi
33+
ingresses:
34+
- https://modia-robot-api.intern.dev.nav.no
35+
replicas:
36+
min: 1
37+
max: 1
38+
cpuThresholdPercentage: 90
39+
azure:
40+
application:
41+
enabled: true
42+
tenant: trygdeetaten.no
43+
allowAllUsers: true
44+
claims:
45+
extra:
46+
- "NAVident"
47+
accessPolicy:
48+
outbound:
49+
external:
50+
- host: veilarboppfolging.dev-fss-pub.nais.io
51+
- host: nom-api.intern.dev.nav.no
52+
- host: pdl-api.dev-fss-pub.nais.io
53+
- host: saf-q1.dev-fss-pub.nais.io
54+
- host: digdir-krr-proxy.intern.dev.nav.no
55+
- host: sokos-utbetaldata.dev-fss-pub.nais.io
56+
- host: sf-henvendelse-api-proxy.dev-fss-pub.nais.io
57+
- host: sokos-kontoregister-person.intern.dev.nav.no
58+
inbound:
59+
rules:
60+
- application: rpa-medlemskap-og-avgift
61+
namespace: team-rpa
62+
cluster: dev-fss
63+
- application: ida
64+
cluster: prod-fss
65+
namespace: traktor
66+
- application: rpa-nav-okonomi-stonad
67+
cluster: dev-fss
68+
namespace: team-rpa-nos
69+
env:
70+
- name: IDENT_ALLOW_LIST
71+
value: "R154727,R156418,R158345,R158346,R160569,R165950,R165951,R165952,R150818,R150819,R155645,R162552,Z994123,Z990351,Z992779,Z990949,Z990467,Z991629,Z990237,Z994673,Z994818,Z990715,Z990715"
72+
- name: OPPFOLGING_URL
73+
value: "https://veilarboppfolging.dev-fss-pub.nais.io/veilarboppfolging/api"
74+
- name: OPPFOLGING_SCOPE
75+
value: "dev-fss:pto:veilarboppfolging"
76+
- name: NOM_URL
77+
value: "https://nom-api.intern.dev.nav.no"
78+
- name: NOM_SCOPE
79+
value: "dev-gcp:nom:nom-api"
80+
- name: PDL_URL
81+
value: "https://pdl-api.dev-fss-pub.nais.io/graphql"
82+
- name: PDL_SCOPE
83+
value: "dev-fss:pdl:pdl-api"
84+
- name: SAF_URL
85+
value: "https://saf-q1.dev-fss-pub.nais.io/graphql"
86+
- name: SAF_SCOPE
87+
value: "dev-fss:teamdokumenthandtering:saf"
88+
- name: SKRIVESTOTTE_URL
89+
value: "https://modiapersonoversikt-skrivestotte.intern.dev.nav.no"
90+
- name: DIGDIR_KRR_URL
91+
value: "https://digdir-krr-proxy.intern.dev.nav.no/"
92+
- name: DIGDIR_KRR_SCOPE
93+
value: "dev-gcp:team-rocket:digdir-krr-proxy"
94+
- name: UTBETALDATA_SOKOS_URL
95+
value: "https://sokos-utbetaldata.dev-fss-pub.nais.io/utbetaldata/api"
96+
- name: UTBETAL_SOKOS_SCOPE
97+
value: "dev-fss:okonomi:sokos-utbetaldata"
98+
- name: SF_HENVENDELSE_URL
99+
value: "https://sf-henvendelse-api-proxy.dev-fss-pub.nais.io/api"
100+
- name: SF_HENVENDELSE_SCOPE
101+
value: "dev-fss:teamnks:sf-henvendelse-api-proxy"
102+
- name: KONTOREGISTER_REST_URL
103+
value: "https://sokos-kontoregister-person.intern.dev.nav.no/api/system"
104+
- name: KONTOREGISTER_SCOPE
105+
value: "dev-gcp:okonomi:sokos-kontoregister-person"
106+
- name: CXF_SECURE_LOG
107+
value: "enabled"

.nais/preprod.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,10 @@ spec:
7171
env:
7272
- name: IDENT_ALLOW_LIST
7373
value: "R154727,R156418,R158345,R158346,R160569,R165950,R165951,R165952,R150818,R150819,R155645,R162552,Z994123,Z990351,Z992779,Z990949,Z990467,Z991629,Z990237,Z994673,Z994818,Z990715,Z990715"
74-
- name: SECURITYTOKENSERVICE_URL
75-
value: "https://sts-q1.preprod.local/SecurityTokenServiceProvider/"
7674
- name: OPPFOLGING_URL
7775
value: "https://veilarboppfolging.dev.intern.nav.no/veilarboppfolging/api"
7876
- name: OPPFOLGING_SCOPE
7977
value: "dev-fss:pto:veilarboppfolging"
80-
- name: TPS_PERSONV3_URL
81-
value: "https://app-q1.adeo.no/tpsws-aura/ws/Person/v3"
8278
- name: NOM_URL
8379
value: "https://nom-api.intern.dev.nav.no"
8480
- name: NOM_SCOPE
@@ -105,5 +101,9 @@ spec:
105101
value: "https://sf-henvendelse.dev.intern.nav.no/api"
106102
- name: SF_HENVENDELSE_SCOPE
107103
value: "dev-fss:teamcrm:sf-henvendelse"
104+
- name: KONTOREGISTER_REST_URL
105+
value: "https://sokos-kontoregister-person.intern.dev.nav.no/api/system"
106+
- name: KONTOREGISTER_SCOPE
107+
value: "dev-gcp:okonomi:sokos-kontoregister-person"
108108
- name: CXF_SECURE_LOG
109109
value: "enabled"

.nais/prod.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,10 @@ spec:
5959
env:
6060
- name: IDENT_ALLOW_LIST
6161
value: "R154727,R156418,R158345,R158346,R160569,R165950,R165951,R165952,R150818,R150819,R155645,R162552,D159483,U143410"
62-
- name: SECURITYTOKENSERVICE_URL
63-
value: "https://sts.adeo.no/SecurityTokenServiceProvider/"
6462
- name: OPPFOLGING_URL
6563
value: "https://veilarboppfolging.intern.nav.no/veilarboppfolging/api"
6664
- name: OPPFOLGING_SCOPE
6765
value: "prod-fss:pto:veilarboppfolging"
68-
- name: TPS_PERSONV3_URL
69-
value: "https://app.adeo.no/tpsws-aura/ws/Person/v3"
7066
- name: NOM_URL
7167
value: "https://nom-api.intern.nav.no"
7268
- name: NOM_SCOPE
@@ -93,5 +89,9 @@ spec:
9389
value: "https://sf-henvendelse.intern.nav.no/api"
9490
- name: SF_HENVENDELSE_SCOPE
9591
value: "prod-fss:teamcrm:sf-henvendelse"
92+
- name: KONTOREGISTER_REST_URL
93+
value: "https://sokos-kontoregister-person.intern.nav.no/api/system"
94+
- name: KONTOREGISTER_SCOPE
95+
value: "prod-gcp:okonomi:sokos-kontoregister-person"
9696
- name: CXF_SECURE_LOG
9797
value: "enabled"

src/main/kotlin/no/nav/Application.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import io.ktor.server.routing.*
77
import no.nav.api.debug.configureDebugRoutes
88
import no.nav.api.dialog.configureDialogRoutes
99
import no.nav.api.digdir.configureDigdirRoutes
10+
import no.nav.api.kontonummer.configureKontonummerRegisterRoutes
1011
import no.nav.api.oppfolging.configureOppfolgingRoutes
1112
import no.nav.api.pdl.configurePdlRoutes
1213
import no.nav.api.skrivestotte.configureSkrivestotteRoutes
13-
import no.nav.api.tps.configureTpsRoutes
1414
import no.nav.api.utbetalinger.configureUtbetalingerRoutes
1515
import no.nav.plugins.*
1616

@@ -34,7 +34,7 @@ fun startApplication(
3434
configureDebugRoutes(consumers.tokenclient)
3535
configureOppfolgingRoutes(services.oppfolgingService)
3636
configurePdlRoutes(services.pdlService)
37-
configureTpsRoutes(services.tpsService)
37+
configureKontonummerRegisterRoutes(consumers.kontonummerRegister)
3838
configureDialogRoutes(services.dialogService)
3939
configureDigdirRoutes(services.digdirService)
4040
configureSkrivestotteRoutes(services.skrivestotteService)

src/main/kotlin/no/nav/Consumers.kt

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,33 @@ package no.nav
33
import no.nav.api.dialog.saf.SafClient
44
import no.nav.api.dialog.sf.SFClient
55
import no.nav.api.digdir.DigdirClient
6+
import no.nav.api.kontonummer.KontonummerRegister
67
import no.nav.api.oppfolging.Nom
78
import no.nav.api.oppfolging.OppfolgingClient
89
import no.nav.api.pdl.PdlClient
910
import no.nav.api.skrivestotte.SkrivestotteClient
1011
import no.nav.api.utbetalinger.UtbetalingerClient
1112
import no.nav.common.client.nom.NomClient
12-
import no.nav.common.cxf.StsConfig
1313
import no.nav.common.token_client.builder.AzureAdTokenClientBuilder
1414
import no.nav.common.token_client.client.MachineToMachineTokenClient
1515
import no.nav.common.token_client.client.OnBehalfOfTokenClient
16-
import no.nav.common.utils.NaisUtils
17-
import no.nav.tjeneste.virksomhet.person.v3.binding.PersonV3
18-
import no.nav.utils.CXFClient
1916
import no.nav.utils.bindTo
2017

2118
interface Consumers {
2219
val tokenclient: MachineToMachineTokenClient
2320
val oboTokenClient: OnBehalfOfTokenClient
2421
val oppfolgingClient: OppfolgingClient
25-
val tps: PersonV3
2622
val nom: NomClient
2723
val skrivestotteClient: SkrivestotteClient
2824
val pdlClient: PdlClient
2925
val safClient: SafClient
3026
val digdirClient: DigdirClient
27+
val kontonummerRegister: KontonummerRegister
3128
val utbetalingerClient: UtbetalingerClient
3229
val sfClient: SFClient
3330
}
3431

3532
class ConsumersImpl(env: Env) : Consumers {
36-
private val modiaUser = NaisUtils.getCredentials("service_user")
37-
private val stsConfig: StsConfig =
38-
StsConfig
39-
.builder()
40-
.url(env.soapStsUrl)
41-
.username(modiaUser.username)
42-
.password(modiaUser.password)
43-
.build()
44-
4533
override val oboTokenClient: OnBehalfOfTokenClient =
4634
AzureAdTokenClientBuilder
4735
.builder()
@@ -55,17 +43,14 @@ class ConsumersImpl(env: Env) : Consumers {
5543
.buildMachineToMachineTokenClient()
5644

5745
override val oppfolgingClient: OppfolgingClient = OppfolgingClient(env.oppfolgingUrl, oboTokenClient.bindTo(env.oppfolgingScope))
58-
override val tps: PersonV3 =
59-
CXFClient<PersonV3>()
60-
.address(env.tpsPersonV3Url)
61-
.configureStsForSystemUser(stsConfig)
62-
.build()
6346
override val nom: NomClient = Nom(env.nomUrl, tokenclient.bindTo(env.nomScope)).client
6447
override val skrivestotteClient: SkrivestotteClient = SkrivestotteClient(env.skrivestotteUrl)
6548
override val pdlClient: PdlClient = PdlClient(env.pdlUrl, oboTokenClient.bindTo(env.pdlScope))
6649
override val safClient: SafClient = SafClient(env.safUrl, oboTokenClient.bindTo(env.safScope))
6750
override val digdirClient: DigdirClient =
6851
DigdirClient(env.digdirUrl, tokenclient.bindTo(env.digdirScope), oboTokenClient.bindTo(env.digdirScope))
52+
override val kontonummerRegister: KontonummerRegister =
53+
KontonummerRegister(env.kontonummerRegisterUrl, oboTokenClient.bindTo(env.kontonummerRegisterScope))
6954
override val utbetalingerClient: UtbetalingerClient =
7055
UtbetalingerClient(env.utbetalingSokosUrl, oboTokenClient.bindTo(env.utbetalingSokosScope))
7156
override val sfClient: SFClient = SFClient(env.sfUrl, oboTokenClient.bindTo(env.sfScope))

src/main/kotlin/no/nav/Env.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ interface Env {
99
operator fun invoke(): Env = EnvImpl()
1010
}
1111

12-
val soapStsUrl: String
1312
val jwksUrl: String
14-
val tpsPersonV3Url: String
1513
val oppfolgingUrl: String
1614
val oppfolgingScope: DownstreamApi
1715
val nomUrl: String
@@ -20,6 +18,8 @@ interface Env {
2018
val pdlScope: DownstreamApi
2119
val digdirUrl: String
2220
val digdirScope: DownstreamApi
21+
val kontonummerRegisterUrl: String
22+
val kontonummerRegisterScope: DownstreamApi
2323
val utbetalingSokosUrl: String
2424
val utbetalingSokosScope: DownstreamApi
2525
val safUrl: String
@@ -31,9 +31,7 @@ interface Env {
3131
}
3232

3333
class EnvImpl : Env {
34-
override val soapStsUrl: String = getRequiredConfig("SECURITYTOKENSERVICE_URL")
3534
override val jwksUrl: String = getRequiredConfig("AZURE_OPENID_CONFIG_JWKS_URI")
36-
override val tpsPersonV3Url: String = getRequiredConfig("TPS_PERSONV3_URL")
3735
override val oppfolgingUrl: String = getRequiredConfig("OPPFOLGING_URL")
3836
override val oppfolgingScope: DownstreamApi = getRequiredConfig("OPPFOLGING_SCOPE").toDownstreamApi()
3937
override val nomUrl: String = getRequiredConfig("NOM_URL")
@@ -42,6 +40,8 @@ class EnvImpl : Env {
4240
override val pdlScope: DownstreamApi = getRequiredConfig("PDL_SCOPE").toDownstreamApi()
4341
override val digdirUrl: String = getRequiredConfig("DIGDIR_KRR_URL")
4442
override val digdirScope: DownstreamApi = getRequiredConfig("DIGDIR_KRR_SCOPE").toDownstreamApi()
43+
override val kontonummerRegisterUrl: String = getRequiredConfig("KONTOREGISTER_REST_URL")
44+
override val kontonummerRegisterScope: DownstreamApi = getRequiredConfig("KONTOREGISTER_SCOPE").toDownstreamApi()
4545
override val utbetalingSokosUrl: String = getRequiredConfig("UTBETALDATA_SOKOS_URL")
4646
override val utbetalingSokosScope: DownstreamApi = getRequiredConfig("UTBETAL_SOKOS_SCOPE").toDownstreamApi()
4747
override val safUrl: String = getRequiredConfig("SAF_URL")

src/main/kotlin/no/nav/Services.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ import no.nav.api.digdir.DigdirService
77
import no.nav.api.oppfolging.OppfolgingService
88
import no.nav.api.pdl.PdlService
99
import no.nav.api.skrivestotte.SkrivestotteService
10-
import no.nav.api.tps.TpsService
1110
import no.nav.api.utbetalinger.UtbetalingerService
1211

1312
interface Services {
1413
val oppfolgingService: OppfolgingService
15-
val tpsService: TpsService
1614
val skrivestotteService: SkrivestotteService
1715
val digdirService: DigdirService
1816
val pdlService: PdlService
@@ -28,7 +26,6 @@ class ServicesImpl(consumers: Consumers) : Services {
2826
consumers.oppfolgingClient,
2927
consumers.nom,
3028
)
31-
override val tpsService = TpsService(consumers.tps)
3229
override val skrivestotteService = SkrivestotteService(consumers.skrivestotteClient)
3330
override val digdirService = DigdirService(consumers.digdirClient)
3431
override val pdlService = PdlService(consumers.pdlClient)

src/main/kotlin/no/nav/Vault.kt

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)