Skip to content

Commit 4c9bf26

Browse files
committed
tiltaksgjennomforing-api
1 parent c3fb1cb commit 4c9bf26

625 files changed

Lines changed: 31927 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# DISABLED: Turned this off since it's currently generating very noisy notifications to the team and reviewers can't
2+
# tell the difference between being explicitly added as a reviewer versus by way of this group.
3+
# * @navikt/arbeidsgiver
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM ghcr.io/navikt/baseimages/temurin:17
2+
COPY import-vault-token.sh /init-scripts
3+
COPY /target/tiltaksgjennomforing-api-1.0.0-SNAPSHOT.jar app.jar
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License
2+
3+
Copyright 2018 NAV (Arbeids- og velferdsdirektoratet) - The Norwegian Labour and Welfare Administration
4+
5+
Permission is hereby granted, free of charge, to any person obtaining
6+
a copy of this software and associated documentation files (the "Software"),
7+
to deal in the Software without restriction, including without limitation
8+
the rights to use, copy, modify, merge, publish, distribute, sublicense,
9+
and/or sell copies of the Software, and to permit persons to whom the
10+
Software is furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included
13+
in all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21+
USE OR OTHER DEALINGS IN THE SOFTWARE.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Tiltaksgjennomføring API
2+
===================================
3+
4+
For NAV-interne: Ta kontakt på Slack-kanal #arbeidsgiver-tiltak
5+
6+
For utviklere:
7+
Bygges med Maven: `mvn install`
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
version: "3"
2+
services:
3+
zookeeper:
4+
image: confluentinc/cp-zookeeper:5.4.0
5+
hostname: zookeeper
6+
container_name: zookeeper
7+
ports:
8+
- "2181:2181"
9+
environment:
10+
ZOOKEEPER_CLIENT_PORT: 2181
11+
ZOOKEEPER_TICK_TIME: 2000
12+
broker:
13+
image: confluentinc/cp-server:5.4.0
14+
hostname: broker
15+
container_name: broker
16+
depends_on:
17+
- zookeeper
18+
ports:
19+
- "9092:9092"
20+
environment:
21+
KAFKA_BROKER_ID: 1
22+
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
23+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
24+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
25+
KAFKA_METRIC_REPORTERS: io.confluent.metrics.reporter.ConfluentMetricsReporter
26+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
27+
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
28+
KAFKA_CONFLUENT_LICENSE_TOPIC_REPLICATION_FACTOR: 1
29+
CONFLUENT_METRICS_REPORTER_BOOTSTRAP_SERVERS: broker:29092
30+
CONFLUENT_METRICS_REPORTER_ZOOKEEPER_CONNECT: zookeeper:2181
31+
CONFLUENT_METRICS_REPORTER_TOPIC_REPLICAS: 1
32+
CONFLUENT_METRICS_ENABLE: "true"
33+
CONFLUENT_SUPPORT_CUSTOMER_ID: "anonymous"
34+
35+
kafka-tools:
36+
image: confluentinc/cp-kafka:5.4.0
37+
hostname: kafka-tools
38+
container_name: kafka-tools
39+
command: [ "tail", "-f", "/dev/null" ]
40+
network_mode: "host"
41+
42+
schema-registry:
43+
image: confluentinc/cp-schema-registry:5.4.0
44+
hostname: schema-registry
45+
container_name: schema-registry
46+
depends_on:
47+
- zookeeper
48+
- broker
49+
ports:
50+
- "8081:8081"
51+
environment:
52+
SCHEMA_REGISTRY_HOST_NAME: schema-registry
53+
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: "zookeeper:2181"
54+
55+
control-center:
56+
image: confluentinc/cp-enterprise-control-center:5.4.0
57+
hostname: control-center
58+
container_name: control-center
59+
depends_on:
60+
- zookeeper
61+
- broker
62+
- schema-registry
63+
ports:
64+
- "9021:9021"
65+
environment:
66+
CONTROL_CENTER_BOOTSTRAP_SERVERS: 'broker:29092'
67+
CONTROL_CENTER_ZOOKEEPER_CONNECT: 'zookeeper:2181'
68+
CONTROL_CENTER_SCHEMA_REGISTRY_URL: "http://schema-registry:8081"
69+
CONTROL_CENTER_REPLICATION_FACTOR: 1
70+
CONTROL_CENTER_INTERNAL_TOPICS_PARTITIONS: 1
71+
CONTROL_CENTER_MONITORING_INTERCEPTOR_TOPIC_PARTITIONS: 1
72+
CONFLUENT_METRICS_TOPIC_REPLICATION: 1
73+
PORT: 9021
74+
postgres:
75+
image: postgres:latest
76+
environment:
77+
POSTGRES_USER: sample
78+
POSTGRES_PASSWORD: sample
79+
POSTGRES_DB: sample
80+
# volumes:
81+
# - ./dbdata:/var/lib/postgresql/data
82+
ports:
83+
- 6432:5432
84+
tiltak-dokgen:
85+
build:
86+
context: ../tiltak-dokgen
87+
ports:
88+
- 5913:8080
89+
volumes:
90+
- ../tiltak-dokgen/content:/app/content
91+
environment:
92+
SPRING_PROFILES_ACTIVE: dev
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env sh
2+
3+
if test /var/run/secrets/nais.io/vault/vault_token;
4+
then
5+
export VAULT_TOKEN=$(cat /var/run/secrets/nais.io/vault/vault_token)
6+
fi
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lombok.anyConstructor.addConstructorProperties=true
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: PrometheusRule
3+
metadata:
4+
name: tiltaksgjennomforing-api
5+
namespace: arbeidsgiver
6+
labels:
7+
team: team-tiltak
8+
spec:
9+
groups:
10+
- name: tiltaksgjennomforing-api-alert
11+
rules:
12+
- alert: applikasjon nede
13+
expr: sum(up{app="tiltaksgjennomforing-api", job="nais-system/monitoring-apps-tenant"}) == 0
14+
for: 1s
15+
annotations:
16+
summary: Appen er nede
17+
action: "`kubectl describe pod {{ $labels.kubernetes_pod_name }} -n {{ $labels.kubernetes_namespace }}` for events, og `kubectl logs {{ $labels.kubernetes_pod_name }} -n {{ $labels.kubernetes_namespace }}` for logger"
18+
labels:
19+
namespace: team-tiltak
20+
severity: critical
21+
22+
- alert: last ned pdf feiler
23+
expr: sum(increase(tiltaksgjennomforing_pdf_feil_total[15m])) > 0
24+
for: 1s
25+
annotations:
26+
summary: tiltaksgjennomforing-api feiler med pdf-generering
27+
action: "`kubectl describe pod {{ $labels.kubernetes_pod_name }} -n {{ $labels.kubernetes_namespace }}` for events, og `kubectl logs {{ $labels.kubernetes_pod_name }} -n {{ $labels.kubernetes_namespace }}` for logger"
28+
labels:
29+
namespace: team-tiltak
30+
severity: critical
31+
32+
- alert: TILTAKSGJENNOMFORING-API ERROR!
33+
expr: sum(increase(logback_events_total{app="tiltaksgjennomforing-api",level="error"}[10m])) > 0
34+
for: 10s
35+
annotations:
36+
summary: |-
37+
tiltaksgjennomforing-api har logget en feil :this-is-fine-fire: Sjekk loggene om noe bør gjøres!
38+
action: "Sjekk logs.adeo.no for logger: https://logs.adeo.no/app/r/s/HT3Nd"
39+
labels:
40+
namespace: team-tiltak
41+
severity: critical
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
apiVersion: "nais.io/v1alpha1"
2+
kind: "Application"
3+
metadata:
4+
name: tiltaksgjennomforing-api
5+
namespace: arbeidsgiver
6+
labels:
7+
team: arbeidsgiver
8+
spec:
9+
env:
10+
- name: MILJO
11+
value: dev-fss
12+
azure:
13+
application:
14+
enabled: true
15+
allowAllUsers: true
16+
tenant: trygdeetaten.no
17+
claims:
18+
groups:
19+
- id: fbfea82d-13da-43ad-a2f2-d7f21cb95f12
20+
extra:
21+
- "NAVident"
22+
kafka:
23+
pool: nav-dev
24+
image: {{image}}
25+
team: arbeidsgiver
26+
port: 8080
27+
liveness:
28+
path: /tiltaksgjennomforing-api/internal/healthcheck
29+
initialDelay: 30
30+
timeout: 1
31+
periodSeconds: 30
32+
failureThreshold: 10
33+
readiness:
34+
path: /tiltaksgjennomforing-api/internal/healthcheck
35+
initialDelay: 30
36+
timeout: 1
37+
periodSeconds: 30
38+
failureThreshold: 10
39+
resources:
40+
limits:
41+
cpu: 2000m
42+
memory: 3000Mi
43+
requests:
44+
cpu: 500m
45+
memory: 600Mi
46+
ingresses:
47+
- https://arbeidsgiver.nais.preprod.local/tiltaksgjennomforing-api/
48+
leaderElection: true
49+
vault:
50+
enabled: true
51+
webproxy: true
52+
strategy:
53+
type: RollingUpdate
54+
tokenx:
55+
enabled: true
56+
prometheus:
57+
enabled: true
58+
path: /tiltaksgjennomforing-api/internal/actuator/prometheus
59+
accessPolicy:
60+
inbound:
61+
rules:
62+
- application: tiltak-proxy
63+
- application: min-side-arbeidsgiver
64+
namespace: fager
65+
cluster: dev-gcp
66+
- application: mulighetsrommet-api
67+
namespace: team-mulighetsrommet
68+
cluster: dev-gcp
69+
outbound:
70+
rules:
71+
- application: poao-tilgang
72+
namespace: poao
73+
external:
74+
- host: team-tiltak-unleash-api.nav.cloud.nais.io
75+
envFrom:
76+
- configmap: loginservice-idporten
77+
- secret: tiltaksgjennomforing-api-unleash-api-token
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
apiVersion: "nais.io/v1alpha1"
2+
kind: "Application"
3+
metadata:
4+
name: tiltaksgjennomforing-api-labs
5+
namespace: arbeidsgiver
6+
labels:
7+
team: arbeidsgiver
8+
spec:
9+
env:
10+
- name: MILJO
11+
value: dev-gcp-labs
12+
image: {{image}}
13+
team: arbeidsgiver
14+
port: 8080
15+
replicas:
16+
min: 1
17+
max: 1
18+
liveness:
19+
path: /tiltaksgjennomforing-api/internal/healthcheck
20+
initialDelay: 30
21+
timeout: 1
22+
periodSeconds: 30
23+
failureThreshold: 10
24+
readiness:
25+
path: /tiltaksgjennomforing-api/internal/healthcheck
26+
initialDelay: 30
27+
timeout: 1
28+
periodSeconds: 30
29+
failureThreshold: 10
30+
resources:
31+
limits:
32+
cpu: 2000m
33+
memory: 3000Mi
34+
requests:
35+
cpu: 500m
36+
memory: 600Mi
37+
prometheus:
38+
enabled: true
39+
path: /tiltaksgjennomforing-api/internal/actuator/prometheus
40+
accessPolicy:
41+
inbound:
42+
rules:
43+
- application: tiltaksgjennomforing-labs
44+
outbound:
45+
rules:
46+
- application: tiltak-fakelogin
47+
- application: tiltaksgjennomforing-wiremock
48+
- application: tiltak-refusjon-api-labs
49+
- application: tiltak-dokgen
50+
envFrom:
51+
- configmap: loginservice-idporten

0 commit comments

Comments
 (0)