Commit bcd15a4b authored by Mohamed, Fawzi Roberto (fawzi)'s avatar Mohamed, Fawzi Roberto (fawzi)
Browse files

add userapi and watcher deployments and services

parent eb232c72
...@@ -495,11 +495,12 @@ EOF ...@@ -495,11 +495,12 @@ EOF
fi fi
echo " kubectl apply -f $targetF" echo " kubectl apply -f $targetF"
for imageType in beaker jupyter creedo remotevis ; do for imageType in beaker jupyter creedo remotevis userapi watcher; do
echo "## $imageType Initial setup: create container manager service" if [ "$imageType" != "watcher" ] ; then
if [ -n updateDeploy ]; then echo "## $imageType Initial setup: create container manager service"
cat >container-manager-service-$imageType.yaml <<HERE if [ -n updateDeploy ]; then
cat >container-manager-service-$imageType.yaml <<HERE
kind: Service kind: Service
apiVersion: v1 apiVersion: v1
metadata: metadata:
...@@ -514,12 +515,13 @@ spec: ...@@ -514,12 +515,13 @@ spec:
targetPort: 3003 targetPort: 3003
type: NodePort type: NodePort
HERE HERE
fi
echo " kubectl create -f container-manager-service-$imageType.yaml"
fi fi
echo " kubectl create -f container-manager-service-$imageType.yaml"
if [ -n "$updateDeploy" ]; then if [ -n "$updateDeploy" ]; then
targetF=container-manager-deploy-$imageType.yaml targetF=container-manager-deploy-$imageType.yaml
cat >$targetF <<HERE cat > $targetF <<HERE
apiVersion: apps/v1beta2 apiVersion: apps/v1beta2
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -545,13 +547,66 @@ spec: ...@@ -545,13 +547,66 @@ spec:
- name: nomad-container-manager - name: nomad-container-manager
image: $name image: $name
imagePullPolicy: $pullPolicy imagePullPolicy: $pullPolicy
ports:
- containerPort: 3003
HERE
if [ "$imageType" = "watcher" ]; then
cat >> $targetF <<HERE
command:
- npm
- start
- watcher
HERE
elif [ "$imageType" = "userapi" ]; then
cat >> $targetF <<HERE
command:
- npm
- start
- apiserver
readinessProbe:
httpGet:
path: "/userapi"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: "/userapi"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 30
periodSeconds: 30
HERE
else
cat >> $targetF <<HERE
command: command:
- npm - npm
- start - start
- webserver - webserver
ports: readinessProbe:
- containerPort: 3003 httpGet:
path: "/nmdalive"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: "/nmdalive"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 30
periodSeconds: 30
HERE
fi
cat >> $targetF <<HERE
env: env:
- name: MONGODB_URL
valueFrom:
secretKeyRef:
name: notebook-db-mongo-pwd
key: root-connect
- name: SESSION_DB_PASSWORD - name: SESSION_DB_PASSWORD
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
...@@ -607,20 +662,6 @@ EOF ...@@ -607,20 +662,6 @@ EOF
name: user-shared name: user-shared
- mountPath: "/nomad/nomadlab/user-data/private" - mountPath: "/nomad/nomadlab/user-data/private"
name: user-private name: user-private
readinessProbe:
httpGet:
path: "/nmdalive"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: "/nmdalive"
port: 3003
scheme: "$scheme"
initialDelaySeconds: 30
periodSeconds: 30
volumes: volumes:
- name: kube-certs - name: kube-certs
secret: secret:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment