Skip to content

Commit ec001a1

Browse files
authored
Flyttet innhenting av appdynamics konfig til en felles vault kilde. (#404)
* Flyttet innhenting av appdynamics konfig til en felles vault kilde. * Fikser feil at man kan ikke mounte flere vault secrets under samme path * Fisker appdynamics innhenting
1 parent fe40f68 commit ec001a1

7 files changed

+35
-16
lines changed

.deploy/dev-fss-q0.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ spec:
4545
kvPath: serviceuser/data/dev/srvfpabakus
4646
- mountPath: /var/run/secrets/nais.io/vault
4747
kvPath: /kv/preprod/fss/fpabakus/q0
48+
- mountPath: /var/run/secrets/nais.io/appdynamics
49+
kvPath: /apikey/appdynamics/dev
4850
env:
4951
- name: LOADBALANCER_FQDN
5052
value: fpabakus-q0.nais.preprod.local
@@ -69,9 +71,6 @@ spec:
6971
value: b27apvl00045.preprod.local:8443,b27apvl00046.preprod.local:8443,b27apvl00047.preprod.local:8443
7072
- name: KAFKA_SCHEMA_REGISTRY_URL
7173
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Appdynamics (mer i Dockerfile)
73-
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74-
value: NON-PROD
7574
# Eksterne systemer
7675
- name: HENTINNTEKTLISTEBOLK_URL
7776
value: https://app-q0.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.deploy/dev-fss-q1.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ spec:
4545
kvPath: serviceuser/data/dev/srvfpabakus
4646
- mountPath: /var/run/secrets/nais.io/vault
4747
kvPath: /kv/preprod/fss/fpabakus/q1
48+
- mountPath: /var/run/secrets/nais.io/appdynamics
49+
kvPath: /apikey/appdynamics/dev
4850
env:
4951
- name: LOADBALANCER_FQDN
5052
value: fpabakus-q1.nais.preprod.local
@@ -69,9 +71,6 @@ spec:
6971
value: b27apvl00045.preprod.local:8443,b27apvl00046.preprod.local:8443,b27apvl00047.preprod.local:8443
7072
- name: KAFKA_SCHEMA_REGISTRY_URL
7173
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Appdynamics (mer i Dockerfile)
73-
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74-
value: NON-PROD
7574
#Eksterne systemer
7675
- name: HENTINNTEKTLISTEBOLK_URL
7776
value: https://app-q1.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.deploy/dev-fss-t4.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ spec:
4545
kvPath: serviceuser/data/test/srvfpabakus
4646
- mountPath: /var/run/secrets/nais.io/vault
4747
kvPath: /kv/preprod/fss/fpabakus/t4
48+
- mountPath: /var/run/secrets/nais.io/appdynamics
49+
kvPath: /apikey/appdynamics/dev
4850
env:
4951
- name: LOADBALANCER_FQDN
5052
value: fpabakus-t4.nais.preprod.local
@@ -69,9 +71,6 @@ spec:
6971
value: 26apvl00159.test.local:8443,d26apvl00160.test.local:8443,d26apvl00161.test.local:8443
7072
- name: KAFKA_SCHEMA_REGISTRY_URL
7173
value: https://kafka-test-schema-registry.nais.preprod.local
72-
#Appdynamics (mer i Dockerfile)
73-
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74-
value: NON-PROD
7574
# Eksterne systemer
7675
- name: HENTINNTEKTLISTEBOLK_URL
7776
value: https://app-t4.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.deploy/prod-fss-default.yaml

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ spec:
4545
kvPath: serviceuser/data/prod/srvfpabakus
4646
- mountPath: /var/run/secrets/nais.io/vault
4747
kvPath: /kv/prod/fss/fpabakus/default
48+
- mountPath: /var/run/secrets/nais.io/appdynamics
49+
kvPath: /apikey/appdynamics/prod
4850
env:
4951
- name: LOADBALANCER_FQDN
5052
value: fpabakus.nais.adeo.no
@@ -69,9 +71,6 @@ spec:
6971
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
7072
- name: KAFKA_SCHEMA_REGISTRY_URL
7173
value: http://kafka-schema-registry.tpa:8081
72-
#Appdynamics (mer i Dockerfile)
73-
- name: APPDYNAMICS_AGENT_ACCOUNT_NAME
74-
value: PROD
7574
# Eksterne systemer
7675
- name: HENTINNTEKTLISTEBOLK_URL
7776
value: https://app.adeo.no/inntektskomponenten-ws/rs/api/v1/hentinntektlistebolk

.scripts/03-import-appdynamics.sh

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env sh
2+
3+
if test -d /var/run/secrets/nais.io/appdynamics;
4+
then
5+
for FILE in /var/run/secrets/nais.io/appdynamics/*.env
6+
do
7+
_oldIFS=$IFS
8+
IFS='
9+
'
10+
for line in $(cat "$FILE"); do
11+
_key=${line%%=*}
12+
_val=${line#*=}
13+
14+
if test "$_key" != "$line"
15+
then
16+
echo "- exporting $_key"
17+
else
18+
echo "- (warn) exporting contents of $FILE which is not formatted as KEY=VALUE"
19+
fi
20+
21+
export "$_key"="$(echo "$_val"|sed -e "s/^['\"]//" -e "s/['\"]$//")"
22+
done
23+
IFS=$_oldIFS
24+
done
25+
fi
File renamed without changes.

Dockerfile

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
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
63

74
RUN mkdir lib
85
RUN mkdir webapp
@@ -20,4 +17,5 @@ ENV JAVA_OPTS="-Xmx1024m -Xms128m \
2017
-Dlogback.configurationFile=conf/logback.xml"
2118

2219
# Export vault properties
23-
COPY export-vault.sh /init-scripts/export-vault.sh
20+
COPY .scripts/03-import-appdynamics.sh /init-scripts/03-import-appdynamics.sh
21+
COPY .scripts/05-import-users.sh /init-scripts/05-import-users.sh

0 commit comments

Comments
 (0)