Lab 6

Automated car service deployment

Lab Goal

To leverage Ansible automation to deploy .Net web service in a container.

ARCHITECTURE

Deploy .Net web service in a container

WHERE ARE PLAYBOOKS?

  • The travel backend services are deployed using Ansible playbooks
  • They are found here:

    • $ cd support/playbooks/deploy-ocp-services


  • Let's deploy the car service:

    • $ ./ansible-playbook-dotnetservice.sh

PLAYBOOK START

  • The car service playbook stars with messages, setup and logging in to the OpenShift Container Platform:

    • $ ./ansible-playbook-dotnetservice.sh

PLAYBOOK DEPLOYMENT

  • The car service playbook finally deploys a new container, patches config to expose ports, exposes a service route and reports playbook status as it finishes:

IF BUILD FAILS

  • The playbook can fail if adding .Net stream failed
  • To determine cause, see the error message:

HOW TO FIX

For some reason the .Net stream was not added, do this by hand:

  • $ oc login -u system:admin

  • $ oc create -n openshift -f /'https://raw.githubusercontent.com/openshift/openshift-ansible/master/roles/openshift_examples/files/examples/latest/image-streams/dotnet_imagestreams.json'



Then run car service playbook again (or if build in OCP console failed, rebuild it):

  • $ ./ansible-playbook-dotnetservice.sh

DEPLOYED CARS SERVICE

  • When a build finishes you see a new deployment container appears in Monitoring view under Deployments:

END LAB 6

QUESTIONS?

Eric D. Schabell
Portfolio Architect Director
@ericschabell
http://schabell.org

UP NEXT...

Lab 7 - Hotel service playbook