forked from next-hat/nanocl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Statefile.yml
159 lines (152 loc) · 4.27 KB
/
Statefile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
## Statefile used for development and testing purposes
## We moved away from the classic docker compose setup
## Because we needed to have a more flexible config to enable multi node testing
ApiVersion: v0.13
Namespace: system
Cargoes:
- Name: nstore
Container:
Hostname: store.nanocl.internal
Image: cockroachdb/cockroach:v23.1.15
Entrypoint:
- /bin/sh
Tty: true
Env:
- STATE_DIR=${{ state_dir }}/store
HostConfig:
PortBindings:
26257/tcp:
- HostPort: "26257"
26258/tcp:
- HostPort: "26258"
Binds:
- ${{ state_dir }}/store:${{ state_dir }}/store
Cmd:
- -c
- |
echo "starting cockroachdb"
if [ ! -f "$STATE_DIR/ca/ca.key" ]; then
echo "generating certs"
mkdir -p $STATE_DIR/ca $STATE_DIR/certs $STATE_DIR/data
cockroach cert create-ca --certs-dir=$STATE_DIR/certs --ca-key=$STATE_DIR/ca/ca.key
cockroach cert create-node 127.0.0.1 store.nanocl.internal --certs-dir=$STATE_DIR/certs --ca-key=$STATE_DIR/ca/ca.key
cockroach cert create-client root --certs-dir=$STATE_DIR/certs --ca-key=$STATE_DIR/ca/ca.key
fi
cockroach start-single-node --listen-addr=:26257 --sql-addr=:26258 --certs-dir=$STATE_DIR/certs --store=$STATE_DIR/data
- Name: nmetrics
Container:
Image: ghcr.io/next-hat/metrsd:0.5.2
Tty: true
Env: [LOG_LEVEL=metrsd=info]
Cmd:
- --hosts
- unix:///run/nanocl/metrics.sock
HostConfig:
Binds:
- //run/guest-services/nanocl:/run/nanocl
- Name: nproxy
Container:
Image: nproxy:dev
Tty: true
Env:
- STATE_DIR=${{ state_dir }}/proxy
HostConfig:
NetworkMode: host
Binds:
- //run/guest-services/nanocl:/run/nanocl
- ${{ state_dir }}/proxy:/${{ state_dir }}/proxy
- Name: ncproxy
Container:
Image: ghcr.io/next-hat/nanocl-dev:dev
Tty: true
ExposedPorts:
8686/tcp:
HostConfig:
PortBindings:
8686/tcp:
- HostPort: "8686"
HostIp: "0.0.0.0"
Binds:
- ./:/project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- ${{ state_dir }}/proxy:/${{ state_dir }}/proxy
- //run/guest-services/nanocl:/run/nanocl
Cmd:
- watch
- -w
- /project/bin/ncproxy/src
- -x
- run --no-default-features --features dev --bin ncproxy -- --state-dir ${{ state_dir }}/proxy
- Name: ndns
Container:
Image: ndns:dev
Tty: true
Env:
- STATE_DIR=${{ state_dir }}/dns
HostConfig:
NetworkMode: host
Binds:
- ${{ state_dir }}/dns:/${{ state_dir }}/dns
- Name: ncdns
Container:
Image: ghcr.io/next-hat/nanocl-dev:dev
Tty: true
ExposedPorts:
8787/tcp:
HostConfig:
PortBindings:
8787/tcp:
- HostPort: "8787"
Binds:
- ./:/project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- ${{ state_dir }}/dns:/${{ state_dir }}/dns
- //run/guest-services/nanocl:/run/nanocl
Cmd:
- watch
- -w
- /project/bin/ncdns/src
- -x
- run --no-default-features --features dev --bin ncdns -- --state-dir ${{ state_dir }}/dns
- Name: ndaemon
Container:
Image: ghcr.io/next-hat/nanocl-dev:dev
Tty: true
Hostname: nanocl.internal
Cmd:
- watch
- -w
- /project/bin/nanocld/src
- -x
- |
run --no-default-features \
--features dev \
--bin nanocld \
-- \
--hosts unix:///run/nanocl/nanocl.sock \
--gid 1001 \
--hosts tcp://0.0.0.0:9443 \
--cert ./tests/server.crt \
--cert-key ./tests/server.key \
--cert-ca ./tests/ca.crt \
--state-dir ${{ state_dir }}
ExposedPorts:
8585/tcp:
9443/tcp:
HostConfig:
PortBindings:
8585/tcp:
- HostPort: "8585"
HostIp: "0.0.0.0"
9443/tcp:
- HostPort: "9443"
HostIp: "0.0.0.0"
Binds:
- ./:/project
- nanocl-deps:/project/target
- rust-cache:/usr/local/cargo/registry
- //run/guest-services/nanocl:/run/nanocl
- ${{ state_dir }}:/${{ state_dir }}
- /var/run/docker.sock:/run/docker.sock