Skip to content

Commit

Permalink
fix start_deps.sh bug and add volumns
Browse files Browse the repository at this point in the history
  • Loading branch information
alec-z committed Aug 4, 2020
1 parent af0bd9a commit 212baad
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 1 deletion.
85 changes: 84 additions & 1 deletion deployments/kubernetes/kie-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ spec:
labels:
component: servicecomb-kie
spec:
volumes:
- name: mongo-data-pvs
persistentVolumeClaim:
claimName: mongo-data-pvc
- name: mongo-init-pvs
persistentVolumeClaim:
claimName: mongo-init-pvc
initContainers:
- name: down-init-db-js
image: busybox
volumeMounts:
- name: mongo-init-pvs
mountPath: "/init"
command: ['wget', '-nc', 'https://raw.githubusercontent.com/apache/servicecomb-kie/master/deployments/db.js','-O', '/init/db.js']
containers:
- name: servicecomb-kie
image: servicecomb/kie:latest
Expand Down Expand Up @@ -39,6 +53,11 @@ spec:
image: mongo:4.0
ports:
- containerPort: 27017
volumeMounts:
- mountPath: "/data/db"
name: mongo-data-pvs
- mountPath: "/docker-entrypoint-initdb.d"
name: mongo-init-pvs
env:
- name: MONGO_INITDB_DATABASE
value: kie
Expand All @@ -48,6 +67,7 @@ spec:
value: '123'

---

apiVersion: v1
kind: Service
metadata:
Expand All @@ -71,4 +91,67 @@ spec:
port: 27017
targetPort: 27017
nodePort: 30112
protocol: TCP
protocol: TCP

---

apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-data-pv
labels:
type: local
spec:
storageClassName: mongo-data
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mongo_data"
type: DirectoryOrCreate

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-data-pvc
spec:
storageClassName: mongo-data
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---

apiVersion: v1
kind: PersistentVolume
metadata:
name: mongo-init-pv
labels:
type: local
spec:
storageClassName: mongo-init
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
hostPath:
path: "/mongo_init"
type: DirectoryOrCreate

---

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongo-init-pvc
spec:
storageClassName: mongo-init
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
1 change: 1 addition & 0 deletions scripts/travis/start_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@

cd build
bash build_docker.sh
cd "../$(dirname "$0")"
sudo docker-compose -f ../../deployments/docker/docker-compose.yaml down
sudo docker-compose -f ../../deployments/docker/docker-compose.yaml up -d

0 comments on commit 212baad

Please sign in to comment.