Skip to content

Commit

Permalink
Refactor profiles and update URLs for local and dev environments #dep…
Browse files Browse the repository at this point in the history
…loy-test-synt-sykemelding-api #deploy-test-sykemelding-api

Updated the configuration to differentiate between 'local' and 'dev' profiles, ensuring appropriate URL endpoints for each environment. This includes changes in the OAuth2 setup, Spring profiles, and Dockerfile adjustments. Added new configuration files to support "prod" and "local" environments.
  • Loading branch information
krharum committed Nov 27, 2024
1 parent bcfe7df commit 35ec44f
Show file tree
Hide file tree
Showing 10 changed files with 116 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/app.synt-sykemelding-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
with:
working-directory: "apps/synt-sykemelding-api"
deploy-tag: "#deploy-synt-sykemelding-api"
deploy-tag-test: "#deploy-test-synt-sykemelding-api"
permissions:
contents: read
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion apps/sykemelding-api/config.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ spec:
- application: dolly-idporten
- application: team-dolly-lokal-app
- application: testnav-oversikt-frontend
- application: testnav-synt-sykemelding-api
- application: testnav-synt-sykemelding-api-dev
outbound:
external:
- host: mqls04.preprod.local
Expand Down
4 changes: 1 addition & 3 deletions apps/synt-sykemelding-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM ghcr.io/navikt/baseimages/temurin:21
LABEL maintainer="Team Dolly"

ENV JAVA_OPTS="-Dspring.profiles.active=prod"

ADD /build/libs/app.jar /app/app.jar
COPY /build/libs/app.jar /app/app.jar

EXPOSE 8080
73 changes: 73 additions & 0 deletions apps/synt-sykemelding-api/config.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
apiVersion: "nais.io/v1alpha1"
kind: "Application"
metadata:
name: testnav-synt-sykemelding-api-dev
namespace: dolly
annotations:
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
labels:
team: dolly
spec:
image: "{{image}}"
port: 8080
webproxy: true
tokenx:
enabled: true
azure:
application:
allowAllUsers: true
enabled: true
tenant: nav.no
liveness:
path: /internal/isAlive
initialDelay: 4
periodSeconds: 5
failureThreshold: 500
observability:
logging:
destinations:
- id: elastic
autoInstrumentation:
enabled: true
runtime: java
readiness:
path: /internal/isReady
initialDelay: 4
periodSeconds: 5
failureThreshold: 500
prometheus:
enabled: true
path: /internal/metrics
replicas:
min: 1
max: 1
vault:
enabled: true
resources:
requests:
cpu: 200m
memory: 4000Mi
limits:
memory: 5000Mi
accessPolicy:
inbound:
rules:
- application: dolly-backend
- application: dolly-backend-dev
- application: team-dolly-lokal-app
- application: testnav-oversikt-frontend
outbound:
rules:
- application: synthdata-elsam-gcp
- application: testnav-organisasjon-service
- application: testnav-arbeidsforhold-service
- application: testnav-helsepersonell-service
- application: testnav-sykemelding-api-dev
external:
- host: testnav-pdl-proxy.dev-fss-pub.nais.io
ingresses:
- "https://testnav-synt-sykemelding-api-dev.intern.dev.nav.no"
env:
- name: SPRING_PROFILES_ACTIVE
value: dev
3 changes: 3 additions & 0 deletions apps/synt-sykemelding-api/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ spec:
- host: testnav-pdl-proxy.dev-fss-pub.nais.io
ingresses:
- "https://testnav-synt-sykemelding-api.intern.dev.nav.no"
env:
- name: SPRING_PROFILES_ACTIVE
value: prod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
import org.springframework.context.annotation.Profile;

@Configuration
@Profile("dev")
@Profile("local")
public class LocalVaultConfig extends AbstractLocalVaultConfiguration {
}
20 changes: 15 additions & 5 deletions apps/synt-sykemelding-api/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@

TOKEN_X_CLIENT_ID: dev-gcp:dolly:testnav-synt-sykemelding-api
spring:
security:
oauth2:
resourceserver:
tokenx:
issuer-uri: ${TOKEN_X_ISSUER}
jwk-set-uri: ${TOKEN_X_JWKS_URI}
accepted-audience: ${TOKEN_X_CLIENT_ID}

consumers:
synt-sykemelding:
url: https://synthdata-elsam-gcp.intern.dev.nav.no
url: http://synthdata-elsam-gcp.intern.dolly.svc.cluster.local
testnav-organisasjon-service:
url: https://testnav-organisasjon-service.intern.dev.nav.no
url: http://testnav-organisasjon-service.dolly.svc.cluster.local
testnav-arbeidsforhold-service:
url: https://testnav-arbeidsforhold-service.intern.dev.nav.no
url: http://testnav-arbeidsforhold-service.dolly.svc.cluster.local
testnav-helsepersonell-service:
url: https://testnav-helsepersonell-service.intern.dev.nav.no
url: http://testnav-helsepersonell-service.dolly.svc.cluster.local
sykemelding-api:
url: http://testnav-sykemelding-api-dev.dolly.svc.cluster.local
name: testnav-sykemelding-api-dev
13 changes: 13 additions & 0 deletions apps/synt-sykemelding-api/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

consumers:
synt-sykemelding:
url: https://synthdata-elsam-gcp.intern.dev.nav.no
testnav-organisasjon-service:
url: https://testnav-organisasjon-service.intern.dev.nav.no
testnav-arbeidsforhold-service:
url: https://testnav-arbeidsforhold-service.intern.dev.nav.no
testnav-helsepersonell-service:
url: https://testnav-helsepersonell-service.intern.dev.nav.no
sykemelding-api:
url: https://testnav-sykemelding-api-dev.intern.dev.nav.no
name: testnav-sykemelding-api-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
spring:
security:
oauth2:
resourceserver:
tokenx:
issuer-uri: ${TOKEN_X_ISSUER}
jwk-set-uri: ${TOKEN_X_JWKS_URI}
accepted-audience: ${TOKEN_X_CLIENT_ID}
4 changes: 0 additions & 4 deletions apps/synt-sykemelding-api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ spring:
issuer-uri: ${AAD_ISSUER_URI}/v2.0
jwk-set-uri: ${AAD_ISSUER_URI}/discovery/v2.0/keys
accepted-audience: ${azure.app.client.id}, api://${azure.app.client.id}
tokenx:
issuer-uri: ${TOKEN_X_ISSUER}
jwk-set-uri: ${TOKEN_X_JWKS_URI}
accepted-audience: ${TOKEN_X_CLIENT_ID}
cloud:
vault:
enabled: false
Expand Down

0 comments on commit 35ec44f

Please sign in to comment.