diff --git a/dev-upgrade/mongo/mongo.yaml b/dev-upgrade/mongo/mongo-dev.yaml similarity index 51% rename from dev-upgrade/mongo/mongo.yaml rename to dev-upgrade/mongo/mongo-dev.yaml index 98afb0d..5bb90df 100644 --- a/dev-upgrade/mongo/mongo.yaml +++ b/dev-upgrade/mongo/mongo-dev.yaml @@ -1,3 +1,33 @@ + +--- +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: @@ -13,19 +43,6 @@ spec: labels: app: mongo spec: - initContainers: - - name: init - image: busybox - imagePullPolicy: IfNotPresent - command: - - sh - - -c - - | - sysctl -w net.ipv4.tcp_keepalive_time=300 - sysctl -w net.ipv4.tcp_keepalive_intvl=10 - sysctl -w net.ipv4.tcp_keepalive_probes=3 - securityContext: - privileged: true containers: - name: mongo image: mongo:6.0.6 @@ -40,19 +57,15 @@ spec: volumeMounts: - name: mongo-data mountPath: /data/db - 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 + volumeClaimTemplates: + - metadata: + name: mongo-data + spec: + accessModes: ['ReadWriteOnce'] + storageClassName: local-mongo + resources: + requests: + storage: 5Gi --- apiVersion: v1