Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
container-manager
Commits
6fb1b843
Commit
6fb1b843
authored
Nov 04, 2018
by
Mohamed, Fawzi Roberto (fawzi)
Browse files
cron job for services update
parent
1a2cc7b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
deploy.sh
View file @
6fb1b843
...
...
@@ -378,6 +378,82 @@ echo " kubectl create secret generic ${secretWebCerts} --from-file=key.pem=key.
echo
" popd"
echo
echo
"# create cron job updating info on services"
if
[
-n
updateDeploy
]
;
then
targetF
=
service-dumper.yaml
cat
>
"
$targetF
"
<<
EOF
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/15 * * * *"
jobTemplate:
spec:
template:
spec:
metadata:
labels:
app: nomad-container-manager-dumper
imagePullSecrets:
- name: garching-kube
restartPolicy: OnFailure
containers:
- name: dumper
image:
$name
imagePullPolicy:
$pullPolicy
command:
- node
- app.js
- serviceDumper
- --out-file
- /services-info/
$target_hostname
.services.yaml
env:
- name: KUBERNETES_SERVER_URL
valueFrom:
secretKeyRef:
name: kube-certs
key: server.url
- name: KUBERNETES_NODE
valueFrom:
secretKeyRef:
name: kube-certs
key: node.addr
- name: NODE_ENV
value: "
$NODE_ENV
"
- name: NODE_APP_INSTANCE
value: "
$imageType
"
volumeMounts:
- mountPath: "/services-info"
name: services-info
EOF
if
[
-n
"
$debug
"
]
;
then
cat
>>
$targetF
<<
EOF
- mountPath: "/usr/src/app"
name: app-source
EOF
fi
cat
>>
$targetF
<<
EOF
- mountPath: "/usr/src/app/kube-certs"
name: kube-certs
readOnly: true
volumes:
- name: kube-certs
secret:
secretName: kube-certs
- name: services-info
hostPath:
path: "
$nomadRoot
/servers/
$target_hostname
/analytics/services-info"
EOF
if
[
-n
"
$debug
"
]
;
then
cat
>>
$targetF
<<
EOF
- name: app-source
hostPath:
path: "
$nomadRoot
/servers/
$target_hostname
/analytics/
$imageType
"
EOF
fi
fi
for
imageType
in
beaker jupyter creedo remotevis
;
do
echo
"##
$imageType
Initial setup: create container manager service"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment