Skip to content

Commit

Permalink
aguia-pescadora-charlie (#58): tsuru install-config-init (gerado arqu…
Browse files Browse the repository at this point in the history
…ivos padrões de configuração para inicializar o tsuru remotamente)
  • Loading branch information
fititnt committed Jun 2, 2019
1 parent 0a2936a commit 3f5e004
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 1 deletion.
23 changes: 22 additions & 1 deletion logbook/aguia-pescadora-charlie.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ vim /etc/sysctl.conf
# @see https://github.com/tsuru/tsuru
# @see https://tsuru-client.readthedocs.io

# Esta sessão é totalmente como usuário root
sudo su
sudo cd ~

### Tsuru client (requisito para instalar o tsuru) _____________________________
# A instação do Tsuru em https://docs.tsuru.io/stable/installing/using-tsuru-installer.html
Expand All @@ -145,9 +148,15 @@ vim /etc/sysctl.conf
# desatualziados o suficiente em relação a opção oferecida em https://github.com/tsuru/tsuru-client/releases
# (ultima: 1.7.0-rc2 de 2019-02-22, ou a 1.6.0 de 2018-07-19).

mkdir /root/tsuru-setup
cd /root/tsuru-setup

wget https://github.com/tsuru/tsuru-client/releases/download/1.6.0/tsuru_1.6.0_linux_amd64.tar.gz
tar -vzxf tsuru_1.6.0_linux_amd64.tar.gz
sudo mv tsuru /usr/local/bin
mv tsuru /usr/local/bin

cd /root/tsuru-setup
rm tsuru_1.6.0_linux_amd64.tar.gz

# TODO: considerar adicionar bash-completion além de apenas o bash
# (fititnt, 2019-06-02 03:18 BRT)
Expand All @@ -156,3 +165,15 @@ cat misc/bash-completion
# ~/.bash_aliases do usuário que usaria o tsuru
touch ~/.bash_aliases
cat misc/bash-completion >> ~/.bash_aliases

### Cria arquivos de especificação do tsuru ____________________________________
sudo tsuru install-config-init
# O comando acima criará arquivos padrões no diretório atual

vim /root/tsuru-setup/install-compose.yml
vim /root/tsuru-setup/install-config.yml

### Continuar...
# @see https://docs.tsuru.io/stable/installing/using-tsuru-installer.html#installing-on-already-provisioned-or-physical-hosts
# @see https://docs.docker.com/machine/overview/
# @see https://dev.to/zac_siegel/using-docker-machine-to-provision-a-remote-docker-host-1267
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: "3"

services:
redis:
image: redis:latest
networks:
- tsuru
volumes:
- redis-data:/data

mongo:
image: mongo:latest
networks:
- tsuru
volumes:
- mongo-data:/data/db
- mongo-config:/data/configdb

planb:
image: tsuru/planb:latest
command: --listen :8080 --read-redis-host redis --write-redis-host redis --access-log stdout
ports:
- 80:8080
networks:
- tsuru
depends_on:
- redis

registry:
image: registry:2
environment:
- "REGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY=/var/lib/registry"
- "REGISTRY_HTTP_TLS_CERTIFICATE=/certs/{{CLUSTER_PRIVATE_ADDR}}:5000/registry-cert.pem"
- "REGISTRY_HTTP_TLS_KEY=/certs/{{CLUSTER_PRIVATE_ADDR}}:5000/registry-key.pem"
volumes:
- "/etc/docker/certs.d:/certs:ro"
- registry-data:/var/lib/registry
ports:
- 5000:5000
networks:
- tsuru

tsuru:
image: "{{TSURU_API_IMAGE}}"
volumes:
- "/etc/docker/certs.d:/certs:ro"
- "/etc/tsuru/tsuru.conf:/etc/tsuru/tsuru.conf:ro"
ports:
- 8080:8080
networks:
- tsuru
depends_on:
- redis
- mongo
- registry
- planb
environment:
- MONGODB_ADDR=mongo
- MONGODB_PORT=27017
- REDIS_ADDR=redis
- REDIS_PORT=6379
- HIPACHE_DOMAIN={{CLUSTER_ADDR}}.nip.io
- REGISTRY_ADDR={{CLUSTER_PRIVATE_ADDR}}
- REGISTRY_PORT=5000
- TSURU_ADDR=http://{{CLUSTER_ADDR}}
- TSURU_PORT=8080

networks:
tsuru:
driver: overlay
ipam:
driver: default
config:
- subnet: 10.0.9.0/24

volumes:
mongo-data:
mongo-config:
redis-data:
registry-data:

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
driver:
name: virtualbox
docker-flags:
- experimental
components:
install-dashboard: true
tsuru-image: tsuru/api:v1
tsuru:
config:
auth:
hash-cost: 4
token-expire-days: 2
user-registration: true
database:
name: tsuru
url: $MONGODB_ADDR:$MONGODB_PORT
docker:
auto-scale:
enabled: true
run-interval: $DOCKER_AUTOSCALE_RUN_INTERVAL
bs:
socket: /var/run/docker.sock
cluster:
mongo-database: cluster
mongo-url: $MONGODB_ADDR:$MONGODB_PORT
storage: mongodb
collection: docker
deploy-cmd: /var/lib/tsuru/deploy
registry: $REGISTRY_ADDR:$REGISTRY_PORT
repository-namespace: tsuru
router: hipache
run-cmd:
bin: /var/lib/tsuru/start
port: "8888"
tls:
root-path: /certs
host: $TSURU_ADDR:8080
listen: 0.0.0.0:8080
log:
disable-syslog: true
use-stderr: true
provisioner: docker
queue:
mongo-database: queuedb
mongo-url: $MONGODB_ADDR:$MONGODB_PORT
quota:
apps-per-user: 2
units-per-app: 4
repo-manager: none
routers:
hipache:
domain: $HIPACHE_DOMAIN
redis-server: $REDIS_ADDR:$REDIS_PORT
type: hipache
tls:
cert-file: /certs/cert.pem
key-file: /certs/key.pem
use-tls: false
name: tsuru
hosts:
apps:
size: 1
core:
size: 1

0 comments on commit 3f5e004

Please sign in to comment.