mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-01-20 20:01:25 +00:00
Create persistent volumes for minikube
Running the import works in minikube!
This commit is contained in:
parent
ad55cc03e5
commit
8a74f452a9
18
README.md
18
README.md
@ -46,6 +46,7 @@ kubectl apply -f secrets.yaml
|
||||
## Deploy the app
|
||||
```shell
|
||||
cd ./staging
|
||||
kubectl apply -f ./volumes
|
||||
kubectl apply -f neo4j-deployment.yaml -f backend-deployment.yaml -f web-deployment.yaml -f db-migration-worker-deployment.yaml
|
||||
```
|
||||
This can take a while.
|
||||
@ -68,3 +69,20 @@ kubectl expose deployment nitro-web --namespace=staging --type=LoadBalancer
|
||||
minikube service nitro-backend --namespace=staging
|
||||
minikube service nitro-web --namespace=staging
|
||||
```
|
||||
|
||||
|
||||
## Provisioning db-migration-worker
|
||||
Copy your private ssh key and the `.known-hosts` file of your remote legacy server.
|
||||
```shell
|
||||
|
||||
# check the corresponding db-migration-worker pod
|
||||
kubectl --namespace=staging get pods
|
||||
# change <POD_ID> below
|
||||
kubectl cp path/to/your/ssh/keys/folder staging/nitro-db-migration-worker-<POD_ID>:/root/
|
||||
```
|
||||
|
||||
Run the migration:
|
||||
```shell
|
||||
# change <POD_ID> below
|
||||
kubectl --namespace=staging exec -it nitro-db-migration-worker-<POD_ID> ./import.sh
|
||||
```
|
||||
|
||||
@ -58,6 +58,18 @@ spec:
|
||||
name: nitro-db-migration-worker
|
||||
resources: {}
|
||||
imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- mountPath: /root/
|
||||
name: ssh-keys-directory
|
||||
- mountPath: /mongo-export/
|
||||
name: mongo-export
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: ssh-keys-directory
|
||||
persistentVolumeClaim:
|
||||
claimName: ssh-keys-claim
|
||||
- name: mongo-export
|
||||
persistentVolumeClaim:
|
||||
claimName: mongo-export-claim
|
||||
terminationGracePeriodSeconds: 30
|
||||
status: {}
|
||||
|
||||
@ -46,5 +46,12 @@ spec:
|
||||
# - containerPort: 7473
|
||||
resources: {}
|
||||
imagePullPolicy: IfNotPresent
|
||||
volumeMounts:
|
||||
- mountPath: /mongo-export/
|
||||
name: mongo-export
|
||||
restartPolicy: Always
|
||||
volumes:
|
||||
- name: mongo-export
|
||||
persistentVolumeClaim:
|
||||
claimName: mongo-export-claim
|
||||
status: {}
|
||||
|
||||
11
staging/volumes/mongo-export-claim.yaml
Normal file
11
staging/volumes/mongo-export-claim.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: mongo-export-claim
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
12
staging/volumes/mongo-export-volume.yaml
Normal file
12
staging/volumes/mongo-export-volume.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: mongo-export-volume
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
hostPath:
|
||||
path: /data/shared/mongo-exports/
|
||||
11
staging/volumes/ssh-keys-volume-claim.yml
Normal file
11
staging/volumes/ssh-keys-volume-claim.yml
Normal file
@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: ssh-keys-claim
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Mi
|
||||
12
staging/volumes/ssh-keys-volume.yaml
Normal file
12
staging/volumes/ssh-keys-volume.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: ssh-keys-volume
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
capacity:
|
||||
storage: 1Mi
|
||||
hostPath:
|
||||
path: /data/pv0001/
|
||||
11
staging/volumes/uploads-claim.yaml
Normal file
11
staging/volumes/uploads-claim.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: uploads-claim
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 8Gi
|
||||
12
staging/volumes/uploads-volume.yaml
Normal file
12
staging/volumes/uploads-volume.yaml
Normal file
@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: uploads-volume
|
||||
namespace: staging
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
capacity:
|
||||
storage: 8Gi
|
||||
hostPath:
|
||||
path: /data/shared/uploads/
|
||||
Loading…
x
Reference in New Issue
Block a user