1
0
mirror of https://github.com/jcwimer/startup-infrastructure synced 2026-03-24 22:34:42 +00:00

Switched to kubernetes

This commit is contained in:
2019-10-25 17:57:00 -04:00
parent da3b80c69a
commit 01f384ac14
40 changed files with 1293 additions and 521 deletions

View File

@@ -1,30 +1,29 @@
# startup-infrastructure
This is an Ansible playbook that configures a Docker Swarm cluster and deploys a full set of self hosted tools for a new company. After you point a wildcard A record to the swarm, you will be able to access the following tools. The goal of this project is to create a one stop shop for self hosting your infrastructure.
This is an Ansible playbook that configures a Kubernetes cluster and deploys a full set of self hosted tools for a new company. After you point a wildcard A record to the cluster, you will be able to access the following tools. The goal of this project is to create a one stop shop for self hosting your infrastructure.
### Services
1. Docker management GUI - Using [Portainer](https://portainer.io/)
2. Internal swarm load balancer and letsencrypt endpoint - [Traefik](https://traefik.io/)
### URLs in your environment. If you use ssl obviously these will be https Assuming your A record is *.test.com:
1. http://portainer.test.com/ - Portainer
2. http://swarm.test.com:8081/ - Traefik load balancer dashboard
1. Kanban board - Using [Wekan](https://wekan.github.io/). This is connected to Mongo DB and will be accessable at http://kanban.root_domain
2. Mysql cluster - Using [Presslabs Mysql Operator](https://www.presslabs.com/docs/mysql-operator/getting-started/)
3. MongoDB cluster
# Deploy
### Requirements
### Requirements for deployment machine (for the machine you're executing the deploy from)
1. Python
2. Pip
3. Pipenv
4. SSH access to all nodes you're deploying to.
* You will need to define and environment variable for your ssh key. `export PRIVATE_KEY="/location/of/key"`
* OR you will need a ssh agent running
4. Docker
5. SSH access to all nodes you're deploying to.
### Requirements for infrastructure (the machines you're deploying to)
1. Ubuntu
2. Internet access
### Steps
1. Copy hosts.example to hosts
1. Copy `hosts.example` to `hosts`
* Put ip addresses under the sections
* Bootstrap will be the first node in the cluster. If you are only doing a one node cluster, this is where you put your ip
* Managers are nodes used for managing a swarm cluster. Managers are recommended in 3's or 5's (bootstrap is a manager). Please see this for swarm best practices: https://docs.docker.com/engine/swarm/admin_guide/
* Masters are nodes used for managing a kubernetes cluster. It is recommended to has 3 or 5 masters.
* Workers are nodes used for running containers. You can have as many as necessary.
2. Copy group_vars/all.example to group_vars/all
* This is where a lot of configuration comes in. Please see our documentation.
@@ -40,8 +39,10 @@ You can easily run a lab environment with Vagrant.
3. Run `vagrant up`
4. Run `vagrant ssh client -c 'bash /vagrant/tests/files/run-test-deploy.sh'`
5. Put the following in your `/etc/hosts` file:
* `192.168.254.2 swarm.test.com`
* `192.168.254.2 portainer.test.com`
```
192.168.254.2 kanban.test.com
192.168.254.2 mysql-orchestrator.test.com
```
6. Now navigate to any of the services at http://servicename.test.com