Skip to content

Commit

Permalink
helm
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Oct 25, 2023
1 parent 7588dc6 commit 6dca309
Show file tree
Hide file tree
Showing 5 changed files with 603 additions and 416 deletions.
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:

image:
repository: ghcr.io/pagopa/ubuntu-vm
tag: 1.2.0
tag: 1.8.0
pullPolicy: Always

deployment:
Expand Down
93 changes: 93 additions & 0 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
microservice-chart:
namespace: "apiconfig"
nameOverride: "ubuntu-vm"

image:
repository: ghcr.io/pagopa/ubuntu-vm
tag: 1.8.0
pullPolicy: Always

deployment:
create: true
replicas: 1

tmpVolumeMount:
create: true
mounts:
- name: tmp
mountPath: /tmp
- name: logs
mountPath: /app/logs

livenessProbe:
httpGet:
path: /status/live
port: 8080
initialDelaySeconds: 30
failureThreshold: 6
periodSeconds: 10
readinessProbe:
httpGet:
path: /status/ready
port: 8080
initialDelaySeconds: 30
failureThreshold: 6
periodSeconds: 10

service:
create: true
type: ClusterIP
ports:
- 8080
ingress:
create: true
host: "weuprod.apiconfig.internal.platform.pagopa.it"
path: /ubuntu/(.*)
servicePort: 8080

serviceAccount:
create: false
annotations: {}
name: ""

podAnnotations: {}
podSecurityContext:
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
capabilities:
drop:
- all

resources:
requests:
memory: "256Mi"
cpu: "40m"
limits:
memory: "256Mi"
cpu: "150m"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
pollingInterval: 30 # seconds
cooldownPeriod: 300 # seconds
triggers:
- type: cpu
metadata:
type: Utilization
value: "60"

envConfig:
SPRING_DATASOURCE_USERNAME: 'NODO4_CFG'
SPRING_DATASOURCE_HOST: 'db-nodo-pagamenti.p.db-nodo-pagamenti.com/NDPSPCP_NODO4_CFG'
SPRING_DATASOURCE_PORT: '1521'
envSecret:
SPRING_DATASOURCE_PASSWORD: 'oracle-db-cfg-password'
keyvault:
name: "pagopa-d-apiconfig-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"


93 changes: 93 additions & 0 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
microservice-chart:
namespace: "apiconfig"
nameOverride: "ubuntu-vm"

image:
repository: ghcr.io/pagopa/ubuntu-vm
tag: 1.8.0
pullPolicy: Always

deployment:
create: true
replicas: 1

tmpVolumeMount:
create: true
mounts:
- name: tmp
mountPath: /tmp
- name: logs
mountPath: /app/logs

livenessProbe:
httpGet:
path: /status/live
port: 8080
initialDelaySeconds: 30
failureThreshold: 6
periodSeconds: 10
readinessProbe:
httpGet:
path: /status/ready
port: 8080
initialDelaySeconds: 30
failureThreshold: 6
periodSeconds: 10

service:
create: true
type: ClusterIP
ports:
- 8080
ingress:
create: true
host: "weuuat.apiconfig.internal.uat.platform.pagopa.it"
path: /ubuntu/(.*)
servicePort: 8080

serviceAccount:
create: false
annotations: {}
name: ""

podAnnotations: {}
podSecurityContext:
seccompProfile:
type: RuntimeDefault
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
capabilities:
drop:
- all

resources:
requests:
memory: "256Mi"
cpu: "40m"
limits:
memory: "256Mi"
cpu: "150m"
autoscaling:
enable: true
minReplica: 1
maxReplica: 1
pollingInterval: 30 # seconds
cooldownPeriod: 300 # seconds
triggers:
- type: cpu
metadata:
type: Utilization
value: "60"

envConfig:
SPRING_DATASOURCE_USERNAME: 'PP_NODO4_CFG'
SPRING_DATASOURCE_HOST: 'db-nodo-pagamenti.u.db-nodo-pagamenti.com/NDPSPCA_NODO4_CFG'
SPRING_DATASOURCE_PORT: '1524'
envSecret:
SPRING_DATASOURCE_PASSWORD: 'oracle-db-cfg-password'
keyvault:
name: "pagopa-d-apiconfig-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"


11 changes: 6 additions & 5 deletions scripts/connect_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@


connection = oracledb.connect(
dsn="db-nodo-pagamenti.d.db-nodo-pagamenti.com/NDPSPCT_PP_NODO4_CFG",
port=1522,
dsn=os.environ['SPRING_DATASOURCE_HOST'],
port=int(os.environ['SPRING_DATASOURCE_PORT']),
user=os.environ['SPRING_DATASOURCE_USERNAME'],
password=os.environ['SPRING_DATASOURCE_PASSWORD']
)
Expand All @@ -24,9 +24,10 @@
tax_code = row[8]
psp_codes = row[2]
for psp_code in psp_codes.split(','):
print(f'\t PSP {psp_code} set taxcode {tax_code}')
line_count += 1
values.append((tax_code, psp_code))
if len(psp_code) > 0:
print(f'\t PSP {psp_code} set taxcode {tax_code}')
line_count += 1
values.append((tax_code, psp_code))

print("Executing query...")
cursor = connection.cursor()
Expand Down
Loading

0 comments on commit 6dca309

Please sign in to comment.