Skip to content

neilhudson/cbdemo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cbdemo

Uses Docker Compose to build a Jenkins Operations Center high availability environment using Docker containers.

Currently specific to Mac OS X.

####Base includes:

  • dnsdock providing DNS for docker containers and exposed to Mac OS X
  • HA Jenkins Operation Center proxied via HAProxy
  • HA Client Master proxied via HAProxy
  • 2 shared slaves

###Instructions

  • install boot2docker
  • install Docker Compose
  • run boot2docker and add bip and dns docker daemon default options
    • boot2docker ssh
    • vi /var/lib/boot2docker/profile
    • add the following line and save: EXTRA_ARGS="-bip=172.17.42.1/24 -dns 172.17.42.1 -dns 8.8.8.8"
    • exit ssh and restart boot2docker: boot2docker restart
    • update the VirtualBox network adapter (vboxnet - number may vary) Promiscuous Mode to Allow All
  • Route traffic from Mac OS X to boot2docker VM IP: sudo route -n add -net 172.17.0.0 <BOOT2DOCKER_IP>
    • BOOT2DOCKER_IP retrieved via boot2docker ip
  • Configure OS X to use dnsdock DNS by creating the file /etc/resolver/docker with content of nameserver 172.17.42.1
  • clone this repo somewhere under the /Users directory
  • Update the docker-compose.yml file:
    • Update /Users/kmadel/dev/CloudBees/docker/cbdemo under dnsdock -> volumes to point to where you cloned this repo. NOTE: You could have several different directories configured for different demos and just change this to point to the demo you want to run.
    • Update the jocproxy and apiteamproxy services' volumes to point to the respective haproxy subfolders where you cloned this repo
  • from your boot2docker shell, run docker-compose up -d and after a few minutes (maybe a bit longer) you should have:

###Gotchas If you are no longer able to access docker container hosts via Mac OS X:

  • check that the route is correct: sudo route -n add -net 172.17.0.0 192.168.59.103
    • Gateway should be boot2docker ip
  • make sure you are able to ping the boot2docker ip - ex (the IP may vary): ping 192.168.59.103 from Mac OS X
  • check to see that the ip route you added, still points to your boot2docker ip - sudo route -n get 172.17.42.1
  • You may have to flush DNS cache - on Yosemite use: sudo discoveryutil mdnsflushcache

###Create a New Demo

  • You should probably fork this repo, but not absolutely necessary
  • checkout a new branch: git checkout -b workflow-demo master
  • update docker-compose.yml to include whatever additional Docker containers you may need - dnsdock will automatically expose them to Mac OS X, so you could for example create a Jetty container with the environment parameters DNSDOCK_NAME=staging and a DNSDOCK_IMAGE=jetty and if you didn't change the dnsdock defautls, your new jetty container will be available at http://staging.jettty.docker
  • You may keep the base Jenkins joc and apiteam or start completelly from scratch by removing the var directory. At start up, Jenkins Enterprise and JOC will rebuild the respective working directories from scracth - so this may take some time.

You can have as many branches for different demo scenarios that you can think of...

More details to come...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published