diff --git a/devspc/PersistentVolume.yaml b/devspc/PersistentVolume.yaml new file mode 100644 index 0000000..2e97b43 --- /dev/null +++ b/devspc/PersistentVolume.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: local-storage-pv +spec: + capacity: + storage: 30Gi # Размер (логический, не резервируется) + volumeMode: Filesystem + accessModes: +# - ReadWriteOnce # Для одного пода + - ReadWriteMany # Можно указать, но hostPath не гарантирует многоподовый доступ на разных нодах + persistentVolumeReclaimPolicy: Retain # При удалении PVC данные не удалять + hostPath: + path: /devx/dependencies # Папка на узле, где работает Kubernetes + type: DirectoryOrCreate # Создаст её, если нет \ No newline at end of file diff --git a/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml b/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml index 7d2b20c..67d58be 100644 --- a/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml +++ b/devspc/devspace-apiregistry-generator-service/templates/deployment.yaml @@ -55,6 +55,9 @@ spec: items: - key: application.yaml path: application.yaml + - name: dependencies-data + persistentVolumeClaim: + claimName: "{{$.Release.Name}}-{{$.Values.name}}-dependencies" securityContext: {{- toYaml $.Values.podSecurityContext | nindent 8 }} containers: @@ -69,6 +72,8 @@ spec: volumeMounts: - mountPath: '/opt/app/config' name: application-properties-volume + - name: dependencies-data + mountPath: /storage ports: - name: http containerPort: {{ $.Values.port }} @@ -86,7 +91,7 @@ spec: httpGet: path: '/actuator/health/readiness' port: management - initialDelaySeconds: 25 + initialDelaySeconds: 10 periodSeconds: 10 {{- if $.Values.resources}} resources: diff --git a/devspc/devspace-apiregistry-generator-service/templates/pvc.yaml b/devspc/devspace-apiregistry-generator-service/templates/pvc.yaml new file mode 100644 index 0000000..7df2107 --- /dev/null +++ b/devspc/devspace-apiregistry-generator-service/templates/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: "{{$.Release.Name}}-{{$.Values.name}}-dependencies" +spec: + accessModes: + - ReadWriteMany # Должно совпадать с PV + volumeMode: Filesystem + resources: + requests: + storage: 30Gi \ No newline at end of file