Vagrant 1.8.6 ?

Like most of my team, I use vagrant to run local boxes for development of puppet builds, ruby apis and such like.

I recently upgraded my Windows workstation to vagrant 1.8.5 and immediately ran into an issue.

default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...

This monkey of an issue had me stumped for a while, as on another project, I was working with securing ssh logins to hosts on AWS, which made me suspect my id_rsa key setup under the git BASH.

My sanity has been saved by the admission of a bug on the vagrant issues list https://github.com/mitchellh/vagrant/issues/7610

A swift edit of the C:\HashiCorp\vagrant\embedded\gems\gems\vagrant-1.8.5\plugins\guests\linux\cap\public_key.rb file (line 58) and all is good again.

@@ -54,6 +54,7 @@
if test -f ~/.ssh/authorized_keys; then
grep -v -x -f '#{remote_path}' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys.tmp
mv ~/.ssh/authorized_keys.tmp ~/.ssh/authorized_keys
+ chmod 0600 ~/.ssh/authorized_keys
fi rm -f '#{remote_path}'

The easier fix is to head over to downloads where it is hoped that 1.8.6 will be released on 1st September 2016.

 

(Read more...)

Docker cleanup

Quick post about docker.
What is docker?
Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment. (https://www.docker.com/what-docker)

Docker is gaining popularity and some clients are using it in production. As a method to package and deploy self-sufficient applications in primarily stateless Linux containers it allows a consistent platform that in itself is quite simple for Ops to look after, and we don't need to know the inner workings of the application we are deploying.

However when writing and building Docker images, my virtual machine (local Docker host) starts looking a bit littered with docker containers and images. So here are a few commands to tidy up.

Kill running containers:

docker kill $(docker ps -qa)

Delete all containers (and their associated volumes):

docker rm -v $(docker ps -qa)

Remove all images:

docker rmi $(docker images -q)

(Thanks to Mike O'Conner)

(Read more...)

Regular Expressions - RegEx

Regular expressions can be a bit like marmite, some people love them and some hate them, and if you are like me, they just leave lots of room for confusion.

Fortunately there is a tool that will hopefully dispel some of the confusion.

https://regex101.com/

 

(Read more...)

Autoscaling

One of the single best features of using cloud servers, is the ability to add servers to a cluster on demand.

Here is a useful article about autoscaling and why you should consider in in your application design.

https://blog.codeship.com/autoscaling-purpose-strategies/

(Read more...)

AWS ELB upgrade - Layer 7 Load Balancing

AWS have announced Application (level 7 on the osi model) Load Balancing.
I've been using HA Proxy to achieve this for a while now.
Load balancer diagram
What does this mean to us?
You can now load balance and direct traffic to a 'target group' of servers. This means you can use on ELB for a website whilst using multiple server groups for each microservice. For instance anything with /api in the url can get directed at a different group to those with /backend in the url. In current setups we are using subdomains to do this, api.webdomain.com and backend.webdomain.com.

Having Application Load Balancers will allow us to simplify and reduce the number of ELBs needed, thus saving money.

This and more features can be found on amazon's blog. https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/

 

(Read more...)