Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion charts/microservice-chart/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# microservice-chart

![Version: 8.0.2](https://img.shields.io/badge/Version-8.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)
![Version: 8.0.3](https://img.shields.io/badge/Version-8.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)

A Helm chart for PagoPA microservice

Expand All @@ -20,6 +20,7 @@ A Helm chart for PagoPA microservice
| azure | object | `{"workloadIdentityClientId":"","workloadIdentityEnabled":true}` | Azure configuration (e.g. Workload identities) |
| azure.workloadIdentityClientId | string | `""` | Azure Workload Identity Client ID (e.g. qwerty123-a1aa-1234-xyza-qwerty123) |
| azure.workloadIdentityEnabled | bool | `true` | Enable workload identity |
| azureFile | object | `{"create":false}` | Azure File |
| canaryDelivery | object | - | This section allow to configure canary deployment |
| canaryDelivery.create | bool | `false` | Beta/Enable Canary/BlueGreen Deployment |
| canaryDelivery.ingress | object | `{"bluegreen":false,"envConfig":{},"envSecret":{},"header":true,"headerName":"X-Canary","headerValue":"pagopa","image":{"repository":"","tag":""},"weightPercent":10}` | Configure how ingress canary should be |
Expand Down Expand Up @@ -62,6 +63,7 @@ A Helm chart for PagoPA microservice
| ingress.proxyBodySize | string | `"1m"` | the size allowed by nginx.ingress.kubernetes.io/proxy-body-size for client request body |
| ingress.rewriteTarget | string | `"/$1"` | the rewrite target for ingress |
| ingress.servicePort | int | `8080` | service port to reach |
| initContainers | list | `[]` | Init Containers |
| keyvault | object | `{"name":"","tenantId":""}` | Configure keyvault to use inside secret prover to load secret directly |
| keyvault.name | string | `""` | Key vault name |
| keyvault.tenantId | string | `""` | Tenant ID |
Expand Down
35 changes: 35 additions & 0 deletions charts/microservice-chart/templates/deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,30 @@ spec:
{{- with .Values.sidecars }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.initContainers }}
initContainers:
{{- range .Values.initContainers }}
- name: {{ .name }}
imagePullPolicy: {{ .image.pullPolicy }}
image: "{{ .image.repository }}:{{ .image.tag }}"
{{- if not (empty .command) }}
command:
{{- toYaml .command | nindent 12 }}
{{- end }}
{{- if not (empty .args) }}
args:
{{- toYaml .args | nindent 12 }}
{{- end }}
volumeMounts:
#<tmp folders>
{{- if .tmpVolumeMount.create }}
{{- range $i, $val := .tmpVolumeMount.mounts }}
- name: {{ $val.name }}
mountPath: {{ $val.mountPath }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
volumes:
#<tmp volume>
{{- if .Values.tmpVolumeMount.create }}
Expand Down Expand Up @@ -322,6 +346,17 @@ spec:
path: {{ $v.key }}
{{- end }}
{{- end }}
#<azureFile volume>
{{- if .Values.azureFile.create }}
{{- range $i, $val := .Values.azureFile.mounts }}
- name: {{ $val.name }}
azureFile:
secretName: {{ include "microservice-chart.fullname" $ }}
shareName: {{ $val.shareName }}
readOnly: {{ $val.readOnly }}
{{- end }}
{{- end }}
#</azureFile volume>
restartPolicy: {{ .Values.restartPolicy }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.nodeSelector }}
Expand Down
7 changes: 7 additions & 0 deletions charts/microservice-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,10 @@ postman-test:
collectionName: ""
# -- env variable name path (e.g `dev.postman_environment.json``)
envVariablesFile: ""

# -- Init Containers
initContainers: []

# -- Azure File
azureFile:
create: false
10 changes: 10 additions & 0 deletions examples/init-containers/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v2
name: delete-me
description: test test
type: application
version: 2.0.0
appVersion: 2.3.6-13-transactional
dependencies:
- name: microservice-chart
version: 8.0.4
repository: "file://../../charts/microservice-chart"
6 changes: 6 additions & 0 deletions examples/init-containers/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
rm Chart.lock
rm -R charts
helm dependency build
helm template --values ./values-dev.yaml umberto-init-container ./
helm upgrade --namespace diego --install --values ./values-dev.yaml --wait --timeout 5m0s umberto-init-container ./
100 changes: 100 additions & 0 deletions examples/init-containers/values-dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
microservice-chart:
namespace: "diego"
nameOverride: ""
fullnameOverride: ""

image:
repository: ghcr.io/pagopa/devops-java-springboot-color
tag: 0.10.0
volumeMounts:
- mountPath: /mnt/truststore/
name: truststore
initContainers:
- name: test
image:
repository: busybox
tag: "1.36"
pullPolicy: Always
command: ['sh', '-c', "mkdir -p /mnt/truststore/ && cp /mnt/share/* /mnt/truststore/"]
tmpVolumeMount:
create: true
mounts:
- name: share-volume
mountPath: /mnt/share
- name: truststore
mountPath: "/mnt/truststore/"
tmpVolumeMount:
create: true
mounts:
- name: truststore
mountPath: "/mnt/truststore/"
azureFile:
create: true
mounts:
- shareName: test-umberto
name: share-volume
readOnly: true

providedVolumeMount:
create: false

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

deployment:
create: true
secretProviderClass:
create: false

podAnnotations: {}
podSecurityContext:
seccompProfile:
type: RuntimeDefault
securityContext:
readOnlyRootFilesystem: false
allowPrivilegeEscalation: false
capabilities:
drop:
- all
-
resources:
requests:
memory: "512Mi"
cpu: "0.40"
limits:
memory: "512Mi"
cpu: "0.5"
autoscaling:
enable: true
minReplica: 1
maxReplica: 2
pollingInterval: 30 # seconds
cooldownPeriod: 60 # seconds
triggers:
- type: cpu
metadata:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "75"
azure:
workloadIdentityClientId: '1669c3db-c4f4-46fb-9324-0b7868dd59c1'
serviceAccount:
name: "diego-workload-identity"

keyvault:
name: "dvopla-d-itn-diego-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
envSecret:
STORAGE_ACCOUNT_KEY: "azurestorageaccountkey"
Loading