Skip to content

Commit e2d9415

Browse files
authored
Merge pull request #120 from observIQ/feat/mesos-separate-containers
Added separate containers for Mesos master and agent
2 parents d46b0b9 + 40915f8 commit e2d9415

2 files changed

Lines changed: 34 additions & 10 deletions

File tree

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
apiVersion: v1
22
kind: ConfigMap
33
metadata:
4-
name: start-script
4+
name: master-start-script
55
data:
66
startup.sh: |
77
#!/bin/bash
88
9-
# Run mesos master, agent, and exporter in the background
9+
# Run mesos master and exporter in the background
1010
mesos-master --work_dir=/var/lib/mesos --log_dir=/var/log/mesos/ &
11-
mesos-agent --work_dir=/var/lib/mesos/agent --log_dir=/var/log/mesos --master=localhost:5050 --launcher=posix --systemd_enable_support=false &
12-
/mesos_exporter-1.1.2.linux-arm64/mesos_exporter -master http://localhost:5050 &
11+
/mesos_exporter-1.1.2.linux-arm64/mesos_exporter -master http://localhost:5050
12+
---
13+
apiVersion: v1
14+
kind: ConfigMap
15+
metadata:
16+
name: agent-start-script
17+
data:
18+
startup.sh: |
19+
#!/bin/bash
1320
14-
# Infinite loop to keep container alive
15-
while :; do echo 'Hit CTRL+C'; sleep 1; done
21+
# Run mesos agent and exporter in the background
22+
mesos-agent --work_dir=/var/lib/mesos/agent --log_dir=/var/log/mesos --master=localhost:5050 --launcher=posix --systemd_enable_support=false

charts/apache-mesos/templates/deployment.yaml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
spec:
1515
hostNetwork: true
1616
containers:
17-
- name: mesos
17+
- name: mesos-master
1818
image: {{ .Values.image }}
1919
env:
2020
- name: LD_LIBRARY_PATH
@@ -23,11 +23,28 @@ spec:
2323
volumeMounts:
2424
- mountPath: /startup.sh
2525
subPath: startup.sh
26-
name: start-script
26+
name: master-start-script
27+
- name: mesos-agent
28+
image: {{ .Values.image }}
29+
env:
30+
- name: LD_LIBRARY_PATH
31+
value: "/usr/local/lib"
32+
command: ["/bin/bash", "/startup.sh"]
33+
volumeMounts:
34+
- mountPath: /startup.sh
35+
subPath: startup.sh
36+
name: agent-start-script
2737
volumes:
28-
- name: start-script
38+
- name: master-start-script
39+
configMap:
40+
name: master-start-script
41+
defaultMode: 0777
42+
items:
43+
- key: startup.sh
44+
path: startup.sh
45+
- name: agent-start-script
2946
configMap:
30-
name: start-script
47+
name: agent-start-script
3148
defaultMode: 0777
3249
items:
3350
- key: startup.sh

0 commit comments

Comments
 (0)