From b58f3cdc1631c92e8c114da7825d5c70422c9f36 Mon Sep 17 00:00:00 2001 From: Kostas Filippopolitis Date: Wed, 24 Jul 2024 11:44:38 +0300 Subject: [PATCH] Added a volume for Portalbackend logs. --- kubernetes/templates/portalbackend.yaml | 52 +++++++++++++++++++++++++ kubernetes/values.yaml | 6 ++- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/kubernetes/templates/portalbackend.yaml b/kubernetes/templates/portalbackend.yaml index 6dc17737..c408e83a 100644 --- a/kubernetes/templates/portalbackend.yaml +++ b/kubernetes/templates/portalbackend.yaml @@ -91,6 +91,53 @@ spec: requests: storage: {{ .Values.portalbackend.storage.storage0.data_size }} +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: portalbackend-logs-vol0 + namespace: {{ .Values.namespace }} + labels: + storage: portalbackend-logs-storage0 +spec: + capacity: + storage: {{ .Values.portalbackend.logs.storage0.data_size }} + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + storageClassName: k8s-local-storage + hostPath: + path: {{ .Values.portalbackend.logs.storage0.data_path }} + type: DirectoryOrCreate + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: master + operator: In + values: + - "true" + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: portalbackend-logs-claim0 + namespace: {{ .Values.namespace }} + labels: + storage: portalbackend-logs-storage0 +spec: + selector: + matchLabels: + storage: portalbackend-logs-storage0 + storageClassName: k8s-local-storage + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.portalbackend.logs.storage0.data_size }} + --- apiVersion: apps/v1 kind: Deployment @@ -121,6 +168,9 @@ spec: - name: portalbackend-claim0 persistentVolumeClaim: claimName: portalbackend-claim0 + - name: portalbackend-logs-claim0 + persistentVolumeClaim: + claimName: portalbackend-logs-claim0 containers: - name: portalbackend-db image: {{ .Values.portalbackend_db.image.name }}:{{ .Values.portalbackend_db.image.version }} @@ -147,6 +197,8 @@ spec: volumeMounts: - name: portalbackend-claim0 mountPath: /opt/portal/api + - name: portalbackend-logs-claim0 + mountPath: /var/log/portalbackend env: - name: LOG_LEVEL valueFrom: diff --git a/kubernetes/values.yaml b/kubernetes/values.yaml index 1c12d560..0faaa922 100644 --- a/kubernetes/values.yaml +++ b/kubernetes/values.yaml @@ -41,11 +41,15 @@ portalbackend: ALGORITHM_UPDATE_INTERVAL: 60 # seconds image: name: hbpmip/portal-backend - version: 8.0.4 + version: 8.0.5 storage: storage0: data_path: /opt/mip-deployment/config data_size: 100Mi + logs: + storage0: + data_path: /opt/mip-deployment/logs + data_size: 100Mi gateway_db: image: