All Projects → gregbkr → nomad-consult-ansible-centos

gregbkr / nomad-consult-ansible-centos

Licence: other
Deploy nomad & consult on centos with ansible

Programming Languages

python
139335 projects - #7 most used programming language
Nginx
273 projects

Projects that are alternatives of or similar to nomad-consult-ansible-centos

Hashi Ui
A modern user interface for @hashicorp Consul & Nomad
Stars: ✭ 1,119 (+6482.35%)
Mutual labels:  consul, hashicorp, nomad
nomad-box
Nomad Box - Simple Terraform-powered setup to Azure of clustered Consul, Nomad and Traefik Load Balancer that runs Docker/GoLang/Java workloads. NOTE: Only suitable in dev environments at the moment until I learn more Terraform, Consul, Nomad, Vault :P
Stars: ✭ 18 (+5.88%)
Mutual labels:  consul, hashicorp, nomad
local-hashicorp-stack
Local Hashicorp Stack for DevOps Development without Hypervisor or Cloud
Stars: ✭ 23 (+35.29%)
Mutual labels:  consul, hashicorp, nomad
Nomad Firehose
Firehose all nomad job, allocation, nodes and evaluations changes to rabbitmq, kinesis or stdout
Stars: ✭ 96 (+464.71%)
Mutual labels:  consul, hashicorp, nomad
Hashi Up
bootstrap HashiCorp Consul, Nomad, or Vault over SSH < 1 minute
Stars: ✭ 113 (+564.71%)
Mutual labels:  consul, hashicorp, nomad
vim-hcl
Syntax highlighting for HashiCorp Configuration Language (HCL)
Stars: ✭ 83 (+388.24%)
Mutual labels:  consul, hashicorp, nomad
Replicator
Automated Cluster and Job Scaling For HashiCorp Nomad
Stars: ✭ 166 (+876.47%)
Mutual labels:  consul, hashicorp, nomad
hashicorp-labs
Deploy locally on VM an Hashicorp cluster formed by Vault, Consul and Nomad. Ready for deploying and testing your apps.
Stars: ✭ 32 (+88.24%)
Mutual labels:  consul, hashicorp, nomad
damon
A terminal UI (TUI) for HashiCorp Nomad
Stars: ✭ 274 (+1511.76%)
Mutual labels:  hashicorp, nomad
offensive-infrastructure
Offensive Infrastructure with Modern Technologies
Stars: ✭ 88 (+417.65%)
Mutual labels:  consul, nomad
vault-load-testing
Automated load tests for Vault and Consul using the locust.io Python framework
Stars: ✭ 44 (+158.82%)
Mutual labels:  consul, hashicorp
nomad-demo
Vagrant based demo setup for running Hashicorp Nomad
Stars: ✭ 88 (+417.65%)
Mutual labels:  consul, nomad
nomad-service-alerter
Alerting for Nomad Jobs
Stars: ✭ 37 (+117.65%)
Mutual labels:  consul, nomad
deadman-check
Monitoring companion for Nomad periodic jobs and Cron
Stars: ✭ 49 (+188.24%)
Mutual labels:  consul, nomad
nomad
Dockerized Nomad
Stars: ✭ 33 (+94.12%)
Mutual labels:  hashicorp, nomad
vault-consul-swarm
Deploy Vault and Consul with Docker Swarm
Stars: ✭ 20 (+17.65%)
Mutual labels:  consul, hashicorp
hookpick
A tool to manage some operational concepts of Hashicorp Vault
Stars: ✭ 83 (+388.24%)
Mutual labels:  consul, hashicorp
100 Days Of Go
100 days of Go learning
Stars: ✭ 24 (+41.18%)
Mutual labels:  consul, nomad
gocast
GoCast is a tool for controlled BGP route announcements from a host
Stars: ✭ 55 (+223.53%)
Mutual labels:  consul, nomad
consul-templaterb
consul-template-like with erb (ruby) template expressiveness
Stars: ✭ 65 (+282.35%)
Mutual labels:  consul, hashicorp

Deploy Nomad & Consult via ansible, on Centos nodes

What you will get?

  • Setup a 3 nodes (1 server, 2 clients) hashicorp nomad container orchestrator
  • Run all on your prefered cloud provider via ansible

Architecture of the stack

nomad.PNG

  • Master/client nomad host: master will take care of electing cluster leader, planning and rescheduling nomad jobs. While client will report node status to the master and look for jobs to run, and then run container
  • Consul: service discovery. Nomad will record nodes, services in this database. Consul is replicated and present on all nodes so nomad agents always have access to this data locally
  • dnsmasq: a kind of proxy for dns resolution, route *.consul query to consul, and other query to localhost then internet
  • Ansible: recipe will provide easy deployment of the solution

Prerequisit

  • Ansible
  • A cloud infra providing centos hosts

Deploy nomad cluster

Clone this repo

git clone https://github.com/gregbkr/nomad-consult-ansible-centos && cd nomad

Please deploy 3 standard Centos hosts (nomad-server1, nomad-client1, nomad-client2) on your prefered cloud provider.

Edit ansible inventory with your ips and ssh access key:

nano inventory

Deploy consul, docker, dnsmasq & nomad

Run few times until you got no more errors)

ansible-playbook playbook.yml

Checks

Consul: you can view consul UI on http://a_node_ip:8500/ Here are registered nomad clients and consul itself.

Dnsmask will help redirect dns queries to *.consul Ssh connect to a node and try some dsn query:

ping node1.node.consul.
ping node2.node.consul.
ping consul.service.consul.	

Run nomad jobs

We will deploy here a very simple application:

  • One nginx which redirect 80 --> flask app on 5000
  • Flask app, which records in a redis database a number of view
  • A redis database, on port 6379

Each of these components exposes a service, registered and avalaible for query in consul.

Copy nomad jobs to a client node and connect to it:

scp -r -i ~/.ssh/id_rsa_sbexx jobs/* root@client_node_ip:/root/
ssh -i ~/.ssh/id_rsa_sbexx jobs root@client_node_ip

nomad run redis.nomad
nomad run flask.nomad
nomad run nginx.nomad

Test services

Redis

echo 'PING' | nc global-redis-check.service.consul 6379

flask

curl global-flask-check.service.consul:5000

Nginx

curl global-nginx-check.service.consul

Troubleshooting

check nomad status

nomad status
nomad server-members
nomad status redis
nomad alloc-status <alloc-id>

Delete nomad job

nomad stop redis
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].