first commit
This commit is contained in:
38
docker-compose.yml
Normal file
38
docker-compose.yml
Normal file
@@ -0,0 +1,38 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
consul-client:
|
||||
image: hashicorp/consul:latest
|
||||
container_name: consul-client
|
||||
network_mode: host
|
||||
restart: always
|
||||
entrypoint: /bin/sh
|
||||
command: >
|
||||
-c "ETH0_IP=$$(ip -4 addr show eth0 | grep 'inet ' | head -n1 | awk '{print $$2}' | cut -d/ -f1) &&
|
||||
consul agent
|
||||
-data-dir=/consul/data
|
||||
-retry-join=192.168.4.226
|
||||
-retry-join=192.168.4.227
|
||||
-retry-join=192.168.4.228
|
||||
-retry-join=192.168.4.36
|
||||
-encrypt=AhKqpWcJGUHgj7x4gJPPTpvw859gbn/RTJINNeUDA2Q=
|
||||
-bind=$$ETH0_IP
|
||||
-advertise=$$ETH0_IP"
|
||||
|
||||
nomad-client:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: nomad-client
|
||||
network_mode: host
|
||||
privileged: true
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- consul-client
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./nomad-client.json:/etc/nomad/nomad.json:ro
|
||||
- /opt/nomad:/opt/nomad
|
||||
- /tmp:/tmp
|
||||
command: agent -config=/etc/nomad/nomad.json
|
||||
|
||||
15
dockerfile
Normal file
15
dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
FROM arm32v7/debian:bullseye-slim
|
||||
|
||||
ENV NOMAD_VERSION=1.8.2
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y curl unzip ca-certificates iproute2 && \
|
||||
curl -o nomad.zip https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_arm.zip && \
|
||||
unzip nomad.zip && \
|
||||
chmod +x nomad && \
|
||||
mv nomad /usr/local/bin/ && \
|
||||
rm nomad.zip && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/nomad"]
|
||||
48
nomad-client.json
Normal file
48
nomad-client.json
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"data_dir": "/opt/nomad/data",
|
||||
"client": {
|
||||
"enabled": true,
|
||||
"node_pool": "backup",
|
||||
"servers": [
|
||||
"192.168.4.36:4647",
|
||||
"192.168.4.226:4647",
|
||||
"192.168.4.227:4647",
|
||||
"192.168.4.228:4647"
|
||||
],
|
||||
"cpu_total_compute": 0,
|
||||
"network_speed": 0,
|
||||
"no_host_uuid": false,
|
||||
"node_class": "",
|
||||
"reserved": {
|
||||
"cpu": 0,
|
||||
"disk": 0,
|
||||
"memory": 200
|
||||
},
|
||||
"gc_interval": "1m",
|
||||
"gc_parallel_destroys": 2,
|
||||
"gc_disk_usage_threshold": 80,
|
||||
"gc_inode_usage_threshold": 70,
|
||||
"max_kill_timeout": "30s",
|
||||
"options": {
|
||||
"docker.privileged.enabled": "true",
|
||||
"docker.volumes.enabled": "true",
|
||||
"docker.caps.whitelist": "SYS_ADMIN,NET_ADMIN,chown,dac_override,fsetid,fowner,mknod,net_raw,setgid,setuid,setfcap,setpcap,net_bind_service,sys_chroot,kill,audit_write,sys_module",
|
||||
"driver.raw_exec.enable": "1"
|
||||
}
|
||||
},
|
||||
"plugin": {
|
||||
"docker": {
|
||||
"config": {
|
||||
"allow_privileged": true,
|
||||
"volumes": {
|
||||
"enabled": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"telemetry": {
|
||||
"prometheus_metrics": true,
|
||||
"publish_allocation_metrics": true,
|
||||
"publish_node_metrics": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user