Skip to content

Commit

Permalink
ARKIV-12 Arkivering i VIGO OT starter her 🗄️
Browse files Browse the repository at this point in the history
  • Loading branch information
oleanders committed Mar 15, 2024
1 parent 348fcd0 commit 13130a3
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ RUN gradle --no-daemon build

FROM gcr.io/distroless/java17
ENV JAVA_TOOL_OPTIONS -XX:+ExitOnOutOfMemoryError
COPY --from=builder /home/gradle/build/libs/fint-flyt-instance-gateway-template-*.jar /data/app.jar
COPY --from=builder /home/gradle/build/libs/fint-flyt-oppfolgingstjenesten-gateway-*.jar /data/app.jar
CMD ["/data/app.jar"]
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
# FINT FLYT INSTANCE GATEWAY TEMPLATE
# FINT FLYT OPPFOLGINGSTJENETEN GATEWAY

## Overview
This template serves as a skeleton gateway with example code for creating specific instance-gateways in FINT Flyt. Its primary function is to handle POST requests containing data, which is then processed and published to other microservices through Kafka inside the FINT Flyt infrastructure.
This code creates a gateway for VIGO OT.

## Getting Started
To use this template, you need to customize it according to your specific requirements. Follow the steps below to configure and deploy your instance of the gateway.

### Rename `sourceApplication`
The `sourceApplication` represents the data source sending information to this gateway (e.g., `egrunnerverv`, `acos`, `rf13.50`, etc.). Rename it throughout the project to reflect your specific source application.

- **Example**: Rename `fint-flyt-sourceapplication-instance-gateway` to `fint-flyt-rf1350-instance-gateway`.

### Kustomize Configuration
Adjust the following setting in the `base/flais.yaml`:
Expand Down
10 changes: 5 additions & 5 deletions kustomize/base/flais.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: fintlabs.no/v1alpha1
kind: Application
metadata:
name: fint-flyt-sourceapplication-instance-gateway
name: fint-flyt-oppfolgingstjenesten-gateway
namespace: fintlabs-no
labels:
app.kubernetes.io/name: fint-flyt-sourceapplication-instance-gateway
app.kubernetes.io/instance: fint-flyt-sourceapplication-instance-gateway_fintlabs_no
app.kubernetes.io/name: fint-flyt-oppfolgingstjenesten-gateway
app.kubernetes.io/instance: fint-flyt-oppfolgingstjenesten-gateway_fintlabs_no
app.kubernetes.io/version: latest
app.kubernetes.io/component: backend
app.kubernetes.io/part-of: fint-flyt
Expand All @@ -15,7 +15,7 @@ spec:
port: 8080
imagePullPolicy: Always
orgId: fintlabs.no
image: ghcr.io/fintlabs/fint-flyt-sourceapplication-instance-gateway:sha-0000000
image: ghcr.io/fintlabs/fint-flyt-oppfolgingstjenesten-gateway:sha-0000000
kafka:
enabled: true
acls:
Expand All @@ -33,7 +33,7 @@ spec:
- name: fint.flyt.resource-server.security.api.external.enabled
value: "true"
- name: fint.flyt.resource-server.security.api.external.authorized-client-ids
value: "n"
value: "4"
envFrom:
- secretRef:
name: fint-flyt-file-oauth2-client
Expand Down
2 changes: 1 addition & 1 deletion kustomize/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ kind: Kustomization
resources:
- flais.yaml
- oauth2-file-client.yaml
- oauth2-sourceapplication-client.yaml
- oauth2-oppfolgingstjenesten-client.yaml
9 changes: 9 additions & 0 deletions kustomize/base/oauth2-oppfolgingstjenesten-client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "fintlabs.no/v1alpha1"
kind: NamOAuthClientApplicationResource
metadata:
name: fint-flyt-oppfolgingstjenesten-oauth2-client
spec:
clientIdProperty: fint.flyt.oppfolgingstjenesten.sso.client-id
clientSecretProperty: fint.flyt.oppfolgingstjenesten.sso.client-secret
grantTypes:
- client_credentials
9 changes: 0 additions & 9 deletions kustomize/base/oauth2-sourceapplication-client.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions kustomize/overlays/fintlabs-no/beta/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ resources:
- ../../../base

commonLabels:
app.kubernetes.io/instance: fint-flyt-sourceapplication-instance-gateway_fintlabs_no
app.kubernetes.io/instance: fint-flyt-oppfolgingstjenesten-gateway_fintlabs_no
fintlabs.no/org-id: fintlabs.no

patches:
Expand All @@ -22,8 +22,8 @@ patches:
value: "/beta"
- op: replace
path: "/spec/ingress/basePath"
value: "/beta/api/sourceapplication/instances/999999999"
value: "/beta/api/oppfolgingstjenesten"
target:
kind: Application
name: fint-flyt-sourceapplication-instance-gateway
name: fint-flyt-oppfolgingstjenesten-gateway
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'fint-flyt-instance-gateway-template'
rootProject.name = 'fint-flyt-oppfolgingstjenesten-gateway'
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import static no.fintlabs.resourceserver.UrlPaths.EXTERNAL_API;

@RestController
@RequestMapping(EXTERNAL_API + "/sourceapplication/instances")
@RequestMapping(EXTERNAL_API + "/oppfolgingstjenesten/instances")
public class InstanceController {

private final InstanceProcessor<IncomingInstance> simpleInstanceProcessor;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application-local-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spring:
kafka:
bootstrap-servers: localhost:9092
server:
port: 8999
port: 8104
logging:
level:
no.fintlabs.sourceapplicationInstanceController: DEBUG
2 changes: 1 addition & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fint:
application-id: fint-flyt-sourceapplication-instance-gateway
application-id: fint-flyt-oppfolgingstjenesten-gateway
cache:
defaultCacheEntryTimeToLiveMillis: 518400000
defaultCacheHeapSize: 1000000
Expand Down

0 comments on commit 13130a3

Please sign in to comment.