Skip to content

linuxpolska/ansible-container-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open Source Day 2017 Warsaw Ansible+Docker+Azure Workshops

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!

Materials

Slides are available here.

Demo (in Polish):

asciicast

Hint: you can copy-and-paste from this Asciicast :)

youtube

Lab Replay

Replay this lab at home by following easy steps:

  1. Register free account on Docker Hub: https://hub.docker.com/
  2. Install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli
  3. Download this repository (green button in top right corner of github page)
  4. Edit azuredeploy.parameters.json and insert your servicePrincipalClientId and servicePrincipalClientSecret (sshRSAPublicKey will be auto-generated)
  5. Install Azure kubernetes cluster with provided deploy script
  6. Check your cluster IP address with ```az acs list'''
  7. Login onto "developement" VM: ssh -i .ssh/az_acs azureuser@...
    1. We will use example Wordpress (app+database) docker set: cd examples/wordpress
    2. Examine set of containers (container.yml) and provided ansible playbook (main.yml)
    3. First we build our images: ansible-container build
    4. Now we can run them (interactively, or with -d option - in backgroud): ansible-container run [-d]
    5. (Point your browser to http://YOUR-ACS-INSTANCE and play with Wordpress demo)
    6. Login from your developement to Docker Hub: docker login
    7. Push your applications to Docker Hub: ansible-container push
    8. Examine pushed images (check "Tags" tab) on Docker Hub: https://hub.docker.com/
    9. Create production-ready recipes for Kubernetes ansible-container shipit kube --save-config
    10. Create services: kubectl create -f ansible/shipit_config/kubernetes/
    11. Get pods information: kubectl get pods
    12. Notice how application and database images has been pulled from Docker Hub repository.
    13. Get instance information (Your instance ID will differ slightly): kubectl describe pod wordpress-...
    14. Get services information: kubectl get service wordpress
    15. Connect to the external IP of your wordpress (either with ssh dynamic port forwarding or plain curl -sL)
  8. Once complete cleanup your lab environment: az group delete --name ... --yes
  9. Try other examples by yourself, explore, research and... have fun!

References

BUGS