Related articles
HashiCorp: Terraform, Vault, Vagrant, Packer // Bodacious Blog

Gut Feeling

  • Lean towards Hashicorp products.

Infrastructure as Code (IaC)

  • Terraform
  • Ansible

Terraform

1
2
3
4
5
6
7
Terraform
    [hashicorp product]

    Infrastructure as Code.

    Provision and manage any cloud,
    infrastructure, or service.
  • create AMI using hashicorp packer
  • provision using hashicorp terraform

Ansible

  • Create AMI using hashicorp packer

  • The Ansible Packer provisioner runs Ansible playbooks.

    It dynamically creates an Ansible inventory file configured to use SSH, runs an SSH server, executes ansible-playbook , and marshals Ansible plays through the SSH server to the machine being provisioned by Packer.

Windows Containers on Amazon ECS

Link
AWS goes live with Windows containers… but contain yourselves: It’s going to be niche The Register
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
ECS
Elastic Container Service
    Fully managed container orchestration
    service.

    Customers such as Duolingo, Samsung, GE,
    and Cookpad use ECS to run their most
    sensitive and mission critical
    applications because of its security,
    reliability, and scalability.

    ECS is a great choice to run containers
    for several reasons.

    First, you can choose to run your ECS
    clusters using AWS Fargate, which is
    serverless compute for containers.

    Fargate removes the need to provision and
    manage servers, lets you specify and pay
    for resources per application, and
    improves security through application
    isolation by design.

    Second, ECS is used extensively within
    Amazon to power services such as Amazon
    SageMaker, AWS Batch, Amazon Lex, and
    Amazon.comโ€™s recommendation engine,
    ensuring ECS is tested extensively for
    security, reliability, and availability.

Containers were:

  • introduced in Windows Server 2016
  • enhanced in Windows Server 2019

Windows Containers on ECS have caveats that show limitations versus the more commonly used Linux-based containers.

Provides AMIs of both types in order to run your Windows containers.

These AMIs include Docker 18.09 as well as the ECS Agent.

Caveats

1
In order to run a Windows container, you must manage your own cluster of EC2 (Elastic Compute Cloud) instances.

No Windows version of AWS Fargate, a serverless container launch type.

2
Most of the AWS task definitions by which you can configure a container are not available for Windows containers.

If you want to use Amazon Identity and Access Management (IAM) roles for tasks, you must run some PowerShell code in the container and use a credential proxy that must listen on port 80, normally used for HTTP.

If you want to publish port 80, you have to use a load balancer and port mapping.

3
Windows Server Containers are large, typically starting at 9GB, so more storage is needed, though a reduced container size is available if you use Server 2019.

Set up a windows docker machine (to test out octopus)

install vmware

Uninstall vmware player

1
sudo vmware-installer --uninstall-product vmware-player

install VMware Workstation Pro

1
sudo sh $DL/VMware-Workstation-Full-15.5.2-15785246.x86_64.bundle

https://websiteforstudents.com/installing-vmware-workstation-14-pro-ubuntu-17-04-17-10/

packer

1
2
cd $MYGIT/StefanScherer/packer-windows
packer build "--only=vmware-iso" windows_2019_docker.json

This repository contains Windows templates that can be used to create boxes for Vagrant using Packer (Website) (Github).

Vagrant

https://www.vagrantup.com/docs/provisioning/docker.html

Install vagrant

1
2
cd "$DUMP$NOTES/ws/vagrant" unzip vagrant_2.2.9_linux_amd64.zip
cp -a vagrant ~/local/bin

Install windows

1
2
cd "$MYGIT/StefanScherer/windows-docker-machine"
vagrant up 2019-box

How to use?

1
grep-app vagrantfile .sh

Automate it

1
v +/vagrant cr

Ansible

Examples

https://www.guru99.com/ansible-tutorial.html

Playbooks

https://docs.ansible.com/ansible/latest/user%5Fguide/playbooks%5Fintro.html

https://github.com/ansible/ansible-examples

1
egr ansible examples github

https://github.com/ansible/ansible-examples

<zcd $MYGIT/ansible/ansible-examples>

Uses jinja2.

<$MYGIT/ansible/ansible-examples/mongodb/roles/mongos/templates/mongos.conf.j2>

Uses a hosts file to describe the servers

1
cd "$MYGIT/ansible/ansible-examples"; tp find-here-path "*hosts"
lamp_simple_rhel7/hosts
mongodb/hosts
tomcat-memcached-failover/hosts
jboss-standalone/hosts
phillips_hue/hosts
tomcat-standalone/hosts
lamp_haproxy/hosts
lamp_simple/hosts