diff --git a/.github/workflows/deploy-lps-topic.yaml b/.github/workflows/deploy-lps-topic.yaml new file mode 100644 index 00000000..77e820dc --- /dev/null +++ b/.github/workflows/deploy-lps-topic.yaml @@ -0,0 +1,38 @@ +name: "Deploy topic" +on: + push: + paths: + - nais/topics/** + - .github/workflows/topic.yaml +jobs: + deploy-topic-to-dev: + if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/topic-') + name: Deploy topic to dev + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Deploy lps topic to dev + uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: dev-gcp + RESOURCE: nais/topics/lps-topic.yaml + VARS: nais/topics/dev.json + + deploy-topic-to-prod: + if: github.ref == 'refs/heads/main' + name: Deploy topic to prod + permissions: + id-token: write + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Deploy lps topic to prod + uses: nais/deploy/actions/deploy@v2 + env: + CLUSTER: prod-gcp + RESOURCE: nais/topics/lps-topic.yaml + VARS: nais/topics/prod.json diff --git a/nais/topics/dev.json b/nais/topics/dev.json new file mode 100644 index 00000000..ab4686c4 --- /dev/null +++ b/nais/topics/dev.json @@ -0,0 +1,3 @@ +{ + "kafkaPool": "nav-dev" +} diff --git a/nais/topics/lps-topic.yaml b/nais/topics/lps-topic.yaml new file mode 100644 index 00000000..7b27cb6d --- /dev/null +++ b/nais/topics/lps-topic.yaml @@ -0,0 +1,24 @@ +apiVersion: kafka.nais.io/v1 +kind: Topic +metadata: + name: aapen-syfo-oppfolgingsplan-lps-nav-v2 + namespace: team-esyfo + labels: + team: team-esyfo +spec: + pool: {{kafkaPool}} + config: + cleanupPolicy: delete + minimumInSyncReplicas: 1 + partitions: 1 + replication: 3 + retentionBytes: -1 # Messages will never be deleted because of disk space + retentionHours: -1 # Messages will never be timed out + acl: + - team: team-esyfo + application: lps-oppfolgingsplan-mottak + access: write + - team: teamsykefravr + application: ispersonoppgave + access: read + diff --git a/nais/topics/prod.json b/nais/topics/prod.json new file mode 100644 index 00000000..bd3c4fa2 --- /dev/null +++ b/nais/topics/prod.json @@ -0,0 +1,3 @@ +{ + "kafkaPool": "nav-prod" +}