diff --git a/.github/workflows/quotes-backend.yaml b/.github/workflows/quotes-backend.yaml index 7f4ba44..3d0be07 100644 --- a/.github/workflows/quotes-backend.yaml +++ b/.github/workflows/quotes-backend.yaml @@ -27,5 +27,6 @@ jobs: service-path: ./quotes-backend enable-tests: true enable-coverage: false + extra-resources: ./quotes-backend/.nais/postgres.yaml secrets: NAIS_WORKLOAD_IDENTITY_PROVIDER: ${{ secrets.NAIS_IO_WORKLOAD_IDENTITY_PROVIDER }} diff --git a/.github/workflows/service-pipeline.yaml b/.github/workflows/service-pipeline.yaml index 38d6fe3..7dbedb4 100644 --- a/.github/workflows/service-pipeline.yaml +++ b/.github/workflows/service-pipeline.yaml @@ -26,6 +26,11 @@ on: required: false type: string default: '' + extra-resources: + description: 'Comma-separated list of additional resource files to deploy' + required: false + type: string + default: '' secrets: CODECOV_TOKEN: description: 'Codecov token for coverage uploads' @@ -111,6 +116,6 @@ jobs: CLUSTER: dev-gcp TEAM: examples PRINT_PAYLOAD: "true" - RESOURCE: "${{ inputs.service-path }}/.nais/unleash.yaml,${{ inputs.service-path }}/.nais/app.yaml" + RESOURCE: "${{ inputs.service-path }}/.nais/unleash.yaml,${{ inputs.service-path }}/.nais/app.yaml${{ inputs.extra-resources != '' && format(',{0}', inputs.extra-resources) || '' }}" VARS: ${{ inputs.service-path }}/.nais/dev.yaml VAR: image=europe-north1-docker.pkg.dev/nais-io/nais/images/${{ inputs.service-name }}:${{ needs.build_push_sign.outputs.version }},namespace=examples diff --git a/quotes-backend/.nais/app.yaml b/quotes-backend/.nais/app.yaml old mode 100755 new mode 100644 index 77ad7ab..e9029b2 --- a/quotes-backend/.nais/app.yaml +++ b/quotes-backend/.nais/app.yaml @@ -31,6 +31,12 @@ spec: value: "true" - name: OTEL_METRICS_EXEMPLAR_FILTER value: ALWAYS_ON + - name: DB_JDBC_URL + value: "$(PGJDBCURL)" + - name: DB_USERNAME + value: "$(PGUSER)" + - name: DB_PASSWORD + value: "$(PGPASSWORD)" envFrom: - secret: quotes-backend-unleash-api-token liveness: @@ -69,19 +75,8 @@ spec: - emptyDir: medium: Memory mountPath: /app/docs - gcp: - sqlInstances: - - name: quotes-backend - type: POSTGRES_16 - databases: - - name: quotes - envVarPrefix: DB - tier: db-f1-micro - flags: - - name: cloudsql.enable_pgaudit - value: "on" - - name: pgaudit.log - value: "all" + postgres: + clusterName: quotes-backend-db ingresses: {{#each ingresses as |url|}} - {{url}} diff --git a/quotes-backend/.nais/postgres.yaml b/quotes-backend/.nais/postgres.yaml new file mode 100644 index 0000000..cf4c564 --- /dev/null +++ b/quotes-backend/.nais/postgres.yaml @@ -0,0 +1,14 @@ +apiVersion: data.nais.io/v1 +kind: Postgres +metadata: + name: quotes-backend-db + namespace: examples +spec: + cluster: + majorVersion: "17" + resources: + cpu: 100m + diskSize: 2Gi + memory: 1Gi + database: + collation: nb_NO