Skip to content

Commit

Permalink
updated mesos to use separate containers for agent and master
Browse files Browse the repository at this point in the history
  • Loading branch information
algchoo committed Jun 5, 2024
1 parent d46b0b9 commit 2c3cf2a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 7 deletions.
21 changes: 18 additions & 3 deletions charts/apache-mesos/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,30 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: start-script
name: master-start-script
data:
startup.sh: |
#!/bin/bash
# Run mesos master, agent, and exporter in the background
# Run mesos master and exporter in the background
mesos-master --work_dir=/var/lib/mesos --log_dir=/var/log/mesos/ &
/mesos_exporter-1.1.2.linux-arm64/mesos_exporter -master http://localhost:5050 &
# Infinite loop to keep container alive
while :; do echo 'Hit CTRL+C' > /dev/null; sleep 1; done
---
apiVersion: v1
kind: ConfigMap
metadata:
name: agent-start-script
data:
startup.sh: |
#!/bin/bash
# Run mesos agent and exporter in the background
mesos-master --work_dir=/var/lib/mesos --log_dir=/var/log/mesos/ &
mesos-agent --work_dir=/var/lib/mesos/agent --log_dir=/var/log/mesos --master=localhost:5050 --launcher=posix --systemd_enable_support=false &
/mesos_exporter-1.1.2.linux-arm64/mesos_exporter -master http://localhost:5050 &
# Infinite loop to keep container alive
while :; do echo 'Hit CTRL+C'; sleep 1; done
while :; do echo 'Hit CTRL+C' > /dev/null; sleep 1; done
25 changes: 21 additions & 4 deletions charts/apache-mesos/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
hostNetwork: true
containers:
- name: mesos
- name: mesos-master
image: {{ .Values.image }}
env:
- name: LD_LIBRARY_PATH
Expand All @@ -23,11 +23,28 @@ spec:
volumeMounts:
- mountPath: /startup.sh
subPath: startup.sh
name: start-script
name: master-start-script
- name: mesos-agent
image: {{ .Values.image }}
env:
- name: LD_LIBRARY_PATH
value: "/usr/local/lib"
command: ["/bin/bash", "/startup.sh"]
volumeMounts:
- mountPath: /startup.sh
subPath: startup.sh
name: agent-start-script
volumes:
- name: start-script
- name: master-start-script
configMap:
name: master-start-script
defaultMode: 0777
items:
- key: startup.sh
path: startup.sh
- name: agent-start-script
configMap:
name: start-script
name: agent-start-script
defaultMode: 0777
items:
- key: startup.sh
Expand Down

0 comments on commit 2c3cf2a

Please sign in to comment.