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..a8c1d6bf 100644 --- a/kubernetes/values.yaml +++ b/kubernetes/values.yaml @@ -46,6 +46,10 @@ portalbackend: storage0: data_path: /opt/mip-deployment/config data_size: 100Mi + logs: + storage0: + data_path: /opt/mip-deployment/logs + data_size: 100Mi gateway_db: image: