rubypitaya 1.5.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubypitaya/app-template/Gemfile +1 -1
- data/lib/rubypitaya/app-template/Gemfile.lock +2 -2
- data/lib/rubypitaya/app-template/Makefile +9 -1
- data/lib/rubypitaya/app-template/docker-compose.yml +3 -3
- data/lib/rubypitaya/app-template/docker/dev/Dockerfile +1 -1
- data/lib/rubypitaya/app-template/docker/prod/Dockerfile +1 -1
- data/lib/rubypitaya/app-template/kubernetes/README.md +60 -0
- data/lib/rubypitaya/app-template/kubernetes/deployment-connector.yaml +35 -0
- data/lib/rubypitaya/app-template/kubernetes/deployment-rubypitaya.yaml +48 -0
- data/lib/rubypitaya/app-template/kubernetes/persistent-volume.yaml +11 -0
- data/lib/rubypitaya/app-template/kubernetes/service-connector.yaml +12 -0
- data/lib/rubypitaya/app-template/kubernetes/service-etcd.yaml +17 -0
- data/lib/rubypitaya/app-template/kubernetes/service-nats.yaml +12 -0
- data/lib/rubypitaya/app-template/kubernetes/service-postgres.yaml +12 -0
- data/lib/rubypitaya/app-template/kubernetes/service-redis.yaml +13 -0
- data/lib/rubypitaya/app-template/kubernetes/service-rubypitaya.yaml +12 -0
- data/lib/rubypitaya/app-template/kubernetes/statefulset-etcd.yaml +25 -0
- data/lib/rubypitaya/app-template/kubernetes/statefulset-nats.yaml +23 -0
- data/lib/rubypitaya/app-template/kubernetes/statefulset-postgres.yaml +37 -0
- data/lib/rubypitaya/app-template/kubernetes/statefulset-redis.yaml +23 -0
- data/lib/rubypitaya/core/database_config.rb +2 -0
- data/lib/rubypitaya/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c64a441e12fb5d3a9b7ff19762a9bc5a3ce3dea73ae73d98693dba745e49299
|
4
|
+
data.tar.gz: 7893c9fabe736b60619c6758645bb12e6a87a90f3f8e417096a077499613f1bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c8988dc0946445a6f7d2921344a1f80f342a476050d8c5c10a7cb671bb6a8b01be447bdcd3ce35b04ca5a11bab5772c2fff319c8de5dca3c7dd6a625fcb53a
|
7
|
+
data.tar.gz: b0edc4b5f49fa1b1ddd710aaf27072705c3ac967453d1244a0c51f37e5a9d6cc1b4a802de0ca260ec027f18d3714b1d4d39dd3eabc2e5956de29dde9cd715cba
|
@@ -62,7 +62,7 @@ GEM
|
|
62
62
|
diff-lcs (>= 1.2.0, < 2.0)
|
63
63
|
rspec-support (~> 3.8.0)
|
64
64
|
rspec-support (3.8.3)
|
65
|
-
rubypitaya (1.
|
65
|
+
rubypitaya (1.7.1)
|
66
66
|
activerecord (= 6.0.2)
|
67
67
|
etcdv3 (= 0.10.2)
|
68
68
|
eventmachine (= 1.2.7)
|
@@ -85,7 +85,7 @@ DEPENDENCIES
|
|
85
85
|
pry (= 0.12.2)
|
86
86
|
rake (= 10.0)
|
87
87
|
rspec (= 3.8.0)
|
88
|
-
rubypitaya (= 1.
|
88
|
+
rubypitaya (= 1.7.1)
|
89
89
|
|
90
90
|
BUNDLED WITH
|
91
91
|
1.17.2
|
@@ -44,7 +44,15 @@ generate-gemfilelock:
|
|
44
44
|
|
45
45
|
## Build image to production environment
|
46
46
|
prod-build-image:
|
47
|
-
@docker build . -f docker/prod/Dockerfile -t
|
47
|
+
@docker build . -f docker/prod/Dockerfile -t [registry-address]:$(IMAGE_TAG)
|
48
|
+
|
49
|
+
## Push prod image to gitlab
|
50
|
+
prod-push-image:
|
51
|
+
@docker push [registry-address]:$(IMAGE_TAG)
|
52
|
+
|
53
|
+
## Deploy prod image to kubernetes cluster
|
54
|
+
prod-deploy-image:
|
55
|
+
kubectl -n $(PROD_NAMESPACE) set image deployment rubypitaya rubypitaya=[registry-address]:$(IMAGE_TAG)
|
48
56
|
|
49
57
|
.DEFAULT_GOAL := show-help
|
50
58
|
|
@@ -12,7 +12,7 @@ services:
|
|
12
12
|
- '2380:2380'
|
13
13
|
|
14
14
|
redis:
|
15
|
-
image: 'redis:
|
15
|
+
image: 'redis:6.0.5-alpine'
|
16
16
|
ports:
|
17
17
|
- '9001:6379'
|
18
18
|
|
@@ -22,7 +22,7 @@ services:
|
|
22
22
|
- 'postgres:/var/lib/postgresql/data'
|
23
23
|
environment:
|
24
24
|
POSTGRES_USER: 'postgres'
|
25
|
-
|
25
|
+
POSTGRES_PASSWORD: 'postgres'
|
26
26
|
ports:
|
27
27
|
- '9100:5432'
|
28
28
|
|
@@ -67,7 +67,7 @@ services:
|
|
67
67
|
REDIS_URL: 'redis://redis:6379'
|
68
68
|
DATABASE_HOST: 'db'
|
69
69
|
DATABASE_USER: 'postgres'
|
70
|
-
DATABASE_PASSWORD: ''
|
70
|
+
DATABASE_PASSWORD: 'postgres'
|
71
71
|
DATABASE_NAME: 'ruby_pitaya'
|
72
72
|
|
73
73
|
volumes:
|
@@ -0,0 +1,60 @@
|
|
1
|
+
Kubernetes Configuration
|
2
|
+
========================
|
3
|
+
|
4
|
+
Set namespace
|
5
|
+
-------------
|
6
|
+
|
7
|
+
Open files "deployment-*.yaml" and set the correct namespace on links
|
8
|
+
|
9
|
+
|
10
|
+
Apply sequence
|
11
|
+
--------------
|
12
|
+
|
13
|
+
Run the following command on the listed files.
|
14
|
+
But remember to put your namespace and your KUBECONFIG env var if you need.
|
15
|
+
|
16
|
+
```sh
|
17
|
+
$ kubectl apply -f [file-path]
|
18
|
+
```
|
19
|
+
|
20
|
+
persistent-volume.yaml
|
21
|
+
|
22
|
+
statefulset-etcd.yaml
|
23
|
+
statefulset-nats.yaml
|
24
|
+
statefulset-postgres.yaml
|
25
|
+
statefulset-redis.yaml
|
26
|
+
|
27
|
+
service-etcd.yaml
|
28
|
+
service-nats.yaml
|
29
|
+
service-postgres.yaml
|
30
|
+
service-redis.yaml
|
31
|
+
|
32
|
+
deployment-connector.yaml
|
33
|
+
service-connector.yaml
|
34
|
+
|
35
|
+
|
36
|
+
Create gitlab-registry secret
|
37
|
+
-----------------------------
|
38
|
+
|
39
|
+
Run the following command.
|
40
|
+
But remember to put your namespace and your KUBECONFIG env var if you need.
|
41
|
+
|
42
|
+
```sh
|
43
|
+
$ kubectl create secret docker-registry gitlab-registry --docker-server=[registry-server] --docker-username=[username] --docker-password=[password]
|
44
|
+
```
|
45
|
+
|
46
|
+
If you use a different registry name instead of "gitlab-registry" change the deployment-rubypitaya.yaml imagePullSecrets.name
|
47
|
+
|
48
|
+
|
49
|
+
Apply sequence
|
50
|
+
--------------
|
51
|
+
|
52
|
+
Run the following command on the listed files.
|
53
|
+
But remember to put your namespace and your KUBECONFIG env var if you need.
|
54
|
+
|
55
|
+
```sh
|
56
|
+
$ kubectl apply -f [file-path]
|
57
|
+
```
|
58
|
+
|
59
|
+
deployment-rubypitaya.yaml
|
60
|
+
service-rubypitaya.yaml
|
@@ -0,0 +1,35 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: Deployment
|
3
|
+
metadata:
|
4
|
+
name: connector
|
5
|
+
labels:
|
6
|
+
app: connector
|
7
|
+
spec:
|
8
|
+
replicas: 1
|
9
|
+
selector:
|
10
|
+
matchLabels:
|
11
|
+
app: connector
|
12
|
+
template:
|
13
|
+
metadata:
|
14
|
+
labels:
|
15
|
+
app: connector
|
16
|
+
spec:
|
17
|
+
containers:
|
18
|
+
- name: connector
|
19
|
+
image: registry.gitlab.com/lucianopc/pitaya-connector:0.2.0
|
20
|
+
ports:
|
21
|
+
- containerPort: 3250
|
22
|
+
name: connector
|
23
|
+
env:
|
24
|
+
- name: PITAYA_CLUSTER_RPC_SERVER_NATS_CONNECT
|
25
|
+
value: "nats://nats.default.svc.cluster.local:4222"
|
26
|
+
- name: PITAYA_CLUSTER_RPC_CLIENT_NATS_CONNECT
|
27
|
+
value: "nats://nats.default.svc.cluster.local:4222"
|
28
|
+
- name: PITAYA_CLUSTER_RPC_CLIENT_NATS_REQUESTTIMEOUT
|
29
|
+
value: "10s"
|
30
|
+
- name: PITAYA_CLUSTER_SD_ETCD_ENDPOINTS
|
31
|
+
value: "etcd.default.svc.cluster.local:2379"
|
32
|
+
- name: PITAYA_CLUSTER_SD_ETCD_PREFIX
|
33
|
+
value: "rubypitaya/"
|
34
|
+
- name: SERVER_ROUTES
|
35
|
+
value: "rubypitaya"
|
@@ -0,0 +1,48 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: Deployment
|
3
|
+
metadata:
|
4
|
+
name: rubypitaya
|
5
|
+
labels:
|
6
|
+
app: rubypitaya
|
7
|
+
spec:
|
8
|
+
replicas: 1
|
9
|
+
selector:
|
10
|
+
matchLabels:
|
11
|
+
app: rubypitaya
|
12
|
+
template:
|
13
|
+
metadata:
|
14
|
+
labels:
|
15
|
+
app: rubypitaya
|
16
|
+
spec:
|
17
|
+
containers:
|
18
|
+
- name: rubypitaya
|
19
|
+
image: git.topfreegames.com:4567/prestes/tech-prototype/rubypitaya:latest
|
20
|
+
command: ["bundle", "exec", "rubypitaya", "run"]
|
21
|
+
ports:
|
22
|
+
- containerPort: 4567
|
23
|
+
name: rubypitaya
|
24
|
+
env:
|
25
|
+
- name: SERVER_NAME
|
26
|
+
value: "rubypitaya"
|
27
|
+
- name: RUBYPITAYA_ENV
|
28
|
+
value: "production"
|
29
|
+
- name: NATS_URL
|
30
|
+
value: "nats://nats.default.svc.cluster.local:4222"
|
31
|
+
- name: ETCD_URL
|
32
|
+
value: "http://etcd.default.svc.cluster.local:2379"
|
33
|
+
- name: ETCD_PREFIX
|
34
|
+
value: "rubypitaya/"
|
35
|
+
- name: ETCD_LEASE_SECONDS
|
36
|
+
value: "60"
|
37
|
+
- name: REDIS_URL
|
38
|
+
value: "redis://redis.default.svc.cluster.local:6379"
|
39
|
+
- name: DATABASE_HOST
|
40
|
+
value: "postgres.default.svc.cluster.local"
|
41
|
+
- name: DATABASE_USER
|
42
|
+
value: "postgres"
|
43
|
+
- name: DATABASE_PASSWORD
|
44
|
+
value: "postgres"
|
45
|
+
- name: DATABASE_NAME
|
46
|
+
value: "ruby_pitaya"
|
47
|
+
imagePullSecrets:
|
48
|
+
- name: gitlab-registry
|
@@ -0,0 +1,17 @@
|
|
1
|
+
apiVersion: v1
|
2
|
+
kind: Service
|
3
|
+
metadata:
|
4
|
+
name: etcd
|
5
|
+
spec:
|
6
|
+
selector:
|
7
|
+
app: etcd
|
8
|
+
ports:
|
9
|
+
- protocol: TCP
|
10
|
+
port: 2379
|
11
|
+
targetPort: 2379
|
12
|
+
name: etcd-2379
|
13
|
+
- protocol: TCP
|
14
|
+
port: 2380
|
15
|
+
targetPort: 2380
|
16
|
+
name: etcd-2380
|
17
|
+
type: LoadBalancer
|
@@ -0,0 +1,25 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: StatefulSet
|
3
|
+
metadata:
|
4
|
+
name: etcd
|
5
|
+
labels:
|
6
|
+
app: etcd
|
7
|
+
spec:
|
8
|
+
serviceName: "etcd"
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app: etcd
|
13
|
+
template:
|
14
|
+
metadata:
|
15
|
+
labels:
|
16
|
+
app: etcd
|
17
|
+
spec:
|
18
|
+
containers:
|
19
|
+
- name: etcd
|
20
|
+
image: appcelerator/etcd:3.0.15
|
21
|
+
ports:
|
22
|
+
- containerPort: 2379
|
23
|
+
name: etcd-2379
|
24
|
+
- containerPort: 2380
|
25
|
+
name: etcd-2380
|
@@ -0,0 +1,23 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: StatefulSet
|
3
|
+
metadata:
|
4
|
+
name: nats
|
5
|
+
labels:
|
6
|
+
app: nats
|
7
|
+
spec:
|
8
|
+
serviceName: "nats"
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app: nats
|
13
|
+
template:
|
14
|
+
metadata:
|
15
|
+
labels:
|
16
|
+
app: nats
|
17
|
+
spec:
|
18
|
+
containers:
|
19
|
+
- name: nats
|
20
|
+
image: nats:2.1.4
|
21
|
+
ports:
|
22
|
+
- containerPort: 4222
|
23
|
+
name: nats
|
@@ -0,0 +1,37 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: StatefulSet
|
3
|
+
metadata:
|
4
|
+
name: postgres
|
5
|
+
labels:
|
6
|
+
app: postgres
|
7
|
+
spec:
|
8
|
+
serviceName: "postgres"
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app: postgres
|
13
|
+
template:
|
14
|
+
metadata:
|
15
|
+
labels:
|
16
|
+
app: postgres
|
17
|
+
spec:
|
18
|
+
containers:
|
19
|
+
- name: postgres
|
20
|
+
image: postgres:9.6.17
|
21
|
+
env:
|
22
|
+
- name: POSTGRES_USER
|
23
|
+
value: "postgres"
|
24
|
+
- name: POSTGRES_PASSWORD
|
25
|
+
value: "postgres"
|
26
|
+
- name: PGDATA
|
27
|
+
value: "/var/lib/postgresql/data/pgdata"
|
28
|
+
ports:
|
29
|
+
- containerPort: 5432
|
30
|
+
name: postgres
|
31
|
+
volumeMounts:
|
32
|
+
- name: postgres
|
33
|
+
mountPath: /var/lib/postgresql/data
|
34
|
+
volumes:
|
35
|
+
- name: postgres
|
36
|
+
persistentVolumeClaim:
|
37
|
+
claimName: postgres-pvc
|
@@ -0,0 +1,23 @@
|
|
1
|
+
apiVersion: apps/v1
|
2
|
+
kind: StatefulSet
|
3
|
+
metadata:
|
4
|
+
name: redis
|
5
|
+
labels:
|
6
|
+
app: redis
|
7
|
+
spec:
|
8
|
+
serviceName: "redis"
|
9
|
+
replicas: 1
|
10
|
+
selector:
|
11
|
+
matchLabels:
|
12
|
+
app: redis
|
13
|
+
template:
|
14
|
+
metadata:
|
15
|
+
labels:
|
16
|
+
app: redis
|
17
|
+
spec:
|
18
|
+
containers:
|
19
|
+
- name: redis
|
20
|
+
image: redis:6.0.5-alpine
|
21
|
+
ports:
|
22
|
+
- containerPort: 6379
|
23
|
+
name: redis
|
@@ -25,6 +25,7 @@ module RubyPitaya
|
|
25
25
|
'pool': config['pool'],
|
26
26
|
'host': config['host'],
|
27
27
|
'user': config['user'],
|
28
|
+
'password': config['password'],
|
28
29
|
'database': config['database'],
|
29
30
|
}
|
30
31
|
end
|
@@ -36,6 +37,7 @@ module RubyPitaya
|
|
36
37
|
'pool': config['pool'],
|
37
38
|
'host': config['host'],
|
38
39
|
'user': config['user'],
|
40
|
+
'password': config['password'],
|
39
41
|
}
|
40
42
|
end
|
41
43
|
|
data/lib/rubypitaya/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypitaya
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luciano Prestes Cavalcanti
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -211,6 +211,20 @@ files:
|
|
211
211
|
- "./lib/rubypitaya/app-template/docker/entrypoint.sh"
|
212
212
|
- "./lib/rubypitaya/app-template/docker/prod/Dockerfile"
|
213
213
|
- "./lib/rubypitaya/app-template/docker/prod/Makefile"
|
214
|
+
- "./lib/rubypitaya/app-template/kubernetes/README.md"
|
215
|
+
- "./lib/rubypitaya/app-template/kubernetes/deployment-connector.yaml"
|
216
|
+
- "./lib/rubypitaya/app-template/kubernetes/deployment-rubypitaya.yaml"
|
217
|
+
- "./lib/rubypitaya/app-template/kubernetes/persistent-volume.yaml"
|
218
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-connector.yaml"
|
219
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-etcd.yaml"
|
220
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-nats.yaml"
|
221
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-postgres.yaml"
|
222
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-redis.yaml"
|
223
|
+
- "./lib/rubypitaya/app-template/kubernetes/service-rubypitaya.yaml"
|
224
|
+
- "./lib/rubypitaya/app-template/kubernetes/statefulset-etcd.yaml"
|
225
|
+
- "./lib/rubypitaya/app-template/kubernetes/statefulset-nats.yaml"
|
226
|
+
- "./lib/rubypitaya/app-template/kubernetes/statefulset-postgres.yaml"
|
227
|
+
- "./lib/rubypitaya/app-template/kubernetes/statefulset-redis.yaml"
|
214
228
|
- "./lib/rubypitaya/core/application_files_importer.rb"
|
215
229
|
- "./lib/rubypitaya/core/config.rb"
|
216
230
|
- "./lib/rubypitaya/core/database_config.rb"
|