Skip to content

Commit

Permalink
tsuru-mvp (#5), config-yml-inicial (#8): config.yml potencialmente me…
Browse files Browse the repository at this point in the history
…lhor para 1+2 nós & Tsuru 1.6
  • Loading branch information
fititnt committed Jun 21, 2019
1 parent 0f8821c commit ac74a4c
Show file tree
Hide file tree
Showing 5 changed files with 187 additions and 103 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ estão disponíveis em nosso [Diário de bordo](diario-de-bordo/).

## Filosofia

Esta filosofia ainda pode passar por alterações nos próximos meses. Porém neste
momento:
Nossa filosofia pode passar por melhorias nas próximas semanas, porém desde já
temos em mente o seguinte:

- PaaS comercial? Divisão de custos entre usuários? Gratuito?
- **Gratuito. Nem mesmo permitimos opção de pagamento para não constranger usuários.**
Expand Down
19 changes: 19 additions & 0 deletions diario-de-bordo/aguia-pescadora-tsuru-cluster.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@

# TODO: organizar melhor esse diario de bordo... (fititnt, 2019-06-20 03:30 BRT)

## Ao menos de um administrador
ssh-copy-id -i ~/.ssh/id_rsa-rocha-eticaai-2019.pub root@aguia-pescadora-delta.etica.ai
ssh-copy-id -i ~/.ssh/id_rsa-rocha-eticaai-2019.pub root@aguia-pescadora-echo.etica.ai
ssh-copy-id -i ~/.ssh/id_rsa-rocha-eticaai-2019.pub root@aguia-pescadora-foxtrot.etica.ai

## Key do Tsuru
ssh-copy-id -i ~/.ssh/id_rsa-aguia-pescadora-tsuru.pub root@aguia-pescadora-delta.etica.ai
ssh-copy-id -i ~/.ssh/id_rsa-aguia-pescadora-tsuru.pub root@aguia-pescadora-echo.etica.ai
ssh-copy-id -i ~/.ssh/id_rsa-aguia-pescadora-tsuru.pub root@aguia-pescadora-foxtrot.etica.ai

## Teste Key do Tsuru
ssh -i ~/.ssh/id_rsa-aguia-pescadora-tsuru root@aguia-pescadora-delta.etica.ai
ssh -i ~/.ssh/id_rsa-aguia-pescadora-tsuru root@aguia-pescadora-echo.etica.ai
ssh -i ~/.ssh/id_rsa-aguia-pescadora-tsuru root@aguia-pescadora-foxtrot.etica.ai

## diario-de-bordo/tsuru-inicializacao/seu-computador.sh
# Depois de preparar todas as etapas, este comando inicializa um cluster
tsuru install-create -c config.yml

#------------------------------------------------------------------------------#
# SEÇÃO TSURU: PLATAFORMAS #
#------------------------------------------------------------------------------#
Expand Down
2 changes: 1 addition & 1 deletion diario-de-bordo/tsuru-inicializacao/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ hosts:
generic-ip-address: ["173.249.10.99"]
generic-ssh-key: ["/home/fititnt/.ssh/id_rsa-aguia-pescadora-tsuru"]
apps:
size: 2
size: 3
# docs.tsuru.io: "By default, core hosts are reused as apps hosts (this can be configured by the hosts:apps:dedicated config).""
dedicated: false
driver:
Expand Down

This file was deleted.

172 changes: 165 additions & 7 deletions diario-de-bordo/tsuru-inicializacao/tsuru-inicializacao.log
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# fititnt at bravo in /alligo/code/eticaai/aguia-pescadora/diario-de-bordo/tsuru-inicializacao on git:master x [20:00:05]
# fititnt at bravo in /alligo/code/eticaai/aguia-pescadora/diario-de-bordo/tsuru-inicializacao on git:master x [1:32:51]
$ tsuru install-create -c config.yml
Running pre-install checks...
Creating CA: /home/fititnt/.tsuru/installs/aguia-pescadora/certs/ca.pem
Expand Down Expand Up @@ -28,11 +28,11 @@ Uploading registry certificate...
Deploying tsuru config...
Deploying compose file in cluster manager....
Creating network tsuru_tsuru
Creating service tsuru_planb
Creating service tsuru_registry
Creating service tsuru_tsuru
Creating service tsuru_redis
Creating service tsuru_mongo
Creating service tsuru_planb
Creating service tsuru_registry
Restarting docker in aguia-pescadora-1
Waiting for SSH to be available...
Detecting the provisioner...
Expand All @@ -44,7 +44,7 @@ Using "mongodb" database "tsuru" from the server "mongo:27017".

Password: 

Confirm: 
Confirm:
 Root user successfully created.
Bootstrapping Tsuru API...Running pre-create checks...
Creating machine...
Expand Down Expand Up @@ -94,9 +94,167 @@ log in with default user: admin@example.com Password:
Successfully logged in!
adding pool
Pool successfully registered.
adding node https://173.249.10.99:2376
Node successfully registered.
adding node https://167.86.127.220:2376
Node successfully registered.
adding node https://167.86.127.225:2376
Node successfully registered.
adding node https://173.249.10.99:2376
Error: Error bootstrapping tsuru: failed to register node: Node address shouldn't repeat
Node successfully registered.
adding platform
Step 1/1 : FROM tsuru/python
latest: Pulling from tsuru/python
898c46f3b1a1: Pull complete
63366dfa0a50: Pull complete
041d4cd74a92: Pull complete
6e1bee0f8701: Pull complete
f1262cb8e4eb: Pull complete
3b42147f93c6: Pull complete
ce676a4695b2: Pull complete
3d2ec243107f: Pull complete
8dd3be1f9c8f: Pull complete
d8fdacb9c35e: Pull complete
208c5cbd4b1d: Pull complete
Digest: sha256:8fd5cc5b7e238e6e02b8661502b97fe262633d734f42b84219b56756a10dd0f2
Status: Downloaded newer image for tsuru/python:latest
---> 80e4f8c9f479
Successfully built 80e4f8c9f479
Successfully tagged 173.249.10.99:5000/tsuru/python:v1
Platform successfully added!
adding team
Team "admin" successfully created!
adding dashboard
App "tsuru-dashboard" has been created!
Use app-info to check the status of the app and its units.
deploying dashboard
Deploying image... ok
---- Getting process from image ----
latest: Pulling from tsuru/dashboard
898c46f3b1a1: Already exists
63366dfa0a50: Already exists
041d4cd74a92: Already exists
6e1bee0f8701: Already exists
f1262cb8e4eb: Already exists
3b42147f93c6: Already exists
ce676a4695b2: Already exists
8451f182be01: Pull complete
08228282e2e2: Pull complete
ece7284ab391: Pull complete
74846b861d93: Pull complete
58e30f14a771: Pull complete
77f713733a5c: Pull complete
4867c7fa9135: Pull complete
17e3ccb375ed: Pull complete
fc2fc7de3e1d: Pull complete
ad6fe7455e89: Pull complete
d962926909e2: Pull complete
Digest: sha256:e49a7379e01643ed851680d69d87272490274424628e006b4117db3e22eef8e7
Status: Downloaded newer image for tsuru/dashboard:latest
---- Inspecting image "tsuru/dashboard:latest" ----
---> Process "web" found with commands: ["gunicorn --access-logfile - -b 0.0.0.0:$PORT -w 2 abyss.wsgi -k gevent"]
---- Getting tsuru.yaml from image ----
latest: Pulling from tsuru/dashboard
Digest: sha256:e49a7379e01643ed851680d69d87272490274424628e006b4117db3e22eef8e7
Status: Image is up to date for tsuru/dashboard:latest
---- Running build hooks ----
---> Running "python manage.py migrate --noinput && python manage.py createcachetable && python manage.py collectstatic --noinput"
latest: Pulling from tsuru/dashboard
Digest: sha256:e49a7379e01643ed851680d69d87272490274424628e006b4117db3e22eef8e7
Status: Image is up to date for tsuru/dashboard:latest
Operations to perform:
Apply all migrations: contenttypes, sessions
Running migrations:
No migrations to apply.
Cache table 'tsuru_cache' already exists.

0 static files copied to '/home/application/current/abyss/static', 204 unmodified.
---- Pushing image "173.249.10.99:5000/tsuru/app-tsuru-dashboard:v1" to tsuru ----
The push refers to repository [173.249.10.99:5000/tsuru/app-tsuru-dashboard]
d6ceda4c4656: Pushed
691b5af91237: Pushed
9fcbcb0d2d9c: Pushed
8b7c9398215e: Pushed
6c8b164a219a: Pushed
4a7d5e6f8f02: Pushed
0f8a11f8ed4b: Pushed
a5e25c97cf5b: Pushed
296e644b7d2c: Pushed
f928ed1c7b60: Pushed
095c21c108c6: Pushed
c161a80a5f93: Mounted from tsuru/python
b46b7be76795: Mounted from tsuru/python
1e7aa790428a: Mounted from tsuru/python
b57c79f4a9f3: Mounted from tsuru/python
d60e01b37e74: Mounted from tsuru/python
e45cfbc98a50: Mounted from tsuru/python
762d8e1a6054: Mounted from tsuru/python
v1: digest: sha256:17704ac5916dbbe737784653e05e4a30b9b208ee3208018736e30ffc0f89a9fc size: 4091

---- Starting 1 new unit [web: 1] ----
---> Started unit 5f98fa9987 [web]

---- Binding and checking 1 new unit ----
---> healthcheck fail(5f98fa9987): Get http://167.86.127.220:32768/healthcheck/: dial tcp 167.86.127.220:32768: connect: connection refused. Trying again in 3s
---> healthcheck successful(5f98fa9987)
---> Bound and checked unit 5f98fa9987 [web]

---- Adding routes to new units ----
---> Added route to unit 5f98fa9987 [web]

---- Setting router healthcheck (Path: /) ----

OK
Applying iptables workaround for docker 1.12...
Failed to apply iptables rule: ssh command error:
command : PATH=$PATH:/usr/sbin/:/usr/local/sbin; sudo iptables -D DOCKER-ISOLATION -i docker_gwbridge -o docker0 -j DROP
err : exit status 1
output : iptables: Bad rule (does a matching rule exist in that chain?).
. Maybe it is not needed anymore?
Failed to apply iptables rule: ssh command error:
command : PATH=$PATH:/usr/sbin/:/usr/local/sbin; sudo iptables -D DOCKER-ISOLATION -i docker0 -o docker_gwbridge -j DROP
err : exit status 1
output : iptables: Bad rule (does a matching rule exist in that chain?).
. Maybe it is not needed anymore?
--- Installation Overview ---
Core Hosts:
+---------------+-------+---------+
| IP | State | Manager |
+---------------+-------+---------+
| 173.249.10.99 | ready | true |
+---------------+-------+---------+

Core Components:
+----------------+-------+----------+
| Component | Ports | Replicas |
+----------------+-------+----------+
| tsuru_registry | 5000 | 1 |
+----------------+-------+----------+
| tsuru_planb | 80 | 1 |
+----------------+-------+----------+
| tsuru_tsuru | 8080 | 1 |
+----------------+-------+----------+
| tsuru_redis | | 1 |
+----------------+-------+----------+
| tsuru_mongo | | 1 |
+----------------+-------+----------+
Configured default user:
Username: admin@example.com
Password: admin123
Apps Hosts:
+-----------------------------+---------+---------+----------------------------------+
| Address | IaaS ID | Status | Metadata |
+-----------------------------+---------+---------+----------------------------------+
| https://167.86.127.220:2376 | | ready | LastSuccess=2019-06-21T04:54:05Z |
| | | | pool=theonepool |
+-----------------------------+---------+---------+----------------------------------+
| https://167.86.127.225:2376 | | waiting | pool=theonepool |
+-----------------------------+---------+---------+----------------------------------+
| https://173.249.10.99:2376 | | waiting | pool=theonepool |
+-----------------------------+---------+---------+----------------------------------+
Apps:
+-----------------+------------+--------------------------------------+
| Application | Units | Address |
+-----------------+------------+--------------------------------------+
| tsuru-dashboard | 1 starting | tsuru-dashboard.173.249.10.99.nip.io |
+-----------------+------------+--------------------------------------+

# fititnt at bravo in /alligo/code/eticaai/aguia-pescadora/diario-de-bordo/tsuru-inicializacao on git:master x [1:54:21]

0 comments on commit ac74a4c

Please sign in to comment.