Skip to content

Commit bc2cfe3

Browse files
Merge pull request #516 from CodeNow/SAN-4693-ingress-proxy
San 4693 ingress proxy
2 parents 86f320f + d4f7b8f commit bc2cfe3

17 files changed

Lines changed: 258 additions & 16 deletions

File tree

ansible/api-core.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,18 @@
1616
- role: notify
1717
rollbar_token: "{{ api_rollbar_key }}"
1818
tags: [ notify ]
19-
- { role: redis_key, tags: [ setup, redis_key ] }
20-
- { role: builder, tags: [ build ] }
21-
- { role: docker_client }
22-
- { role: tls-client, tls_service: mongodb, tags: [ tls ] }
23-
- { role: datadog, tags: [ datadog ] }
24-
- { role: container_start }
19+
20+
- role: builder
21+
tags: [ build ]
22+
23+
- role: docker_client
24+
25+
- role: tls-client
26+
tags: [ tls ]
27+
tls_service: mongodb
28+
29+
- role: datadog
30+
tags: [ datadog ]
31+
32+
- role: container_start
33+
number_of_containers: "{{ ansible_processor_cores }}"

ansible/consul-template-updater.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
- hosts: consul
33

4-
- hosts: userland
4+
- hosts: "{{ host }}"
55
vars_files:
66
- group_vars/{{ var_file }}
77
- group_vars/alpha-consul-template-updater.yml

ansible/delta-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ delta-mongo-c
1515
[neo4j]
1616
delta-neo4j
1717

18+
[ingress]
19+
delta-ingress
20+
1821
[api_group:children]
1922
worker
2023
api
@@ -127,6 +130,7 @@ drake
127130
eru
128131
github-varnish
129132
hipache
133+
ingress
130134
khronos
131135
mavis
132136
metis

ansible/gamma-hosts/hosts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ gamma-app-services
4545
[navi]
4646
gamma-navi
4747

48+
[ingress]
49+
gamma-ingress
50+
4851
[link]
4952
gamma-navi
5053

@@ -127,6 +130,7 @@ drake
127130
eru
128131
github-varnish
129132
hipache
133+
ingress
130134
khronos
131135
mavis
132136
metis

ansible/group_vars/alpha-api-base.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ node_version: 0.10.38
44
npm_version: 2.8.3
55

66
repo: git@github.com:CodeNow/api.git
7+
restart_policy: always
78

89
# for sendGrid
910
sendgrid_key: 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
@@ -42,6 +43,7 @@ api_base_container_envs: >-
4243
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_LOG_LEVEL=fatal {% endif %}
4344
{% if api_new_relic_app_name is defined %} -e NEW_RELIC_NO_CONFIG_FILE=true {% endif %}
4445
-e NODE_ENV={{ node_env }}
46+
-e NUM_WORKERS=1
4547
-e OPTIMUS_HOST=http://{{ optimus_hostname }}
4648
-e RABBITMQ_HOSTNAME={{ rabbit_host_address }}
4749
-e RABBITMQ_PASSWORD={{ rabbit_password }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: nginx
3+
4+
# used by consul template updater
5+
proxy_service_name: api
6+
target_container_name: nginx
7+
target_updater_file_path: /etc/nginx/sites-enabled
8+
template_command: /bin/docker kill -s HUP {{ target_container_name }}
9+
template_path: /etc/nginx/template/api.tmpl
10+
11+
# used by container_kill_start
12+
container_image: "{{ name }}"
13+
container_tag: "1.10"
14+
15+
restart_policy: always
16+
17+
container_run_opts: >
18+
-d
19+
--name {{ name }}
20+
-p 0.0.0.0:443:443
21+
-p 0.0.0.0:80:80
22+
-v /etc/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
23+
-v {{ target_updater_file_path }}
24+
-v /etc/ssl/certs/{{ domain }}:/etc/ssl/certs/{{ domain }}:ro
25+
-v /var/log/nginx:/var/log/nginx

ansible/group_vars/alpha-workers.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ container_image: registry.runnable.com/runnable/{{ name }}
66
container_envs: >
77
{{ api_base_container_envs }}
88
-e IS_QUEUE_WORKER=true
9-
-e NUM_WORKERS=1
109
-e ROLLBAR_KEY={{ api_workers_rollbar_key }}
1110
1211
container_run_opts: >

ansible/ingress-proxy.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
- hosts: ingress
3+
vars_files:
4+
- group_vars/alpha-ingress-proxy.yml
5+
roles:
6+
- role: datadog
7+
has_dd_integration: yes
8+
9+
- role: runnable-domain-proxy
10+
11+
- role: container_kill_start
12+
13+
- include: consul-template-updater.yml
14+
vars:
15+
host: ingress
16+
var_file: alpha-ingress-proxy.yml

ansible/navi-proxy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@
1212

1313
- include: consul-template-updater.yml
1414
vars:
15+
host: userland
1516
var_file: alpha-navi-proxy.yml

ansible/registrator-api.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
- hosts: consul
3+
4+
- hosts: api
5+
vars_files:
6+
- group_vars/alpha-registrator.yml
7+
roles:
8+
- role: notify
9+
tags: notify
10+
11+
- role: container_kill_start

0 commit comments

Comments
 (0)