Skip to content

Commit

Permalink
replica deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo-catalano committed Mar 28, 2024
1 parent 92ad8d5 commit 644bf1d
Show file tree
Hide file tree
Showing 4 changed files with 205 additions and 0 deletions.
10 changes: 10 additions & 0 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ dependencies:
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: postgresql
condition: postgresql.enabled
- name: microservice-chart
version: 3.0.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
alias: postgresql-replica
condition: postgresql.enabled
- name: microservice-chart
version: 3.0.0
repository: "https://pagopa.github.io/aks-microservice-chart-blueprint"
Expand All @@ -29,6 +34,11 @@ dependencies:
repository: "https://pagopa.github.io/aks-cron-chart-blueprint"
alias: refresh-p
condition: postgresql.enabled
- name: cron-chart
version: 2.6.0
repository: "https://pagopa.github.io/aks-cron-chart-blueprint"
alias: refresh-p-replica
condition: postgresql.enabled
- name: cron-chart
version: 2.6.0
repository: "https://pagopa.github.io/aks-cron-chart-blueprint"
Expand Down
62 changes: 62 additions & 0 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ postgresql:
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
postgresql-replica:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /api-config-cache/pr(/|$)(.*)
envConfig:
!!merge <<: *envConfig
APPLICATIONINSIGHTS_ROLE_NAME: "pagopa-api-config-cache-postgresql-replica"
DB_CONFIG_URL: "jdbc:postgresql://ndp.d.db-nodo-pagamenti.com:6432/nodo-replica?sslmode=require&prepareThreshold=0&currentSchema=cfg"
DB_CONFIG_USER: "cfg"
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "pr"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "false"
SEND_EVENT: "false"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
oracle:
!!merge <<: *microservice-chart
ingress:
Expand Down Expand Up @@ -183,6 +203,48 @@ refresh-p:
operator: In
values:
- user
refresh-p-replica:
namespace: "apiconfig"
schedule: "0 0 * * *"
timeZone: "Europe/Rome"
image:
repository: "curlimages/curl"
tag: "latest"
pullPolicy: "Always"
command:
- "curl"
- "-k"
- "-m"
- "\"300\""
- "--header"
- "\"Ocp-Apim-Subscription-Key: $(API_CONFIG_CACHE_SUBSCRIPTION_KEY)\""
- "https://api.dev.platform.pagopa.it/api-config-cache/pr/v1/cache/refresh"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "150m"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key"
tolerations:
- key: dedicated
operator: Equal
value: "apiconfig"
effect: NoSchedule
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node_type
operator: In
values:
- user
refresh-o:
namespace: "apiconfig"
schedule: "0 0 * * *"
Expand Down
71 changes: 71 additions & 0 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,26 @@ postgresql:
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
postgresql-replica:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /api-config-cache/p(/|$)(.*)
envConfig:
!!merge <<: *envConfig
APPLICATIONINSIGHTS_ROLE_NAME: "pagopa-api-config-cache-postgresql-replica"
DB_CONFIG_URL: "jdbc:postgresql://nodo-db.p.internal.postgresql.pagopa.it:6432/nodo-replica?sslmode=require&prepareThreshold=0&currentSchema=cfg"
DB_CONFIG_USER: "cfg"
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "pr"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "false"
SEND_EVENT: "false"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
oracle:
!!merge <<: *microservice-chart
ingress:
Expand Down Expand Up @@ -191,6 +211,57 @@ refresh-p:
app.kubernetes.io/instance: "cache"
namespaces: ["apiconfig"]
topologyKey: topology.kubernetes.io/zone
refresh-p-replica:
namespace: "apiconfig"
schedule: "0 0 * * *"
timeZone: "Europe/Rome"
image:
repository: "curlimages/curl"
tag: "latest"
pullPolicy: "Always"
command:
- "curl"
- "-k"
- "-m"
- "\"300\""
- "--header"
- "\"Ocp-Apim-Subscription-Key: $(API_CONFIG_CACHE_SUBSCRIPTION_KEY)\""
- "https://api.platform.pagopa.it/api-config-cache/pr/v1/cache/refresh"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "150m"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key"
tolerations:
- key: dedicated
operator: Equal
value: "apiconfig"
effect: NoSchedule
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node_type
operator: In
values:
- user
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/instance: "cache"
namespaces: ["apiconfig"]
topologyKey: topology.kubernetes.io/zone
refresh-o:
namespace: "apiconfig"
schedule: "0 0 * * *"
Expand Down
62 changes: 62 additions & 0 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,26 @@ postgresql:
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
postgresql-replica:
!!merge <<: *microservice-chart
ingress:
!!merge <<: *ingress
path: /api-config-cache/p(/|$)(.*)
envConfig:
!!merge <<: *envConfig
APPLICATIONINSIGHTS_ROLE_NAME: "pagopa-api-config-cache-postgresql-replica"
DB_CONFIG_URL: "jdbc:postgresql://nodo-db.u.internal.postgresql.pagopa.it:6432/nodo-replica?sslmode=require&prepareThreshold=0&currentSchema=cfg"
DB_CONFIG_USER: "cfg"
DB_CONFIG_DRIVER: "org.postgresql.Driver"
DATABASE_ID: "pr"
HEALTHCHECK_QUERY: "select 1"
SAVE_DB: "false"
SEND_EVENT: "false"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
DB_CONFIG_PASSWORD: "postgresql-db-cfg-password"
oracle:
!!merge <<: *microservice-chart
ingress:
Expand Down Expand Up @@ -149,6 +169,48 @@ refresh-p:
operator: In
values:
- user
refresh-p-replica:
namespace: "apiconfig"
schedule: "0 0 * * *"
timeZone: "Europe/Rome"
image:
repository: "curlimages/curl"
tag: "latest"
pullPolicy: "Always"
command:
- "curl"
- "-k"
- "-m"
- "\"300\""
- "--header"
- "\"Ocp-Apim-Subscription-Key: $(API_CONFIG_CACHE_SUBSCRIPTION_KEY)\""
- "https://api.uat.platform.pagopa.it/api-config-cache/pr/v1/cache/refresh"
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "150m"
secretProvider:
!!merge <<: *azureSecretProvider
envSecrets:
!!merge <<: *envSecret
API_CONFIG_CACHE_SUBSCRIPTION_KEY: "cfg-for-node-subscription-key"
tolerations:
- key: dedicated
operator: Equal
value: "apiconfig"
effect: NoSchedule
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node_type
operator: In
values:
- user
refresh-o:
namespace: "apiconfig"
schedule: "0 0 * * *"
Expand Down

0 comments on commit 644bf1d

Please sign in to comment.