/
unicorn.yaml.erb
141 lines (141 loc) · 4.07 KB
/
unicorn.yaml.erb
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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: unicorn
annotations:
shipit.shopify.io/restart: 'true'
spec:
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 100%
maxUnavailable: 0%
selector:
matchLabels:
name: unicorn
template:
metadata:
labels:
name: unicorn
spec:
containers:
- name: unicorn
image: quay.io/rubygems/rubygems.org:<%= current_sha %>
args: ["unicorn_rails", "-E", "<%= environment %>", "-c", "/app/config/unicorn.conf"]
ports:
- containerPort: 3000
name: http-unicorn
resources:
<% if environment == 'production' %>
requests:
cpu: 3000m
memory: 4Gi
limits:
cpu: 4000m
memory: 5Gi
<% else %>
requests:
cpu: 200m
memory: 1.5Gi
limits:
cpu: 1000m
memory: 2Gi
<% end %>
env:
- name: RAILS_ENV
value: "<%= environment %>"
- name: ENV
value: "<%= environment %>"
- name: STATSD_IMPLEMENTATION
value: "datadog"
- name: SECRET_KEY_BASE
valueFrom:
secretKeyRef:
name: <%= environment %>
key: secret_key_base
- name: RAILS_SERVE_STATIC_FILES
value: "true"
- name: AWS_REGION
value: "us-west-2"
- name: FASTLY_LOG_PROCESSOR_ENABLED
value: "true"
- name: S3_KEY
valueFrom:
secretKeyRef:
name: <%= environment %>
key: aws_access_key_id
- name: S3_SECRET
valueFrom:
secretKeyRef:
name: <%= environment %>
key: aws_secret_access_key
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: <%= environment %>
key: aws_access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: <%= environment %>
key: aws_secret_access_key
- name: NEW_RELIC_LICENSE_KEY
valueFrom:
secretKeyRef:
name: <%= environment %>
key: new_relic_license_key
- name: HONEYBADGER_API_KEY
valueFrom:
secretKeyRef:
name: <%= environment %>
key: honeybadger_api_key
- name: FASTLY_API_KEY
valueFrom:
secretKeyRef:
name: <%= environment %>
key: fastly_api_key
- name: FASTLY_SERVICE_ID
valueFrom:
secretKeyRef:
name: <%= environment %>
key: fastly_service_id
- name: FASTLY_DOMAIN
valueFrom:
secretKeyRef:
name: <%= environment %>
key: fastly_domain
- name: ELASTICSEARCH_URL
valueFrom:
secretKeyRef:
name: <%= environment %>
key: elasticsearch_url
- name: MEMCACHED_ENDPOINT
valueFrom:
secretKeyRef:
name: <%= environment %>
key: memcached_endpoint
- name: SENDGRID_USERNAME
valueFrom:
secretKeyRef:
name: <%= environment %>
key: sendgrid_username
- name: SENDGRID_PASSWORD
valueFrom:
secretKeyRef:
name: <%= environment %>
key: sendgrid_password
<% if environment == 'staging' %>
- name: DISABLE_SIGNUP
value: "true"
<% end %>
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: <%= environment %>
key: database_url
securityContext:
privileged: false
lifecycle:
preStop:
exec:
command: ["sleep", "5"]