илья шеер, Lower your tco with custom solutions and ngs

20
Lower your TCO with custom solutions and NGS Ilya Sher, CTO at Beame.io, software and systems engineer since 2001.

Transcript of илья шеер, Lower your tco with custom solutions and ngs

Lower your TCO with custom solutions and

NGS

Ilya Sher, CTO at Beame.io, software and systems engineer since 2001.

What are the best parts of the configuration management tools?

• Promises of easy life• Cute “hello world” examples• Marketing (“automate”!!!)• Hype

TL;DR of the talk

Configuration management tools — frustrating

Custom solution — betterCustom solution in NGS — even better

CM tools broken promises

Community modules vs real life

CM tools broken promises

Easy maintenance

CM tools marketing

FUD: You must standardize for the next

guy

Reality: simpler systems make everyone more

productive

CM tools vs custom tool - sample

Community module Custom code

2000+ lines of code 53 lines of bash code

Nginx module

Functionality overlap – roughly none

CloudFormation & Terraform

CloudFormation / Terraform

Custom solution

Code →Configuration file →Tool modifies cloud

Code modifies cloud

Your own custom solution

Fight complexityGet better with timeStop suffering eventually

The sad part

Making custom solution is harder than it should be

There is even no good language for that

Next Generation Shell

Finally, the language for systems engineering tasks

NGS - AWS library - anchor and properties

Anchor – reference new or existing resources (no state file!)

Properties – desired state of a resource

NGS - AWS library - anchor

# Make hashedge_vpc_anchor = {'Name': 'edge-vpc'}

# Find VPC by Name tag. Fail if there isn't exactly one.vpc = AWS::Vpc(edge_vpc_anchor).expect(1)

NGS - AWS library - properties

# Get load balancer by nameelb = AWS::Elb("${env}-${role}")

# Create or update load balancerelb.converge(

Tags = ...,ListenerDescriptions = ...,Subnets =

AWS::Subnet(edge_vpc_anchor).expect(2),...

)

NGS as an utility to use from your scripts

# In bash

> ips=$(ngs -pl '``aws ec2 describe-instances``.get("PublicIpAddress")')

> echo “$ips”52.58.X.Y35.156.XX.YY...

NGS - tests mini framework

# Declare and perform a testtest("[Registration token] Use") with {

child_entity = ``$BEAME_BIN creds …``expected = { 'parent_fqdn': …, … }

assert_hash_keys_values(child_entity,expected, "Correct values in child_entity")

}

NGS - tests mini framework

# Part of a testF test_server(fqdn:Str, ...) {

...assert_resolvable(fqdn)...

}

# Tests framework implementationF assert_resolvable(h:Str, ..., times=45, sleep=2) {

retry(times=times, sleep=sleep, ...)body => { `dig "+short" $h`.lines() }...

}

NGS advantages

1) Domain-specific2) For cloud3) Easy data manipulation4) Encourages TDD

Summary

Custom solutions – much simpler, lower TCO

Resist marketing bullshit

NGS – Help wanted

Let’s develop a language to express what we mean instead of bending our thinking to make some vendors richer

Next Generation Shell