Skip to content

Commit

Permalink
[KAIZEN-0] Legge til unleash for BFF
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesperpaulsen committed Feb 9, 2024
1 parent f67303c commit c7dfa4d
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 2 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/unleash.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "Deploy unleash api token"
on:
push:
paths:
- .nais/unleash/**
- .github/workflows/unleash.yml
jobs:
deploy-unleash-api-token-to-dev:
if: github.ref == 'refs/heads/dev'
name: Deploy unleash api token to dev-fss
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy unleash api token
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: dev-fss
RESOURCE: .nais/unleash/unleash-apitoken-preprod.yaml

deploy-unleash-api-token-to-prod:
if: github.ref == 'refs/heads/master'
name: Deploy unleash api-token to prod-fss
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy unleash api token
uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: prod-fss
RESOURCE: .nais/unleash/unleash-apitoken-prod.yaml
10 changes: 9 additions & 1 deletion .nais/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ spec:
- id: "ea34edea-1e80-4759-a1d2-fbe696cf1709" # 0000-GA-BD06_ModiaGenerellTilgang
vault:
enabled: true
accessPolicy:
outbound:
external:
- host: personoversikt-unleash-api.nav.cloud.nais.io
envFrom:
- secret: modiapersonoversikt-unleash-api-token
env:
- name: APP_NAME
value: "modiapersonoversikt"
Expand All @@ -68,4 +74,6 @@ spec:
- name: DATABASE_JDBC_URL
value: "jdbc:postgresql://A01DBVL029.adeo.no:5432/modiapersonoversikt"
- name: VAULT_MOUNTPATH
value: "postgresql/prod-fss/"
value: "postgresql/prod-fss/"
- name: UNLEASH_ENVIRONMENT
value: "production"
10 changes: 9 additions & 1 deletion .nais/qa-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ spec:
- id: "67a06857-0028-4a90-bf4c-9c9a92c7d733" # 0000-GA-BD06_ModiaGenerellTilgang
vault:
enabled: true
accessPolicy:
outbound:
external:
- host: personoversikt-unleash-api.nav.cloud.nais.io
envFrom:
- secret: modiapersonoversikt-unleash-api-token
env:
- name: APP_NAME
value: "modiapersonoversikt"
Expand All @@ -72,4 +78,6 @@ spec:
- name: DATABASE_JDBC_URL
value: "jdbc:postgresql://b27dbvl030.preprod.local:5432/modiapersonoversikt"
- name: VAULT_MOUNTPATH
value: "postgresql/preprod-fss/"
value: "postgresql/preprod-fss/"
- name: UNLEASH_ENVIRONMENT
value: "development"
18 changes: 18 additions & 0 deletions .nais/unleash/unleash-apitoken-preprod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: unleash.nais.io/v1
kind: ApiToken
metadata:
name: modiapersonoversikt
namespace: personoversikt
labels:
team: personoversikt
spec:
unleashInstance:
apiVersion: unleash.nais.io/v1
kind: RemoteUnleash
name: personoversikt
secretName: modiapersonoversikt-unleash-api-token

# Specify which environment the API token should be created for.
# Can be one of: development, or production.
environment: development

18 changes: 18 additions & 0 deletions .nais/unleash/unleash-apitoken-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: unleash.nais.io/v1
kind: ApiToken
metadata:
name: modiapersonoversikt
namespace: personoversikt
labels:
team: personoversikt
spec:
unleashInstance:
apiVersion: unleash.nais.io/v1
kind: RemoteUnleash
name: personoversikt
secretName: modiapersonoversikt-unleash-api-token

# Specify which environment the API token should be created for.
# Can be one of: development, or production.
environment: production

0 comments on commit c7dfa4d

Please sign in to comment.