From 0808de00208ff609321e379ccc96be15b97ea712 Mon Sep 17 00:00:00 2001 From: ycz008 Date: Fri, 15 Sep 2023 14:16:28 +0800 Subject: [PATCH] fix: mysql terminated --- dev-upgrade/mongo/mongo.yaml | 52 +++++++++--------------------------- 1 file changed, 13 insertions(+), 39 deletions(-) diff --git a/dev-upgrade/mongo/mongo.yaml b/dev-upgrade/mongo/mongo.yaml index 5bb90df..2466248 100644 --- a/dev-upgrade/mongo/mongo.yaml +++ b/dev-upgrade/mongo/mongo.yaml @@ -1,33 +1,3 @@ - ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: mongo-dev-0 - labels: - type: local -spec: - storageClassName: local-mongo - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - local: - path: /data/dev/mongo - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: app.kubernetes.io/name - operator: In - values: - - trainer - - key: kubernetes.io/hostname - operator: In - values: - - bfs-k8snode-10-2-0-12.hetzner.base.beaconfireinc.com - ---- apiVersion: apps/v1 kind: StatefulSet metadata: @@ -57,15 +27,19 @@ spec: volumeMounts: - name: mongo-data mountPath: /data/db - volumeClaimTemplates: - - metadata: - name: mongo-data - spec: - accessModes: ['ReadWriteOnce'] - storageClassName: local-mongo - resources: - requests: - storage: 5Gi + volumes: + - name: mongo-data + hostPath: + path: /data/dev/mongo + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: "kubernetes.io/hostname" + operator: In + values: + - bfs-k8snode-10-2-0-12.hetzner.base.beaconfireinc.com --- apiVersion: v1