Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Rick and Morty of Automation: Ansible and O...

serverascode
November 07, 2018

The Rick and Morty of Automation: Ansible and OpenShift/OKD

This is a set of slides that was given to the Toronto Enterprise DevOps group about what you can do with Ansible and OpenShift/OKD. This is not meant to be a production discussion, rather an exploration of all the places that Ansible and OpenShift/OKD can work together, which is actually quite a few. That said, there are times when Ansible is not the best solution, choices must be made. :)

The Rick and Morty component was just to try to make it a bit more fun to put the slide deck together, and to try to answer the question as to which is which: Is Ansible Morty and Kubernetes Rick? If so, who's Jerry?

serverascode

November 07, 2018
Tweet

More Decks by serverascode

Other Decks in Technology

Transcript

  1. • Originally created by Michael DeHaan ◦ Note: recently released

    vespene.io some kind of build system • Configuration management system • Several important design decisions - advantages/disadvantages ◦ No agents ◦ Runs over SSH ◦ Uses YAML ◦ Module based ◦ Runs in order ◦ Not “compiled” ◦ Not centralized ◦ Does not store state (typically) ◦ AWX/Tower is a separate system WHAT IS ANSIBLE?
  2. 1. Provision resources on which to run OpenShift 2. Deploy

    OpenShift 3. Build containers with Ansible 4. Use OpenShift with basic modules 5. Use OpenShift Ansible Broker WAYS TO USE OPENSHIFT AND ANSIBLE TOGETHER
  3. Kubernetes OpenShift / OKD / OpenShift Origin Open Source Project

    Curated Kubernetes Distribution / Product N/A Project - High level Kubeadm, plus many other distros openshift-ansible Root containers yes by default Root containers no by default Service Catalog Container image registry Helm Charts Template Service Broker Ingress, etc Router Deployment DeploymentConfig N/A Image Streams Most Linuxes RedHat OS / CentOS
  4. PROVISION AWS RESOURCES WITH ANSIBLE FOR OPENSHIFT © 2018 Interdynamix

    Systems Slide 12 Provision AWS Resources with Ansible
  5. BASIC AWS DIAGRAM Public Subnet Private Subnet Worker 0 Worker

    1 Controller 0 Router 0 NAT GW INET GW Apps Wildcard ELB Console ELB Util 0 openshift-ansible NOTE: Note mean to denote best security practices, is simply what was deployed for this demo Worker N AWS Provisioner
  6. • That depends ◦ It’s not really purposely built as

    a provisioning system ◦ Ansible does not store state, so state (usually) ends up being resource names ◦ How do you know when a resource needs to change? ◦ But you can do it, and at least everything is in Ansible, you don’t have to switch to another tool, or integrate them together • Terraform ◦ A better provisioner ◦ Terraform destroy - so much fun ◦ But how to integrate with Ansible? ▪ Ansible terraform provisioner + terraform inventory script SHOULD YOU PROVISION WITH ANSIBLE?
  7. { "Version": "2012-10-17", "Statement": [ { "Action": "ec2:*", "Resource": "*",

    "Effect": "Allow", "Condition": { "StringEquals": { "ec2:Region": "ca-central-1" } } } ] } AWS PERMISSIONS Could be tightened up considerably, other permissions as well...ELB, Route53, S3
  8. What to use? • https://github.com/openshift/openshift-ansible-contrib • https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws • https://github.com/aws-quickstart/quickstart-redhat-openshift •

    https://github.com/openshift/openshift-ansible/tree/master/playbooks/aws • https://aws-quickstart.s3.amazonaws.com/quickstart-redhat-openshift/doc/re d-hat-openshift-on-the-aws-cloud.pdf PROVISION AWS INFRASTRUCTURE WITH ANSIBLE
  9. “You install OKD by running a series of Ansible playbooks.

    As you prepare to install your cluster, you create an inventory file that represents your environment and OKD cluster configuration. While familiarity with Ansible might make this process easier, it is not required.” - Docs • openshift-ansible Github Repo • Example hosts file from my deployment OPENSHIFT ANSIBLE
  10. “Ansible Container is an open source project that aims to

    enable the automation of the entire container build, deployment and management process. Best of all, it uses the same simple, powerful and agentless Ansible automation language that you’re already using, ensuring you can automate the entire application lifecycle.” - Docs ANSIBLE-CONTAINER
  11. Demo: Using Ansible k8s Module Docs • https://docs.ansible.com/ansible/2.6/modules/k8s_module.html • https://docs.ansible.com/ansible/2.5/modules/k8s_scale_module.html

    • https://docs.ansible.com/ansible/2.7/modules/k8s_facts_module.html • https://docs.ansible.com/ansible/2.4/helm_module.html • https://docs.ansible.com/ansible/2.5/plugins/inventory/k8s.html
  12. Interdynamix Edmonton 620 Manulife Place 10180 – 101 Street NW

    Edmonton, AB T5J 3S4 780.423.7005 Interdynamix Toronto 140 Yonge St. Suite 200 Toronto, ON M5C 1X6 • Email [email protected] • Code: https://github.com/ccollicutt/ansible-and-openshift-demo C © 2018 Interdynamix Systems Slide 39 https://hub.interdynamix.com/insight-report