Event will be held at 2017-05-17 15:00 CEST.
Discover how Ansible and Docker enables the process of container life cycle. Deploy and manage your infrastructure and applications from single management workstation. Participants will learn how to effectively use Ansible playbooks for reliable automation and compliance.
Just bring your own laptop with ssh client and web browser installed - this interactive workshop will employ Ansible to deploy Docker cluster on Azure cloud to bootstrap test invironments in just few minutes!
Slides are available here.
Demo (in Polish):
Hint: you can copy-and-paste from this Asciicast :)
Replay this lab at home by following easy steps:
- Register free account on Docker Hub: https://hub.docker.com/
- Install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
- Download this repository (green button in top right corner of github page)
- Edit
azuredeploy.parameters.json
and insert yourservicePrincipalClientId
andservicePrincipalClientSecret
(sshRSAPublicKey
will be auto-generated) - Install Azure kubernetes cluster with provided
deploy
script - Check your cluster IP address with ```az acs list'''
- Login onto "developement" VM:
ssh -i .ssh/az_acs azureuser@...
- We will use example Wordpress (app+database) docker set:
cd examples/wordpress
- Examine set of containers (
container.yml
) and provided ansible playbook (main.yml
) - First we build our images:
ansible-container build
- Now we can run them (interactively, or with
-d
option - in backgroud):ansible-container run [-d]
- (Point your browser to http://YOUR-ACS-INSTANCE and play with Wordpress demo)
- Login from your developement to Docker Hub:
docker login
- Push your applications to Docker Hub:
ansible-container push
- Examine pushed images (check "Tags" tab) on Docker Hub: https://hub.docker.com/
- Create production-ready recipes for Kubernetes
ansible-container shipit kube --save-config
- Create services:
kubectl create -f ansible/shipit_config/kubernetes/
- Get pods information:
kubectl get pods
- Notice how application and database images has been pulled from Docker Hub repository.
- Get instance information (Your instance ID will differ slightly):
kubectl describe pod wordpress-...
- Get services information:
kubectl get service wordpress
- Connect to the external IP of your wordpress (either with ssh dynamic port forwarding or plain
curl -sL
)
- We will use example Wordpress (app+database) docker set:
- Once complete cleanup your lab environment:
az group delete --name ... --yes
- Try other examples by yourself, explore, research and... have fun!
- http://alesnosek.com/blog/2016/09/12/first-impressions-about-ansible-container/
- https://github.com/ansible/ansible-container-examples/tree/master/wordpress
- https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
- 0.9.0.0 has breaking changes, reverted to 0.3.0 [ansible/ansible-container#448]