ECS cluster turnup with CoreOS and Terraform

Recently I have been evaluating different container clustering tools and technologies.  It has been a fun experience thus far, the tools and community being built around Docker have come a long time since I last looked.  So for today’s post I’d like to go over ECS a little bit.

ECS is essentially the AWS version of container management.  ECS takes care of managing your Docker (container) infrastructure by handling creation, management, destruction and scheduling as well as providing API integration with other AWS services, which is really powerful.  To get ECS up and running all you need to do is create an ECS cluster, either from the AWS console or from some other AWS integration like the CLI or Terraform, then install the agent on servers that you would like ECS to schedule work on.  After setting up the agent and cluster name you are basically ready to go, start by creating a task and then create a service to start running containers on the cluster.  Some cool new features have been announced at this years re:Invent conference but I haven’t had a chance yet to look at them yet.

First impression of ECS

The best part about testing ECS by far has been how easy it is to get set up and running.  It took less than 20 minutes to go from nothing to fully functioning cluster that was scheduling containers to hosts and receiving load.  I think the most powerful aspect of ECS is its integration with other AWS services.  For example, if you need to attach containers/services to a load balancer, the AWS infrastructure is already there so the different pieces of the infrastructure really mesh well together.

The biggest downside so far is that the ECS console interface is still clunky.  It is functional, and I have been able to use it to do everything I have needed but it just feels like it needs some polish and things are nested in menu’s and usually not easy to find.  I’m sure there are plans to improve the interface and as mentioned above some new features were recently announced, so I have a feeling there will be some nice improvements on the way.

I haven’t tried the CLI tool yet but it looks promising for automating containers and services.

Setting things up

Since I am a big fan of CoreOS I decided to try turning up my ECS cluster using CoreOS as the base OS and Terraform to do the heavy lifting and provisioning.

The first step is to create your cluster.  I noticed in the AWS console there was a configuration wizard that guides you through your first cluster which was annoying because there wasn’t a clean way to just create the cluster.  So you will need to follow the on screen instructions for getting your first environment set up.  If any of this is unclear there is a good guide for getting started with ECS here.

After your cluster has been created there is a menu that shows your ECS environments.

ECS cluster menu

 

 

 

 

 

 

 

 

 

 

Next, you will need to turn on the nodes that will be connecting to this cluster.  The first part of this is to get your cloud-config set up to connect to the cluster.  I used the CoreOS docs to set up the ECS agent, making sure to change the ECS_CLUSTER= section in the config.

#cloud-config

coreos:
  units:
  -
  name: amazon-ecs-agent.service
  command: start
  runtime: true
  content: |
  [Unit]
  Description=Amazon ECS Agent
  After=docker.service
  Requires=docker.service
  Requires=network-online.target
  After=network-online.target

  [Service]
  Environment=ECS_CLUSTER=my-cluster
  Environment=ECS_LOGLEVEL=warn
  Environment=ECS_CHECKPOINT=true
  ExecStartPre=-/usr/bin/docker kill ecs-agent
  ExecStartPre=-/usr/bin/docker rm ecs-agent
  ExecStartPre=/usr/bin/docker pull amazon/amazon-ecs-agent
  ExecStart=/usr/bin/docker run --name ecs-agent --env=ECS_CLUSTER=${ECS_CLUSTER} --env=ECS_LOGLEVEL=${ECS_LOGLEVEL} --env=ECS_CHECKPOINT=${ECS_CHECKPOINT} --publish=127.0.0.1:51678:51678 --volume=/var/run/docker.sock:/var/run/docker.sock --volume=/var/lib/aws/ecs:/data amazon/amazon-ecs-agent
  ExecStop=/usr/bin/docker stop ecs-agent

Note that the Environment=ECS_CLUSTER=my-cluster, this is the most important bit to get the server to check in to your cluster, assuming you named it “my-cluster”.  Feel free to add any other values your infrastructure may need.  Once you have the config how you want it, run it through the CoreOS cloud-config validator to make sure it checks out.  If everything looks okay there, your cloud-config should be ready to go.

You can find more info about how to configure the ECS agent in the docs here.

Once you have your cloud-config in order, you will need to get your Terraform “recipe” set up.  I used this awesome github project as the base for my own project.  The Terraform logic from there basically creates an AWS launch config and autoscaling group (and uses the cloud-config from above) to launch instances in to your cluster.  And the ECS agent takes care of the rest, once your servers are up and the agent is reporting in to the cluster.

launch_config.tf

resource "aws_launch_configuration" "ecs" {
  name = "ECS ${var.cluster_name}"
  image_id = "${var.ami}"
  instance_type = "${var.instance_type}"
  iam_instance_profile = "${var.iam_instance_profile}"
  key_name = "${var.key_name}"
  security_groups = ["${split(",", var.security_group_ids)}"]
  user_data = "${file("../cloud-config/ecs.yml")}"

  root_block_device = {
    volume_type = "gp2"
    volume_size = "40"
  }
}

Notice the user_data section.  This is where we inject the cloud config from above to provision CoreOS and launch the ECS agent.

autoscaler.tf

resource "aws_autoscaling_group" "ecs-cluster" {
  availability_zones = ["${split(",", var.availability_zones)}"]
  vpc_zone_identifier = ["${split(",", var.subnet_ids)}"]
  name = "ECS ${var.cluster_name}"
  min_size = "${var.min_size}"
  max_size = "${var.max_size}"
  desired_capacity = "${var.desired_capacity}"
  health_check_type = "EC2"
  launch_configuration = "${aws_launch_configuration.ecs.name}"
  health_check_grace_period = "${var.health_check_grace_period}"

  tag {
    key = "Env"
    value = "${var.environment_name}"
    propagate_at_launch = true
  }

  tag {
    key = "Name"
    value = "ECS ${var.cluster_name}"
    propagate_at_launch = true
  }
}

There are a few caveats I’d like to highlight with this approach.  First, I already have an AWS infrastructure in place that I was testing agains this.  So I didn’t have to do any of the extra work to create a VPC, or a gateway for the VPC.  I didn’t have to create the security groups and subnets either, I just added them to the Terraform code.

The other caveat is that if you want to use the Github project I linked to you will need to make sure that you populate the variables with your own environment specific values.  That is why having the VPC, subnets and security groups was handy for me.  Be sure to browse through the variables.tf file and substitute in your own values.  As an example,  I had to update the variables to use the CoreOS 766.4.0 image.  This AMI will be specific to your AWS region so make sure to look up the AMI first.

variable "ami" {
  /* CoreOS 766.4.0 */
  default = "ami-dbe71d9f"
  description = "AMI id to launch, must be in the region specified by the region variable"
}

Another part I had to modify to get the Github project to work was adding in my AWS credentials which look similar to the following.  Make sure to update these variables with your ID and secret.

provider "aws" {
  access_key = "${var.access_key}"
  secret_key = "${var.secret_key}"
  region = "${var.region}"
}

variable "access_key" {
  description = "AWS access key"
  default = "XXX"
}

variable "secret_key" {
  description = "AWS secret access key"
  default = "xxx"
}

Make sure to also copy/edit the autoscaling.tf and launch_config.tf files to reflect anything that is specific to your environment (Terraform will complain if there are issues).

After you have combed through the variables.tf and updated the Terraform files to your liking you can simply run terraform plan -input=false and see how Terraform will create the ASG for you.

If everything looks good, you can run terrafrom apply -input=false and Terraform will go out and start building your new ECS infrastructure for you.  After a few minutes check the EC2 console and your launch config and autoscaling group should be in there.  If that stuff all looks okay, check the ECS console and your new servers should show up and be ready to go to work for you!

NOTE: If you are starting from scratch, it is possible to do all of the infrastructure provisioning via Terraform but it is too far out of the scope of this post to cover because there are a lot of steps to it.

Read More

Welcome to Ice36: Discover the Ice36 Casino Experience

Experience the thrill of gaming at Ice36 Casino, a premier online destination for gambling enthusiasts. Whether you’re looking for the excitement of table games or the allure of slots, Ice36 has it all.

Ice36 Casino Logo

Your Adventures Begin with Ice36 Login

Starting your journey with Ice36 Casino is a seamless process. The straightforward Ice36 login grants you instant access to a vast array of casino games and exciting opportunities.

Maximize Fun with Ice36 Free Spins

Once logged in, players can avail themselves of numerous Ice36 free spins offers. These spins provide an excellent chance to explore different games without any additional cost, making your gaming experience both thrilling and economical.

Exploring the Ice36 App

Stay connected to your favorite games with the Ice36 app. The app is designed for both convenience and functionality, offering a smooth interface that keeps you immersed in the game, wherever you go.

Unlock Excitement with Ice36 Bonus

New players can take advantage of generous Ice36 bonus offers that boost their initial deposit, providing more opportunities to win big and enjoy extended playtime.

Why Choose Ice36?

Choosing Ice36 means opting for unrivaled quality in online gaming. The platform is renowned for its excellent customer support, vast game selection, and secure payment options.

See for Yourself

Watch this exciting introduction to the Ice36 gaming experience:

Join thousands of satisfied players and elevate your gaming experience today at Ice36 Casino.

Read More

Scopri le Meraviglie di Winspark Casino: Bonus, App e Login

Introduzione a Winspark Casino

Benvenuti nel mondo entusiasmante di Winspark Casino, una piattaforma di gioco online che offre una vasta gamma di opzioni avvincenti per gli appassionati del gioco d’azzardo. Grazie alla sua interfaccia user-friendly, Winspark Casino è diventato un punto di riferimento per coloro che cercano esperienze di gioco emozionanti e bonus allettanti.

Guida al Winspark Login e alla Registrazione

Accedere a Winspark è semplice e veloce. L’interfaccia di login intuitiva garantisce che i giocatori possano facilmente accedere ai loro account e iniziare a giocare in pochi secondi. Assicuratevi di avere i vostri dettagli di accesso pronti per accedere a tutte le fantastiche funzionalità di Winspark Casino.

Punti Salienti del Winspark Casino Bonus

Uno dei fattori che rendono Winspark irresistibile è la varietà di bonus offerti. Sia che siate nuovi giocatori che clienti abituali, ci sono sempre promozioni esclusive pronte per voi. Non perdete l’opportunità di moltiplicare il vostro divertimento con i bonus del Winspark Casino.

Esplora il Winspark Casino Online e l’App

Winspark non è solo un sito web, ma un’esperienza completa grazie alla sua pratica app. L’app di Winspark consente ai giocatori di godere dei loro giochi preferiti ovunque si trovino. Sia che stiate utilizzando un computer o uno smartphone, Winspark Casino garantisce un’esperienza fluida e coinvolgente.

Immagine di Winspark Casino

Divertimento Senza Fine con il Winspark Slot

Se i giochi di slot sono la vostra passione, il Winspark Slot offre una vasta selezione di macchine colorate e ricche di funzionalità per catturare la vostra immaginazione. Ogni slot racconta una storia unica, pronta per essere scoperta e vissuta.

Conclusione

Che si tratti del bonus, delle slot, o della comodità del login, Winspark Casino è una destinazione imperdibile per gli appassionati dei casinò online. Non esitate a navigare sul loro sito e scoprire tutto ciò che hanno da offrire per un’esperienza di gioco entusiasmante.

Vedi!

Guarda questo video emozionante su Winspark Casino per ulteriori dettagli:

Read More

Ontdek Betcity: Alles over de Betcity App, Casino en Inloggen op Betcity NL

Welkom bij Betcity! Deze bestemming is perfect voor iedereen die op zoek is naar een top casino-ervaring. Of je nu de Betcity app gebruikt op je smartphone of direct via jouw browser speelt, de mogelijkheden zijn eindeloos. Met spannende spellen en een gebruiksvriendelijke interface, biedt Betcity een ervaring die niet snel wordt vergeten.

Betcity Casino

Het inloggen op Betcity nl is eenvoudig en veilig, waardoor je snel kunt spelen zonder gedoe. Zodra je bent ingelogd, opent zich een wereld aan mogelijkheden, variërend van klassieke tafelspellen tot moderne slotmachines.

Waarom kiezen voor Betcity?

Betcity biedt niet alleen een uitgebreide spelcollectie maar ook uitstekende bonussen voor zowel nieuwe als ervaren spelers. Mis de kans niet om met hun promoties een voorsprong te krijgen.

Read More

Fedezze fel a TippmixPRO lehet?ségeit: Tippmixpro app, Tippmixpro bónusz, és Tippmixpro online

A TippmixPRO izgalmas lehet?ségeket kínál a sportfogadási rajongók számára. Az online világ el?nyeit kihasználva most még kényelmesebbé és elérhet?bbé válik számunkra a fogadás. Akár útközben mobilon, akár otthonról számítógépen keresztül játszhatunk a Tippmixpro app segítségével, mely letisztult és könnyen használható felülettel rendelkezik.

Az új Tippmixpro app el?nyei

A Tippmixpro app egy innovatív alkalmazás, amely lehet?vé teszi, hogy bárhol, bármikor fogadhassunk kedvenc csapatainkra. Az alkalmazás letölthet? mind Android, mind iOS platformra, így szinte mindenki számára elérhet?vé válik. Az applikáció segítségével gyorsan hozzáférhetünk a legfrissebb mérk?zés-információkhoz és fogadási lehet?ségekhez.

Tippmixpro bónusz képe

Kihagyhatatlan Tippmixpro bónuszok

A Tippmixpro bónusz különleges lehet?ségeket kínál az új és meglév? fogadóknak egyaránt. Az üdvözl? bónuszok mellett rendszeres promóciók és jutalmak várják a játékosokat. Ezek a bónuszok nagymértékben növelhetik nyerési esélyeiket, miközben extra fogadási lehet?ségeket biztosítanak.

Kategória Leírás
Els? Befizetési Bónusz Akár 30 000 FT befizetési bónusz minden új játékos számára.
H?ségprogram Részvétel a rendszeres versenyeken és lottójátékokon.

Tippmixpro online: a jöv? fogadási platformja

Az online fogadási platformok rohamos fejl?dése nagy mértékben megváltoztatta a fogadók szokásait. A Tippmixpro online használatával könnyedén követhetjük nyereményeink alakulását, hozzáférhetünk a statisztikákhoz és az él? közvetítésekhez is. A biztonságos fizetési módok és a felhasználóbarát felület pedig garantálja a zavartalan játékélményt.

Összességében a TippmixPRO kiváló lehet?ség mindazok számára, akik szeretnék kihasználni a sportfogadás izgalmait és potenciális nyereségeit az online platformok el?nyeivel összekapcsolva. Próbálja ki most, és élvezze a fogadás új dimenzióit!

Read More