Skip to content

Commit

Permalink
configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aomegax committed Jan 31, 2024
1 parent 6d5aca7 commit 654780e
Show file tree
Hide file tree
Showing 34 changed files with 88 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/03_code_review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
workflow_dispatch:

env:
PROJECT_KEY: pagopa_pagopa-node-cfg-job-manager
PROJECT_KEY: pagopa_pagopa-node-cfg-sync


permissions:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/05h_deploy_with_github_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
type: string

env:
APP_NAME: pagopa-node-cfg-job-manager
APP_NAME: pagopa-node-cfg-sync


permissions:
Expand Down
4 changes: 2 additions & 2 deletions .identity/99_variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
github = {
org = "pagopa"
repository = "pagopa-node-cfg-job-manager"
repository = "pagopa-node-cfg-sync"
}

prefix = "pagopa"
Expand Down Expand Up @@ -65,7 +65,7 @@ variable "tags" {
CreatedBy = "Terraform"
Environment = "PROD"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-node-cfg-job-manager"
Source = "https://github.com/pagopa/pagopa-node-cfg-sync"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
}
2 changes: 1 addition & 1 deletion .identity/env/dev/backend.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformdev"
container_name = "azurermstate"
key = "pagopa-node-cfg-job-manager.tfstate"
key = "pagopa-node-cfg-sync.tfstate"
2 changes: 1 addition & 1 deletion .identity/env/dev/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ tags = {
CreatedBy = "Terraform"
Environment = "Dev"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-node-cfg-job-manager"
Source = "https://github.com/pagopa/pagopa-node-cfg-sync"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
2 changes: 1 addition & 1 deletion .identity/env/prod/backend.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformprod"
container_name = "azurermstate"
key = "pagopa-node-cfg-job-manager.tfstate"
key = "pagopa-node-cfg-sync.tfstate"
2 changes: 1 addition & 1 deletion .identity/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ tags = {
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-node-cfg-job-manager"
Source = "https://github.com/pagopa/pagopa-node-cfg-sync"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
2 changes: 1 addition & 1 deletion .identity/env/uat/backend.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformuat"
container_name = "azurermstate"
key = "pagopa-node-cfg-job-manager.tfstate"
key = "pagopa-node-cfg-sync.tfstate"
2 changes: 1 addition & 1 deletion .identity/env/uat/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ tags = {
CreatedBy = "Terraform"
Environment = "Uat"
Owner = "pagoPA"
Source = "https://github.com/pagopa/pagopa-node-cfg-job-manager"
Source = "https://github.com/pagopa/pagopa-node-cfg-sync"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
2 changes: 1 addition & 1 deletion .opex/env/prod/backend.tfvars
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resource_group_name = "io-infra-rg"
storage_account_name = "pagopainfraterraformprod"
container_name = "azurermstate"
key = "opex.<your-repo-name>.terraform.tfstate" #TODO
key = "opex.pagopa-node-cfg-sync.terraform.tfstate"
2 changes: 1 addition & 1 deletion .opex/env/prod/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
oa3_spec: ./openapi/openapi.json # If start with http the file would be downloaded from the internet
name: opex_<your-repo-name> # TODO
name: opex_pagopa-node-cfg-sync
location: West Europe
timespan: 5m # Default, a number or a timespan https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/scalar-data-types/timespan
data_source: /subscriptions/b9fc9419-6097-45fe-9f74-ba0641c91912/resourceGroups/pagopa-p-vnet-rg/providers/Microsoft.Network/applicationGateways/pagopa-p-app-gw
Expand Down
2 changes: 1 addition & 1 deletion .opex/env/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ tags = {
CreatedBy = "Terraform"
Environment = "Prod"
Owner = "pagoPA"
Source = "https://github.com/pagopa/your-repository" # TODO
Source = "https://github.com/pagopa/pagopa-node-cfg-sync"
CostCenter = "TS310 - PAGAMENTI & SERVIZI"
}
21 changes: 10 additions & 11 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
microservice-chart:
namespace: "your-namespace" # TODO: set your AKS namespace
namespace: "node-cfg-sync"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/yourname # TODO
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.0"
pullPolicy: Always
livenessProbe:
Expand All @@ -29,8 +29,8 @@ microservice-chart:
- 8080
ingress:
create: true
host: "your.host" # TODO: set the host
path: /your-path-here/(.*) # TODO: set your path
host: "weudev.nodo.internal.dev.platform.pagopa.it"
path: /node-cfg-sync/(.*)
servicePort: 8080
serviceAccount:
create: false
Expand All @@ -48,11 +48,11 @@ microservice-chart:
cpu: "0.25"
limits:
memory: "512Mi"
cpu: "0.25"
cpu: "0.5"
autoscaling:
enable: true
minReplica: 1
maxReplica: 10
maxReplica: 1
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
triggers:
Expand All @@ -62,14 +62,13 @@ microservice-chart:
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
envConfig:
# TODO: set your name
WEBSITE_SITE_NAME: 'yourProjectName' # required to show cloud role name in application insights
WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' # required to show cloud role name in application insights
ENV: 'azure-dev'
APP_LOGGING_LEVEL: 'DEBUG'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'

OTEL_SERVICE_NAME: # TODO
OTEL_SERVICE_NAME: "pagopa-node-cfg-sync"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=dev"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_TRACES_EXPORTER: otlp
Expand All @@ -81,7 +80,7 @@ microservice-chart:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-d-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
keyvault:
name: "pagopa-d-name-kv" #TODO
name: "pagopa-d-nodo-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: { }
tolerations: [ ]
Expand All @@ -108,7 +107,7 @@ microservice-chart:
deployment:
create: true
image:
repository: ghcr.io/pagopa/yourname # TODO
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.0"
pullPolicy: Always
envConfig: { }
Expand Down
32 changes: 20 additions & 12 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
microservice-chart:
namespace: "your-namespace" # TODO: set your AKS namespace
namespace: "node-cfg-sync"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/yourname # TODO
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.0"
pullPolicy: Always
livenessProbe:
Expand All @@ -29,8 +29,8 @@ microservice-chart:
- 8080
ingress:
create: true
host: "your.host" # TODO: set the host
path: /your-path-here/(.*) # TODO: set your path
host: "weuprod.nodo.internal.platform.pagopa.it"
path: /node-cfg-sync/(.*)
servicePort: 8080
serviceAccount:
create: false
Expand All @@ -48,11 +48,11 @@ microservice-chart:
cpu: "0.25"
limits:
memory: "512Mi"
cpu: "0.25"
cpu: "0.5"
autoscaling:
enable: true
minReplica: 3
maxReplica: 10
minReplica: 1
maxReplica: 3
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
triggers:
Expand All @@ -62,14 +62,13 @@ microservice-chart:
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
envConfig:
# TODO: set your name
WEBSITE_SITE_NAME: 'yourProjectName' # required to show cloud role name in application insights
WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' # required to show cloud role name in application insights
ENV: 'azure-prod'
APP_LOGGING_LEVEL: 'INFO'
APP_LOGGING_LEVEL: 'DEBUG'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'

OTEL_SERVICE_NAME: # TODO
OTEL_SERVICE_NAME: "pagopa-node-cfg-sync"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=prod"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_TRACES_EXPORTER: otlp
Expand All @@ -81,7 +80,7 @@ microservice-chart:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-p-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
keyvault:
name: "pagopa-p-name-kv" #TODO
name: "pagopa-d-nodo-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: { }
tolerations: [ ]
Expand All @@ -94,6 +93,15 @@ microservice-chart:
operator: In
values:
- user
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: "pagopa-node-cfg-sync"
namespaces: [ "nodo" ]
topologyKey: topology.kubernetes.io/zone
canaryDelivery:
create: true
ingress:
Expand Down
24 changes: 12 additions & 12 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
microservice-chart:
namespace: "your-namespace" # TODO: set your AKS namespace
namespace: "node-cfg-sync"
nameOverride: ""
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/yourname # TODO
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.0"
pullPolicy: Always
livenessProbe:
Expand All @@ -29,8 +29,8 @@ microservice-chart:
- 8080
ingress:
create: true
host: "your.host" # TODO: set the host
path: /your-path-here/(.*) # TODO: set your path
host: "weuuat.nodo.internal.uat.platform.pagopa.it"
path: /node-cfg-sync/(.*)
servicePort: 8080
serviceAccount:
create: false
Expand All @@ -48,11 +48,11 @@ microservice-chart:
cpu: "0.25"
limits:
memory: "512Mi"
cpu: "0.25"
cpu: "0.5"
autoscaling:
enable: true
minReplica: 3
maxReplica: 10
minReplica: 1
maxReplica: 3
pollingInterval: 10 # seconds
cooldownPeriod: 50 # seconds
triggers:
Expand All @@ -62,13 +62,13 @@ microservice-chart:
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
envConfig:
# TODO: set your name
WEBSITE_SITE_NAME: 'yourProjectName' # required to show cloud role name in application insights
WEBSITE_SITE_NAME: 'pagopa-node-cfg-sync' # required to show cloud role name in application insights
ENV: 'azure-uat'
APP_LOGGING_LEVEL: 'DEBUG'
DEFAULT_LOGGING_LEVEL: 'INFO'
CORS_CONFIGURATION: '{"origins": ["*"], "methods": ["*"]}'
OTEL_SERVICE_NAME: # TODO

OTEL_SERVICE_NAME: "pagopa-node-cfg-sync"
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=uat"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector.elastic-system.svc:4317"
OTEL_TRACES_EXPORTER: otlp
Expand All @@ -80,7 +80,7 @@ microservice-chart:
APPLICATIONINSIGHTS_CONNECTION_STRING: 'ai-u-connection-string'
OTEL_EXPORTER_OTLP_HEADERS: elastic-apm-secret-token
keyvault:
name: "pagopa-u-name-kv" #TODO
name: "pagopa-d-nodo-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: { }
tolerations: [ ]
Expand All @@ -107,7 +107,7 @@ microservice-chart:
deployment:
create: true
image:
repository: ghcr.io/pagopa/yourname # TODO
repository: ghcr.io/pagopa/pagopa-node-cfg-sync
tag: "0.0.0"
pullPolicy: Always
envConfig: { }
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<version>2.7.3</version>
</parent>

<groupId>it.gov.pagopa.node-cfg</groupId>
<artifactId>job-manager</artifactId>
<groupId>it.gov.pagopa.node</groupId>
<artifactId>cfg-sync</artifactId>
<version>0.0.0</version>
<description>Microservice to update configuration schema of Nodo dei Pagamenti</description>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.gov.pagopa.microservice; // TODO: refactor the package
package it.gov.pagopa.node.cfg_sync;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.gov.pagopa.microservice.config;
package it.gov.pagopa.node.cfg_sync.config;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.JoinPoint;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package it.gov.pagopa.microservice.config;
package it.gov.pagopa.node.cfg_sync.config;


import org.modelmapper.ModelMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package it.gov.pagopa.microservice.config;

import static it.gov.pagopa.microservice.util.Constants.HEADER_REQUEST_ID;
package it.gov.pagopa.node.cfg_sync.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
Expand All @@ -15,6 +13,8 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;

import it.gov.pagopa.node.cfg_sync.util.Constants;
import org.springdoc.core.customizers.OpenApiCustomiser;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
Expand Down Expand Up @@ -97,12 +97,12 @@ public OpenApiCustomiser addCommonHeaders() {
.orElse(Collections.emptyList())
.parallelStream()
.filter(Objects::nonNull)
.anyMatch(elem -> HEADER_REQUEST_ID.equals(elem.getName()));
.anyMatch(elem -> Constants.HEADER_REQUEST_ID.equals(elem.getName()));
if (!header) {
value.addParametersItem(
new Parameter()
.in("header")
.name(HEADER_REQUEST_ID)
.name(Constants.HEADER_REQUEST_ID)
.schema(new StringSchema())
.description(
"This header identifies the call, if not passed it is self-generated. This ID is returned in the response."));
Expand All @@ -119,7 +119,7 @@ public OpenApiCustomiser addCommonHeaders() {
.forEach(
response ->
response.addHeaderObject(
HEADER_REQUEST_ID,
Constants.HEADER_REQUEST_ID,
new Header()
.schema(new StringSchema())
.description(
Expand Down
Loading

0 comments on commit 654780e

Please sign in to comment.