Armada - the way to ship microservices
-
Upload
gamedesire-company -
Category
Technology
-
view
271 -
download
6
Transcript of Armada - the way to ship microservices
![Page 2: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/2.jpg)
AGENDA.
• Introduction.
• Overview.
• Features.
• Services.
![Page 3: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/3.jpg)
WHAT’S THE PROBLEM?
A sad developer’s story.
![Page 4: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/4.jpg)
THE BEGINNING.
• „Awesome Panel”.
• Written 5 years ago.
• Just add one feature, it’s really important.
![Page 5: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/5.jpg)
LET’S GET STARTED.
• Unknown technologies = unknown configurations.
• Uncommon technologies.
• Just because it works in production, doesn’t mean it works in dev.
![Page 6: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/6.jpg)
README.
BTW: Guy who wrote it quit two years ago, you’re on your own.
![Page 7: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/7.jpg)
ADDING THE FEATURE.
• There’s no jenkins task nor deployment script.
• Actually there is a script, hidden somewhere on some server.
• It’s deprecated.
![Page 8: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/8.jpg)
YOU’VE DONE IT!
![Page 9: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/9.jpg)
SO WHAT WAS THE PROBLEM EXACTLY?
• Application configuration in development/production environment.
• Knowledge about applications disappears over time.
• Sometimes it’s not even clear where a service is running.
![Page 10: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/10.jpg)
ARMADA
The solution to most of our problems.
![Page 11: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/11.jpg)
SO, WHAT IS ARMADA?
• A complete platform for microservices which handles:• Development,
• Deployment,
• Configuration.
• Enhances Docker with microservices oriented features.
![Page 12: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/12.jpg)
ARMADA’S FEATURES.
• Service discovery.
• Clustering.
• Load balancing.
• Configuration deployment.
• Health checks.
• Disaster recovery.
• Dynamic DNS configuration.
• Instant setup on development environment.
![Page 13: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/13.jpg)
TECHNOLOGY BEHIND ARMADA.
• Consul – Distributed services catalog.• Stores information about running services.
• HAProxy – Load balancer.• Maps services` addresses inside the container.
• Supervisord – Process control system.• Executes services and scripts.
• Vagrant.
![Page 14: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/14.jpg)
ARMADA’S SOLUTIONS
To most of our problems.
![Page 15: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/15.jpg)
DEPEDENCIES.
FROM microservice_python
RUN pip3 install requestsRUN pip3 install django
ADD . /opt/my-serviceADD supervisor/* /etc/supervisord/conf/
![Page 16: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/16.jpg)
SERVICE LEVEL DEPENDENCIES.
• Applications running on static ports, e.g.:• Backend: 10.0.0.1:30000
• Frontend: 10.0.0.1:30001
• Which leads to: • Conflicts.
• Longer Readmes.
• On the large scale: Pain in the very lower back.
![Page 17: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/17.jpg)
SERVICE LEVEL DEPENDENCIES.
• You need:• Service’s name.
• One config file.
![Page 18: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/18.jpg)
SERVICE DISCOVERY.
[program:require_my_backend]directory=/opt/microservice/local_magellancommand=require_service.py my-backend 2000
![Page 19: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/19.jpg)
HOW DOES IT WORK?
![Page 20: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/20.jpg)
AUTOMATIC LOAD BALANCING.
• Discovered services are automatically load balanced using `round-robin` method.
• Services with `critical` state are omited by load balancer.
![Page 21: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/21.jpg)
SERVICES’ STATES.
Armada services use health checks to set states:• Passing
• service works.
• Warning• service works but there’s something wrong.
• Critical• service doesn’t work.
![Page 22: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/22.jpg)
CUSTOM HEALTH CHECKS.
• By default every service only checks whether port 80 is open.• Yes – passing.
• No – critical.
• Custom health checks can be added to `health-checks` directoryanywhere inside the project.
• Default health check can be over overidden.
![Page 23: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/23.jpg)
MULTIPLE ENVIRONMENTS.
• Changed with one argument on container launch, e.g.:• armada run my-backend --env dev
• armada run my-backend --env production
• Requires you to simply have a configuration directory with env-corresponding name inside your project.
![Page 24: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/24.jpg)
ARMADA SERVICES.
![Page 25: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/25.jpg)
ARMADA IS MORE THAN JUST ENHANCED DOCKER.
![Page 26: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/26.jpg)
HAPROXY + MAGELLAN.
• Magellan: mini-DNS.• Updates HAProxy configuration.
• Maps running services to domain names, e.g.: • my-frontend (env: dev) -> my-frontend.dev.ganymede.eu
• Again, services are automatically load balanced.
![Page 27: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/27.jpg)
COURIER.
• Sometimes it’s necessary to keep configuration in a separaterepository.
• Courier fetches config code from git repository and distributes it to selected Armadas.
• Such config is available via `hermes` config provider script.
![Page 28: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/28.jpg)
COURIER.
1. Create Courier configuration.A. Specify destination Armadas.
B. Specify git repos with branch to check out.
2. Run Courier service in any armada cluster.
3. Now, everytime a repo is pushed to, your config will be distributedamong specified Armadas.
![Page 29: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/29.jpg)
OTHER SERVICES:• Armada-Bind (proxy).
• Dockyard (repository).
• Static File Server.
• MySQL.
• Redis.
![Page 30: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/30.jpg)
EASE OF DEVELOPMENT.
![Page 31: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/31.jpg)
DEVELOPMENT ENVIRONMENT.
• One-line setup of development environment.
• Automaticaly mounted volumes.
• Perfect for interpreted code.
![Page 32: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/32.jpg)
VAGRANT CONFIGURATION.require 'open-uri' armada_vagrantfile_path = File.join(Dir.tmpdir, 'ArmadaVagrantfile.rb') IO.write(armada_vagrantfile_path, open('http://vagrant.armada.sh/ArmadaVagrantfile.rb').read)
load armada_vagrantfile_patharmada_vagrantfile (:microservice_name => 'my-frontend',:origin_dockyard_address => 'dockyard.my-company.org',:configs_dir => 'config',
)
![Page 33: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/33.jpg)
![Page 34: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/34.jpg)
FIND US ON GITHUB!
Got questions?
![Page 35: Armada - the way to ship microservices](https://reader031.fdocuments.net/reader031/viewer/2022030206/58ab1b1b1a28abb5278b498f/html5/thumbnails/35.jpg)
https://github.com/armadaplatform/armada
http://armada.sh
Thank you!