-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
140 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
dry-stack (0.1.10) | ||
dry-stack (0.1.11) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Dry | ||
class Stack | ||
VERSION = '0.1.10' | ||
VERSION = '0.1.11' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,43 @@ | ||
Stack :simple_stack do | ||
Options traefik: true, ingress: true | ||
Labels 'stack.product': 'product A' | ||
|
||
SYSLOG = { driver: 'syslog', options: { | ||
'syslog-address': 'tcp://swarm.next:5005', | ||
'tag': 'image:{{.ImageName}}/service:{{.Name}}/container:{{.ID}}' | ||
} } | ||
FLUENTD = { driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd:24224', | ||
'fluentd-async': true | ||
} } | ||
|
||
Ingress operator: { host: 'operator.*' }, | ||
navigator: { host: 'navigator.*' } | ||
|
||
Environment [:backend, :reports], { | ||
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://open.tl/v1/traces', | ||
NODE_ENV: 'production', | ||
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=%{stack-name},service.name=%{service-name}" | ||
} | ||
|
||
PublishPorts admin: 4000, operator: [4001,4002] | ||
PublishPorts navigator: '4002:5000', reports: [7000,'2000:3000'] # mode: ingress, protocol: tcp | ||
Deploy backend: { replica: 2, 'resources.limits': { cpus: 4, memory: '500M' } } | ||
Ingress backend: [{host: 'backend.*'}, {host: 'admin.*', path: '/api', port: 4000}] | ||
|
||
Service :admin, image: 'frontend', env: {APP: 'admin'}, ports: 5000 do | ||
deploy_label 'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin:$apr1$i7hdbc9g$Rkocxo9snhmuESvUg0TTv/' | ||
deploy_label "traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth" | ||
logging SYSLOG | ||
end | ||
Service :operator, image: 'frontend', env: {APP: 'operator'}, ports: [5000, 6000] | ||
Service :navigator, image: 'frontend', env: {APP: 'navigator'}, ports: 5000 | ||
|
||
Service :backend, image: 'backend', ports: 3000 do | ||
user :root | ||
env APP_PORT: 3000, NODE_ENV: 'development', SKIP_GZ: true, DB_URL: '$DB_URL' | ||
logging FLUENTD | ||
end | ||
|
||
Service :reports, image: 'reports:0.1', env: {DB_URL: '$DB_URL'}, ports: 7000 | ||
|
||
Network :default, attachable: true | ||
Options name: :simple_stack, traefik: true, ingress: true | ||
Labels 'stack.product': 'product A' | ||
|
||
SYSLOG = { driver: 'syslog', options: { | ||
'syslog-address': 'tcp://swarm.next:5005', | ||
'tag': 'image:{{.ImageName}}/service:{{.Name}}/container:{{.ID}}' | ||
} } | ||
FLUENTD = { driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd:24224', | ||
'fluentd-async': true | ||
} } | ||
|
||
Ingress operator: { host: 'operator.*' }, | ||
navigator: { host: 'navigator.*' } | ||
|
||
Environment [:backend, :reports], { | ||
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: 'http://open.tl/v1/traces', | ||
NODE_ENV: 'production', | ||
OTEL_RESOURCE_ATTRIBUTES: "deployment.environment=%{stack-name},service.name=%{service-name}" | ||
} | ||
|
||
PublishPorts admin: 4000, operator: [4001,4002] | ||
PublishPorts navigator: '4002:5000', reports: [7000,'2000:3000'] # mode: ingress, protocol: tcp | ||
Deploy backend: { replica: 2, 'resources.limits': { cpus: 4, memory: '500M' } } | ||
Ingress backend: [{host: 'backend.*'}, {host: 'admin.*', path: '/api', port: 4000}] | ||
|
||
Service :admin, image: 'frontend', env: {APP: 'admin'}, ports: 5000 do | ||
deploy_label 'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin:$apr1$i7hdbc9g$Rkocxo9snhmuESvUg0TTv/' | ||
deploy_label "traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth" | ||
logging SYSLOG | ||
end | ||
Service :operator, image: 'frontend', env: {APP: 'operator'}, ports: [5000, 6000] | ||
Service :navigator, image: 'frontend', env: {APP: 'navigator'}, ports: 5000 | ||
|
||
Service :backend, image: 'backend', ports: 3000 do | ||
user :root | ||
env APP_PORT: 3000, NODE_ENV: 'development', SKIP_GZ: true, DB_URL: '$DB_URL' | ||
logging FLUENTD | ||
end | ||
|
||
Service :reports, image: 'reports:0.1', env: {DB_URL: '$DB_URL'}, ports: 7000 | ||
|
||
Network :default, attachable: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,48 @@ | ||
|
||
Stack :name1 do | ||
Options traefik: true, ingress: true | ||
|
||
Logging :svc1, driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd1t:24224', | ||
Options name: :name1, traefik: true, ingress: true | ||
|
||
Logging :svc1, driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd1t:24224', | ||
'fluentd-async': true | ||
} | ||
|
||
Logging [:svc1, :svc2], driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd2:24224', | ||
'fluentd-async': true | ||
} | ||
Ingress svc1: [ | ||
{host: 'backend.*'}, | ||
{host: 'admin.*', path: '/api', port: 4000} | ||
] | ||
|
||
Deploy [:svc1, :svc2], 'placement.constraints': ['node.role == manager'] | ||
|
||
Deploy [:svc1, :svc2], labels: [ | ||
'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin:$$apr1$$i7hdbc9g$$Rkocxo9snhmuESvUg0TTv/', | ||
"traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth" | ||
] | ||
|
||
Service :svc1, image: 'service-image' | ||
Service :svc2, image: 'postgres:13.5-alpine', ingress: {host: 'svc2.*', port: 3000} do | ||
command 'bash -c "apk add curl && docker-entrypoint.sh -c \"shared_buffers=256MB\" -c \"max_connections=200\" "' | ||
entrypoint '/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh' | ||
|
||
logging driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd3:24224', | ||
'fluentd-async': true | ||
} | ||
end | ||
|
||
Logging [:svc1, :svc2], driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd2:24224', | ||
'fluentd-async': true | ||
} | ||
Ingress svc1: [ | ||
{host: 'backend.*'}, | ||
{host: 'admin.*', path: '/api', port: 4000} | ||
] | ||
|
||
Deploy [:svc1, :svc2], 'placement.constraints': ['node.role == manager'] | ||
|
||
Deploy [:svc1, :svc2], labels: [ | ||
'traefik.http.middlewares.%{service-name}_auth.basicauth.users=admin:$$apr1$$i7hdbc9g$$Rkocxo9snhmuESvUg0TTv/', | ||
"traefik.http.routers.%{service-name}.middlewares=%{service-name}_auth" | ||
] | ||
|
||
Service :svc1, image: 'service-image' | ||
Service :svc2, image: 'postgres:13.5-alpine', ingress: {host: 'svc2.*', port: 3000} do | ||
command 'bash -c "apk add curl && docker-entrypoint.sh -c \"shared_buffers=256MB\" -c \"max_connections=200\" "' | ||
entrypoint '/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh' | ||
|
||
logging driver: 'fluentd', options: { | ||
'fluentd-address': 'fluentd3:24224', | ||
'fluentd-async': true | ||
} | ||
end | ||
|
||
Service :svc3, image: 'service-image' do | ||
ingress host: 'svc3.*', port: 3000 | ||
ingress host: 'svc3-1.*', port: 4000 | ||
end | ||
|
||
Service :svc4, image: 'service-image' do | ||
ingress [{ host: 'svc4.*', port: 3000 }, { host: 'svc4-1.*', port: 4000 }] | ||
end | ||
|
||
Service :svc5, image: 'postgres:13.5-alpine', ingress: [{ host: 'svc5.*', port: 3000 }, { host: 'svc5-1.*', port: 4000 }] | ||
|
||
Service :svc6, image: 'postgres:13.5-alpine', ingress: [{ host: 'svc6.*', port: 3000 }] do | ||
ingress host: 'svc6-1.*', port: 4000 | ||
end | ||
Service :svc3, image: 'service-image' do | ||
ingress host: 'svc3.*', port: 3000 | ||
ingress host: 'svc3-1.*', port: 4000 | ||
end | ||
|
||
Service :svc4, image: 'service-image' do | ||
ingress [{ host: 'svc4.*', port: 3000 }, { host: 'svc4-1.*', port: 4000 }] | ||
end | ||
|
||
Service :svc5, image: 'postgres:13.5-alpine', ingress: [{ host: 'svc5.*', port: 3000 }, { host: 'svc5-1.*', port: 4000 }] | ||
|
||
Service :svc6, image: 'postgres:13.5-alpine', ingress: [{ host: 'svc6.*', port: 3000 }] do | ||
ingress host: 'svc6-1.*', port: 4000 | ||
end |