aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/moon_kubernetes/README.md38
-rw-r--r--tools/moon_kubernetes/conf/moon.conf (renamed from tools/moon/moon.conf)0
-rw-r--r--tools/moon_kubernetes/conf/ports.conf24
-rw-r--r--tools/moon_kubernetes/init_k8s.sh6
-rw-r--r--tools/moon_kubernetes/start_moon.sh24
-rw-r--r--tools/moon_kubernetes/templates/db.yaml31
-rw-r--r--tools/moon_kubernetes/templates/moon_forming.yaml (renamed from tools/moon_kubernetes/templates/moon_configuration.yaml)14
7 files changed, 56 insertions, 81 deletions
diff --git a/tools/moon_kubernetes/README.md b/tools/moon_kubernetes/README.md
index 7f26d276..a74a1321 100644
--- a/tools/moon_kubernetes/README.md
+++ b/tools/moon_kubernetes/README.md
@@ -28,11 +28,10 @@ apt-get install -y kubelet kubeadm kubectl
```
## Moon Deployment
-### Creation
-Execute the script : `init_k8s.sh`
+### Initiate K8S
```bash
+cd $MOON_HOME/tools/moon_kubernes
sudo bash init_k8s.sh
-watch kubectl get po --namespace=kube-system
```
Wait until all the kubeadm containers are in the `running` state:
@@ -55,11 +54,10 @@ You must see something like this:
kube-scheduler-varuna 1/1 Running 0 1h
-### Execution
-Execute the script : `start_moon.sh`
+### Deploy Moon
```bash
+cd $MOON_HOME/tools/moon_kubernes
sudo bash start_moon.sh
-watch kubectl get po --namespace=moon
```
Wait until all the Moon containers are in the `running` state:
@@ -79,4 +77,30 @@ You must see something like this:
manager-5bfbb96988-fg8vj 1/1 Running 0 51m
manager-5bfbb96988-w9wnk 1/1 Running 0 51m
orchestrator-65d8fb4574-tnfx2 1/1 Running 0 51m
- wrapper-astonishing-748b7dcc4f-ngsvp 1/1 Running 0 51m \ No newline at end of file
+ wrapper-astonishing-748b7dcc4f-ngsvp 1/1 Running 0 51m
+
+### Docker-K8S Port Mapping
+```yamlex
+manager:
+ port: 8082
+ kport: 30001
+gui:
+ port: 3000
+ kport: 30002
+orchestrator:
+ port: 8083
+ kport: 30003
+consul:
+ port: 8500
+ kport: 30005
+keystone:
+ port: 5000
+ kport: 30006
+wrapper:
+ port: 8080
+ kport: 30010
+interface:
+ port: 8080
+authz:
+ port: 8081
+```
diff --git a/tools/moon/moon.conf b/tools/moon_kubernetes/conf/moon.conf
index a5a40ad2..a5a40ad2 100644
--- a/tools/moon/moon.conf
+++ b/tools/moon_kubernetes/conf/moon.conf
diff --git a/tools/moon_kubernetes/conf/ports.conf b/tools/moon_kubernetes/conf/ports.conf
deleted file mode 100644
index 487945c0..00000000
--- a/tools/moon_kubernetes/conf/ports.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-manager:
- port: 8082
- kport: 30001
-gui:
- port: 3000
- kport: 30002
-orchestrator:
- port: 8083
- kport: 30003
-
-consul:
- port: 8500
- kport: 30005
-keystone:
- port: 5000
- kport: 30006
-
-wrapper:
- port: 8080
- kport: 30010
-interface:
- port: 8080
-authz:
- port: 8081
diff --git a/tools/moon_kubernetes/init_k8s.sh b/tools/moon_kubernetes/init_k8s.sh
index 6eb94e78..ab9a4503 100644
--- a/tools/moon_kubernetes/init_k8s.sh
+++ b/tools/moon_kubernetes/init_k8s.sh
@@ -6,8 +6,8 @@ sudo kubeadm reset
sudo swapoff -a
-sudo kubeadm init --pod-network-cidr=192.168.0.0/16
-#sudo kubeadm init --pod-network-cidr=10.244.0.0/16
+sudo kubeadm init --pod-network-cidr=192.168.0.0/16 # network for Calico
+#sudo kubeadm init --pod-network-cidr=10.244.0.0/16 # network for Canal
mkdir -p $HOME/.kube
sudo cp -f /etc/kubernetes/admin.conf $HOME/.kube/config
@@ -22,7 +22,7 @@ kubectl apply -f http://docs.projectcalico.org/v2.4/getting-started/kubernetes/i
kubectl delete deployment kube-dns --namespace=kube-system
kubectl apply -f kubernetes/templates/kube-dns.yaml
-kubectl taint nodes --all node-role.kubernetes.io/master-
+kubectl taint nodes --all node-role.kubernetes.io/master- # make the master also as a node
kubectl proxy&
sleep 5
diff --git a/tools/moon_kubernetes/start_moon.sh b/tools/moon_kubernetes/start_moon.sh
index 8121e319..3892a3fa 100644
--- a/tools/moon_kubernetes/start_moon.sh
+++ b/tools/moon_kubernetes/start_moon.sh
@@ -5,33 +5,31 @@ set -x
kubectl create namespace moon
kubectl create configmap moon-config --from-file conf/moon.conf -n moon
kubectl create configmap config --from-file ~/.kube/config -n moon
-kubectl create secret generic mysql-root-pass --from-file=kubernetes/conf/password_root.txt -n moon
-kubectl create secret generic mysql-pass --from-file=kubernetes/conf/password_moon.txt -n moon
+kubectl create secret generic mysql-root-pass --from-file=conf/password_root.txt -n moon
+kubectl create secret generic mysql-pass --from-file=conf/password_moon.txt -n moon
-kubectl create -n moon -f kubernetes/templates/consul.yaml
-kubectl create -n moon -f kubernetes/templates/db.yaml
-kubectl create -n moon -f kubernetes/templates/keystone.yaml
+kubectl create -n moon -f templates/consul.yaml
+kubectl create -n moon -f templates/db.yaml
+kubectl create -n moon -f templates/keystone.yaml
echo =========================================
kubectl get pods -n moon
echo =========================================
sleep 10
-kubectl create -n moon -f kubernetes/templates/moon_configuration.yaml
+kubectl create -n moon -f templates/moon_forming.yaml
-echo Waiting for jobs moonforming
+echo Waiting for jobs forming
sleep 5
kubectl get jobs -n moon
-kubectl logs -n moon jobs/moonforming
+kubectl logs -n moon jobs/forming
sleep 5
-
-kubectl create -n moon -f kubernetes/templates/moon_manager.yaml
+kubectl create -n moon -f templates/moon_manager.yaml
sleep 2
+kubectl create -n moon -f templates/moon_orchestrator.yaml
-kubectl create -n moon -f kubernetes/templates/moon_orchestrator.yaml
-
-kubectl create -n moon -f kubernetes/templates/moon_gui.yaml
+kubectl create -n moon -f templates/moon_gui.yaml
diff --git a/tools/moon_kubernetes/templates/db.yaml b/tools/moon_kubernetes/templates/db.yaml
index 38418643..a055507e 100644
--- a/tools/moon_kubernetes/templates/db.yaml
+++ b/tools/moon_kubernetes/templates/db.yaml
@@ -1,33 +1,3 @@
-#apiVersion: v1
-#kind: PersistentVolume
-#metadata:
-# name: local-pv-1
-# labels:
-# type: local
-#spec:
-# capacity:
-# storage: 5Gi
-# accessModes:
-# - ReadWriteOnce
-# hostPath:
-# path: /tmp/data/pv-1
-#---
-#
-#apiVersion: v1
-#kind: PersistentVolumeClaim
-#metadata:
-# name: mysql-pv-claim
-# labels:
-# platform: moon
-# app: db
-#spec:
-# accessModes:
-# - ReadWriteOnce
-# resources:
-# requests:
-# storage: 5Gi
-#---
-
apiVersion: apps/v1beta1
kind: Deployment
metadata:
@@ -71,6 +41,7 @@ spec:
# persistentVolumeClaim:
# claimName: mysql-pv-claim
---
+
apiVersion: v1
kind: Service
metadata:
diff --git a/tools/moon_kubernetes/templates/moon_configuration.yaml b/tools/moon_kubernetes/templates/moon_forming.yaml
index 3bcaa533..efcc51d8 100644
--- a/tools/moon_kubernetes/templates/moon_configuration.yaml
+++ b/tools/moon_kubernetes/templates/moon_forming.yaml
@@ -1,25 +1,31 @@
apiVersion: batch/v1
kind: Job
metadata:
- name: moonforming
+ name: forming
namespace: moon
spec:
template:
metadata:
- name: moonforming
+ name: forming
spec:
containers:
- - name: moonforming
- image: asteroide/moonforming:v1.3
+ - name: forming
+ image: wukongsun/moon_forming:v1.3
env:
- name: POPULATE_ARGS
value: "--verbose" # debug mode: --debug
volumeMounts:
- name: config-volume
mountPath: /etc/moon
+ - name: test-volume
+ mountPath: /data
volumes:
- name: config-volume
configMap:
name: moon-config
+ - name: test-volume
+ hostPath:
+ path: tests/functional/scenario_enabled
+ type: Directory
restartPolicy: Never
#backoffLimit: 4 \ No newline at end of file