Skip to content

Commit 4f37f4c

Browse files
authored
Feature/opprydding i nais v2 (#401)
* Endret hvordan systembruker hentes og hvordan appdynamics er satt opp * Fjerner openidconnect bruker fra koden * Flytter databaseoppsett til vault * Ordnet elementer i yaml filene
1 parent e9d3314 commit 4f37f4c

File tree

6 files changed

+68
-60
lines changed

6 files changed

+68
-60
lines changed

.deploy/dev-fss-q0.yaml

+12-14
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ spec:
2222
timeout: 5
2323
periodSeconds: 10
2424
failureThreshold: 27
25+
prometheus:
26+
enabled: true
27+
path: "/fpabakus/internal/metrics/prometheus"
2528
replicas:
2629
min: 1
2730
max: 2
2831
cpuThresholdPercentage: 80
2932
preStopHookPath: "/fpabakus/internal/preStop"
30-
prometheus:
31-
enabled: true
32-
path: "/fpabakus/internal/metrics/prometheus"
3333
resources:
3434
limits:
3535
cpu: "2000m"
@@ -40,26 +40,26 @@ spec:
4040
vault:
4141
enabled: true
4242
sidecar: false
43+
paths:
44+
- mountPath: /var/run/secrets/nais.io/serviceuser
45+
kvPath: serviceuser/data/dev/srvfpabakus
46+
- mountPath: /var/run/secrets/nais.io/vault
47+
kvPath: /kv/preprod/fss/fpabakus/q0
4348
env:
4449
- name: LOADBALANCER_FQDN
4550
value: fpabakus-q0.nais.preprod.local
4651
- name: ABAC_PDP_ENDPOINT_URL
4752
value: https://wasapp-q0.adeo.no/asm-pdp/authorize
4853
- name: SECURITYTOKENSERVICE_URL
4954
value: https://sts-q0.preprod.local/SecurityTokenServiceProvider/
50-
#Systembruker
51-
- name: SYSTEMBRUKER_USERNAME
52-
value: srvfp-abakus
5355
#OpenID
5456
- name: OPENIDCONNECT_ISSOHOST
5557
value: https://isso-q.adeo.no:443/isso/oauth2
5658
- name: OPENIDCONNECT_ISSOISSUER
5759
value: https://isso-q.adeo.no:443/isso/oauth2
5860
- name: OPENIDCONNECT_ISSOJWKS
5961
value: https://isso-q.adeo.no:443/isso/oauth2/connect/jwk_uri
60-
- name: OPENIDCONNECT_USERNAME
61-
value: fpabakus-q0
62-
#OIDC
62+
#OIDC
6363
- name: OIDC_STS_ISSUERURL
6464
value: https://security-token-service.nais.preprod.local
6565
- name: OIDC_STS_JWKSURL
@@ -69,11 +69,9 @@ spec:
6969
value: b27apvl00045.preprod.local:8443,b27apvl00046.preprod.local:8443,b27apvl00047.preprod.local:8443
7070
- name: KAFKA_SCHEMA_REGISTRY_URL
7171
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Database
73-
- name: DEFAULTDS_USERNAME
74-
value: fpabakus-q0
75-
- name: DEFAULTDS_URL
76-
value: jdbc:postgresql://B27DBVL007.preprod.local:5432/fpabakus-q0
72+
#Appdynamics (mer i Dockerfile)
73+
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74+
value: NON-PROD
7775
# Eksterne systemer
7876
- name: HENTINNTEKTLISTEBOLK_URL
7977
value: https://app-q0.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.deploy/dev-fss-q1.yaml

+13-15
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ spec:
2222
timeout: 5
2323
periodSeconds: 10
2424
failureThreshold: 27
25+
prometheus:
26+
enabled: true
27+
path: "/fpabakus/internal/metrics/prometheus"
2528
replicas:
2629
min: 1
2730
max: 2
2831
cpuThresholdPercentage: 80
2932
preStopHookPath: "/fpabakus/internal/preStop"
30-
prometheus:
31-
enabled: true
32-
path: "/fpabakus/internal/metrics/prometheus"
3333
resources:
3434
limits:
3535
cpu: "2000m"
@@ -40,26 +40,26 @@ spec:
4040
vault:
4141
enabled: true
4242
sidecar: false
43+
paths:
44+
- mountPath: /var/run/secrets/nais.io/serviceuser
45+
kvPath: serviceuser/data/dev/srvfpabakus
46+
- mountPath: /var/run/secrets/nais.io/vault
47+
kvPath: /kv/preprod/fss/fpabakus/q1
4348
env:
4449
- name: LOADBALANCER_FQDN
4550
value: fpabakus-q1.nais.preprod.local
4651
- name: ABAC_PDP_ENDPOINT_URL
4752
value: https://wasapp-q1.adeo.no/asm-pdp/authorize
4853
- name: SECURITYTOKENSERVICE_URL
4954
value: https://sts-q1.preprod.local/SecurityTokenServiceProvider/
50-
#Systembruker
51-
- name: SYSTEMBRUKER_USERNAME
52-
value: srvfp-abakus
5355
#OpenID
5456
- name: OPENIDCONNECT_ISSOHOST
5557
value: https://isso-q.adeo.no:443/isso/oauth2
5658
- name: OPENIDCONNECT_ISSOISSUER
5759
value: https://isso-q.adeo.no:443/isso/oauth2
5860
- name: OPENIDCONNECT_ISSOJWKS
5961
value: https://isso-q.adeo.no:443/isso/oauth2/connect/jwk_uri
60-
- name: OPENIDCONNECT_USERNAME
61-
value: fpabakus-q1
62-
#OIDC
62+
#OIDC
6363
- name: OIDC_STS_ISSUERURL
6464
value: https://security-token-service.nais.preprod.local
6565
- name: OIDC_STS_JWKSURL
@@ -69,12 +69,10 @@ spec:
6969
value: b27apvl00045.preprod.local:8443,b27apvl00046.preprod.local:8443,b27apvl00047.preprod.local:8443
7070
- name: KAFKA_SCHEMA_REGISTRY_URL
7171
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Database
73-
- name: DEFAULTDS_USERNAME
74-
value: fpabakus-q1
75-
- name: DEFAULTDS_URL
76-
value: jdbc:postgresql://B27DBVL007.preprod.local:5432/fpabakus-q1
77-
# Eksterne systemer
72+
#Appdynamics (mer i Dockerfile)
73+
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74+
value: NON-PROD
75+
#Eksterne systemer
7876
- name: HENTINNTEKTLISTEBOLK_URL
7977
value: https://app-q1.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk
8078
- name: ARBEIDSFORHOLD_V3_URL

.deploy/dev-fss-t4.yaml

+9-11
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,26 @@ spec:
4040
vault:
4141
enabled: true
4242
sidecar: false
43+
paths:
44+
- mountPath: /var/run/secrets/nais.io/serviceuser
45+
kvPath: serviceuser/data/test/srvfpabakus
46+
- mountPath: /var/run/secrets/nais.io/vault
47+
kvPath: /kv/preprod/fss/fpabakus/t4
4348
env:
4449
- name: LOADBALANCER_FQDN
4550
value: fpabakus-t4.nais.preprod.local
4651
- name: ABAC_PDP_ENDPOINT_URL
4752
value: https://wasapp-t4.adeo.no/asm-pdp/authorize
4853
- name: SECURITYTOKENSERVICE_URL
4954
value: https://sts-t4.test.local/SecurityTokenServiceProvider/
50-
#Systembruker
51-
- name: SYSTEMBRUKER_USERNAME
52-
value: srvfp-abakus
5355
#OpenID
5456
- name: OPENIDCONNECT_ISSOHOST
5557
value: https://isso-t.adeo.no:443/isso/oauth2
5658
- name: OPENIDCONNECT_ISSOISSUER
5759
value: https://isso-t.adeo.no:443/isso/oauth2
5860
- name: OPENIDCONNECT_ISSOJWKS
5961
value: https://isso-t.adeo.no:443/isso/oauth2/connect/jwk_uri
60-
- name: OPENIDCONNECT_USERNAME
61-
value: fpabakus-t4
62-
#OIDC
62+
#OIDC
6363
- name: OIDC_STS_ISSUERURL
6464
value: https://security-token-service.nais.preprod.local
6565
- name: OIDC_STS_JWKSURL
@@ -69,11 +69,9 @@ spec:
6969
value: 26apvl00159.test.local:8443,d26apvl00160.test.local:8443,d26apvl00161.test.local:8443
7070
- name: KAFKA_SCHEMA_REGISTRY_URL
7171
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Database
73-
- name: DEFAULTDS_USERNAME
74-
value: fpabakus-t4
75-
- name: DEFAULTDS_URL
76-
value: jdbc:postgresql://b27dbvl007.preprod.local:5432/fpabakus-t4
72+
#Appdynamics (mer i Dockerfile)
73+
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74+
value: NON-PROD
7775
# Eksterne systemer
7876
- name: HENTINNTEKTLISTEBOLK_URL
7977
value: https://app-t4.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.deploy/prod-fss-default.yaml

+15-20
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ metadata:
88
spec:
99
image: {{ image }}
1010
port: 8080
11+
ingresses:
12+
- "https://fpabakus.nais.adeo.no/"
1113
liveness:
1214
path: "/fpabakus/internal/isAlive"
1315
initialDelay: 30
@@ -20,49 +22,44 @@ spec:
2022
timeout: 5
2123
periodSeconds: 10
2224
failureThreshold: 27
25+
prometheus:
26+
enabled: true
27+
path: "/fpabakus/internal/metrics/prometheus"
2328
replicas:
2429
min: 2
2530
max: 3
2631
cpuThresholdPercentage: 80
2732
preStopHookPath: "/fpabakus/internal/preStop"
28-
prometheus:
29-
enabled: true
30-
path: "/fpabakus/internal/metrics/prometheus"
3133
resources:
3234
limits:
3335
cpu: "2000m"
3436
memory: "2048Mi"
3537
requests:
3638
cpu: "600m"
3739
memory: "1024Mi"
38-
ingresses: # Optional. List of ingress URLs that will route HTTP traffic to the application.
39-
- "https://fpabakus.nais.adeo.no/"
40-
logformat: accesslog # Optional. The format of the logs from the container if the logs should be handled differently than plain text or json
41-
logtransform: dns_loglevel # Optional. The transformation of the logs, if they should be handled differently than plain text or json
42-
webproxy: false # Optional. Expose web proxy configuration to the application using the HTTP_PROXY, HTTPS_PROXY and NO_PROXY environment variables.
4340
vault:
4441
enabled: true
45-
sidecar: true # refresh token
42+
sidecar: false
43+
paths:
44+
- mountPath: /var/run/secrets/nais.io/serviceuser
45+
kvPath: serviceuser/data/prod/srvfpabakus
46+
- mountPath: /var/run/secrets/nais.io/vault
47+
kvPath: /kv/prod/fss/fpabakus/default
4648
env:
4749
- name: LOADBALANCER_FQDN
4850
value: fpabakus.nais.adeo.no
4951
- name: ABAC_PDP_ENDPOINT_URL
5052
value: https://wasapp.adeo.no/asm-pdp/authorize
5153
- name: SECURITYTOKENSERVICE_URL
5254
value: https://sts.adeo.no/SecurityTokenServiceProvider/
53-
#Systembruker
54-
- name: SYSTEMBRUKER_USERNAME
55-
value: srvfp-abakus
5655
#OpenID
5756
- name: OPENIDCONNECT_ISSOHOST
5857
value: https://isso.adeo.no:443/isso/oauth2
5958
- name: OPENIDCONNECT_ISSOISSUER
6059
value: https://isso.adeo.no:443/isso/oauth2
6160
- name: OPENIDCONNECT_ISSOJWKS
6261
value: https://isso.adeo.no:443/isso/oauth2/connect/jwk_uri
63-
- name: OPENIDCONNECT_USERNAME
64-
value: fpabakus-p
65-
#OIDC
62+
#OIDC
6663
- name: OIDC_STS_ISSUERURL
6764
value: https://security-token-service.nais.adeo.no
6865
- name: OIDC_STS_JWKSURL
@@ -72,11 +69,9 @@ spec:
7269
value: a01apvl00145.adeo.no:8443,a01apvl00146.adeo.no:8443,a01apvl00147.adeo.no:8443,a01apvl00148.adeo.no:8443,a01apvl00149.adeo.no:8443,a01apvl00150.adeo.no:8443
7370
- name: KAFKA_SCHEMA_REGISTRY_URL
7471
value: http://kafka-schema-registry.tpa:8081
75-
#Database
76-
- name: DEFAULTDS_USERNAME
77-
value: fpabakus
78-
- name: DEFAULTDS_URL
79-
value: jdbc:postgresql://a01dbfl039.adeo.no:5432/fpabakus
72+
#Appdynamics (mer i Dockerfile)
73+
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74+
value: PROD
8075
# Eksterne systemer
8176
- name: HENTINNTEKTLISTEBOLK_URL
8277
value: https://app.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

Dockerfile

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
FROM navikt/java:11-appdynamics
22
ENV APPD_ENABLED=true
3+
ENV APPDYNAMICS_CONTROLLER_HOST_NAME=appdynamics.adeo.no
4+
ENV APPDYNAMICS_CONTROLLER_PORT=443
5+
ENV APPDYNAMICS_CONTROLLER_SSL_ENABLED=true
36

47
RUN mkdir lib
58
RUN mkdir webapp
@@ -15,3 +18,6 @@ COPY web/target/lib/*.jar ./
1518
ENV JAVA_OPTS="-Xmx1024m -Xms128m \
1619
-Djava.security.egd=file:/dev/urandom \
1720
-Dlogback.configurationFile=conf/logback.xml"
21+
22+
# Export vault properties
23+
COPY export-vault.sh /init-scripts/export-vault.sh

export-vault.sh

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
if test -f /var/run/secrets/nais.io/serviceuser/username;
4+
then
5+
export SYSTEMBRUKER_USERNAME=$(cat /var/run/secrets/nais.io/serviceuser/username)
6+
echo "Setting SYSTEMBRUKER_USERNAME"
7+
fi
8+
9+
if test -f /var/run/secrets/nais.io/serviceuser/password;
10+
then
11+
export SYSTEMBRUKER_PASSWORD=$(cat /var/run/secrets/nais.io/serviceuser/password)
12+
echo "Setting SYSTEMBRUKER_PASSWORD"
13+
fi

0 commit comments

Comments
 (0)