{"id":1343,"date":"2019-02-17T17:26:11","date_gmt":"2019-02-17T17:26:11","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw93\/?p=1343"},"modified":"2019-03-07T18:00:09","modified_gmt":"2019-03-07T18:00:09","slug":"building-a-continuous-integration-environment-using-docker-jenkins-and-openvpn","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw93\/index.php\/2019\/02\/17\/building-a-continuous-integration-environment-using-docker-jenkins-and-openvpn\/","title":{"rendered":"Building a Continuous Integration Environment using Docker, Jenkins and OpenVPN"},"content":{"rendered":"<h5>Build a CI\/CD Pipeline with Kubernetes and Rancher 2.0<\/h5>\n<p>Recorded Online Meetup of best practices and tools for building pipelines with containers and kubernetes.<\/p>\n<p><a href=\"https:\/\/rancher.com\/events\/2018\/2018-08-07-onlinemeetup-building-a-cicd-pipeline-with-k8s\/\" target=\"blank\">Watch the training<\/a><\/p>\n<p><a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/RancherVPN.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/RancherVPN-300x215.png\" alt=\"RancherVPN\" \/><\/a>Since<br \/>\nI started playing with Docker I have been thinking that its network<br \/>\nimplementation is something that will need to be improved before I could<br \/>\nreally use it in production. It is based on container links and service<br \/>\ndiscovery but it only works for host-local containers. This creates<br \/>\nissues for a few use cases, for example when you are setting up services<br \/>\nthat need advanced network features like broadcasting\/multicasting for<br \/>\nclustering. In this case you must deploy your application stack<br \/>\ncontainers in the same Docker host, but it makes no sense to deploy a<br \/>\nwhole cluster in the same physical or virtual host. Also I would like<br \/>\ncontainers networking to function without performing any action like<br \/>\nmanaging port mappings or exposing new ports. This is why networking is<br \/>\none of my favorite features of Rancher, because it overcomes Docker<br \/>\nnetwork limitations using a software defined network that connects all<br \/>\ndocker containers under the same network as if all of them were<br \/>\nphysically connected. This feature makes it much easier to interconnect<br \/>\nyour deployed services because you don\u2019t have to configure anything. It<br \/>\njust works. **** ****However I was still missing the possibility to<br \/>\neasily reach my containers and services from my PC as if I also was on<br \/>\nthe same network again without configuring new firewall rules or mapping<br \/>\nports. That is why I created a Docker image that extends Rancher network<br \/>\nusing OpenVPN. This allows any device that may run OpenVPN client<br \/>\nincluding PCs, gateways, and even mobile devices or embedded systems to<br \/>\naccess your Rancher network in an easy and secure way because all its<br \/>\ntraffic is encrypted. There are many use cases and possibilities for<br \/>\nusing this, I list some examples:<\/p>\n<ul>\n<li>Allow all users in your office to access your containers<\/li>\n<li>Enabling oncall sysadmins to access your containers from anywhere at<br \/>\nany time<\/li>\n<li>Or the example that we are carrying out: allowing a user who works<br \/>\nat home to access your containers<\/li>\n<\/ul>\n<p>And all this without reconfiguring your Rancher environment every time<br \/>\nthat you grant access to someone. In this post we are installing a<br \/>\nminimalistic Continuous Integration (CI) environment on AWS using<br \/>\nRancher and RancherOS. The main idea is to create a scenario where a<br \/>\ndeveloper who teleworks can easily access our CI environment, without<br \/>\nadding IPs to a whitelist, exposing services to the Internet nor<br \/>\nperforming special configurations. To do so we are installing and<br \/>\nconfiguring these docker images:<\/p>\n<ul>\n<li>jenkins: a Jenkins instance to compile a sample WAR hosted in<br \/>\ngithub. Jenkins will automatically deploy this application in tomcat<br \/>\nafter compiling it.<\/li>\n<li>tutum\/tomcat:7.0 &#8211; a Tomcat instance for deploying the sample WAR<\/li>\n<li>nixel\/rancher-vpn-server: a custom OpenVPN image I have created<br \/>\nspecially to extend Rancher network<\/li>\n<\/ul>\n<p>And we are using a total of 4 Amazon EC2 instances:<\/p>\n<ul>\n<li>1 for running Rancher Server<\/li>\n<li>1 for running VPN server<\/li>\n<li>1 for running Tomcat server<\/li>\n<li>1 for running Jenkins<\/li>\n<\/ul>\n<p>*<em><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/RancherVPN-1024x735.png\" alt=\"RancherVPN\" \/><\/em>* At the end the<br \/>\ndeveloper will be able to browse to Jenkins and Tomcat webapp using his<br \/>\nVPN connection. As you will see, this is easy to achieve because you are<br \/>\nnot configuring anything for accessing Tomcat or Jenkins from your PC,<br \/>\nyou just launch a container and you are able to connect to it.<\/p>\n<h2>Preparing AWS cloud<\/h2>\n<p>You need to perform these actions on AWS before setting up the CI<br \/>\nenvironment. Creating a Key Pair Go to EC2 Console and enter <em>Key<br \/>\nPairs<\/em> section. When you create the Key Pair your browser will download<br \/>\na private key that you will need later for connecting to your Rancher<br \/>\nServer instance using SSH if you want to. Save this file because you<br \/>\nwon\u2019t be able to download it from AWS anymore. Creating a Security<br \/>\nGroup Before creating a Security Group go to VPC Console and choose<br \/>\none VPC and Subnet where you will deploy your EC2 instances. Copy the<br \/>\nVPC ID and Subnet ID and CIDR. Go to EC2 Console and create a Security<br \/>\nGroup named Rancher which will allow this inbound traffic:<\/p>\n<ul>\n<li>Allow 22\/tcp, 2376\/tcp and 8080\/tcp ports from any source, needed<br \/>\nfor Docker machine to provision hosts<\/li>\n<li>Allow 500\/udp and 4500\/udp ports from any source, needed for Rancher<br \/>\nnetwork<\/li>\n<li>Allow 9345\/tcp and 9346\/tcp ports from any source, needed for UI<br \/>\nfeatures like graphs, view logs, and execute shell<\/li>\n<li>Allow 1194\/tcp and 2222\/tcp ports from any source, needed to publish<br \/>\nour VPN server container<\/li>\n<\/ul>\n<p>Be sure to select the appropriate VPC in the Security Group dialog.<br \/>\nCreating an Access Key On EC2 Console click your name in the top<br \/>\nmenu bar and go to <em>Security Credentials<\/em>. Expand <em>Access Keys (Access<br \/>\nKey ID and Secret Access Key)<\/em> option and create a new Access Key.<br \/>\nFinally click <em>Download Key File<\/em> because again you won\u2019t be able to do<br \/>\nit later. You will need this for Rancher Server to create Docker hosts<br \/>\nfor you.<\/p>\n<h2>Installing Rancher Server<\/h2>\n<p>Create a new instance on EC2 console that uses rancheros-0.2.1 AMI,<br \/>\nsearch for it in <em>Community AMIS<\/em> section. For this tutorial I am using<br \/>\na basic t1.micro instance with 8GB disk, you may change this to better<br \/>\nfit your environment needs. Now enter <em>Configure Instance Details<\/em><br \/>\nscreen and select the appropriated <em>Network<\/em> and <em>Subnet<\/em>. Then expand<br \/>\n<em>Advanced Details<\/em> section and enter this user data:<\/p>\n<p>#!\/bin\/bash<br \/>\ndocker run -d -p 8080:8080 rancher\/server:v0.14.2<\/p>\n<p>This will install and run Rancher Server 0.14.2 when the instance boots.<br \/>\nBefore launching the new instance be sure to choose the Security Group<br \/>\nand Key Pair we just created before. Finally go to Instances menu and<br \/>\nget your Rancher Server instance public IP. After some minutes navigate<br \/>\nto<br \/>\n<a href=\"http:\/\/rancer_server_public_ip:8080\">http:\/\/RANCER_SERVER_PUBLIC_IP:8080<\/a><br \/>\nand you will enter Rancher UI.<\/p>\n<h2>Provisioning Docker hosts<\/h2>\n<p>In this section we are creating our Docker hosts. Go to Rancher UI and<br \/>\nclick <em>Add Host<\/em> button, confirm your Rancher Server public IP and then<br \/>\nclick <em>Amazon EC2<\/em> provider. In this form you need to enter the<br \/>\nfollowing data: <em>host name, Access Key, Secret Key, Region, Zone, VPC<br \/>\nID, Subnet ID,<\/em> and <em>Security Group<\/em>. Be sure to enter the appropriated<br \/>\nvalues for <em>Region, Zone, VPC ID<\/em> and <em>Subnet ID<\/em> because they must<br \/>\nmatch those used by Rancher Server instance. You must specify Security<br \/>\nGroup name instead its ID, in our case it is named Rancher.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-create-host.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-create-host.png\" alt=\"rancher-create-host\" \/><\/a><br \/>\nRepeat this step three times so Rancher will provision our three Docker<br \/>\nhosts. After some minutes you will see your hosts running in Rancher UI.<\/p>\n<p><a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-hosts-list.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-hosts-list.png\" alt=\"rancher-hosts-list\" \/><\/a><\/p>\n<h2>Installing VPN container<\/h2>\n<p>Now it\u2019s time to deploy our VPN server container that will extend the<br \/>\nRancher network. Go to your first host, click <em>Add Container<\/em> button and<br \/>\nfollow these steps:<\/p>\n<ol>\n<li>Enter a name for this container like rancher-vpn-server<\/li>\n<li>Enter docker image: nixel\/rancher-vpn-server:latest<\/li>\n<li>Add this TCP port map: 1194 (on Host) to 1194 (in Container)<\/li>\n<li>Add this TCP port map: 2222 (on Host) to 2222 (in Container)<\/li>\n<\/ol>\n<p>Now expand <em>Advanced Options<\/em> section and follow these steps:<\/p>\n<ol>\n<li>In <em>Volume<\/em> section add this new volume to persist VPN<br \/>\nconfiguration: \/etc\/openvpn:\/etc\/openvpn<\/li>\n<li>In <em>Networking<\/em> section be sure to select <em>Managed Network on<br \/>\ndocker0<\/em><\/li>\n<li>In <em>Security\/Host<\/em> section be sure to enable the <em>Give the container<br \/>\nfull access to the host<\/em> checkbox<\/li>\n<\/ol>\n<p>After a while you will see your rancher-vpn-server container running on<br \/>\nyour first host.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-server-container.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-server-container.png\" alt=\"rancher-vpn-server-container\" \/><\/a><br \/>\nNow you are about to use another nice Rancher feature. Expand your<br \/>\nrancher-vpn-server container menu and click View Logs button as you can<br \/>\nsee in the following image:<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-view-container-logs.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-view-container-logs.png\" alt=\"rancher-tomcat-view-container-logs\" \/><\/a><br \/>\nNow scroll to top and you will find the information you need in order to<br \/>\nconnect with your VPN client. We are using this data later.<br \/>\n**** <a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-server-logs.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-server-logs.png\" alt=\"rancher-vpn-server-logs\" \/><\/a>****<\/p>\n<h2>Installing Tomcat container<\/h2>\n<p>To install Tomcat container you have to click <em>Add Container<\/em> button on<br \/>\nyour second host and follow these steps:<\/p>\n<ol>\n<li>Enter a name for this container like tomcat<\/li>\n<li>Enter docker image: tutum\/tomcat:7.0<\/li>\n<li>*<em>No port map is required<\/em>*<\/li>\n<li>Expand <em>Advanced Options<\/em> and in Networking section be sure to<br \/>\nselect <em>Managed Network on docker0<\/em><\/li>\n<\/ol>\n<p>After a while you will see your Tomcat container running on your second<br \/>\nhost.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-server-container.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-server-container.png\" alt=\"rancher-tomcat-server-container\" \/><\/a><br \/>\nNow open Tomcat container logs in order to get its admin password, you<br \/>\nare needing it later when configuring Jenkins.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-logs.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-tomcat-logs.png\" alt=\"rancher-tomcat-logs\" \/><\/a><\/p>\n<h2>Installing Jenkins container<\/h2>\n<p>Click Add Container button on your third host and execute the following<br \/>\nsteps:<\/p>\n<ol>\n<li>Enter a name for this container like jenkins<\/li>\n<li>Enter docker image: jenkins<\/li>\n<li>No port map is required<\/li>\n<\/ol>\n<p>Now expand <em>Advanced Options<\/em> section and follow these steps:<\/p>\n<ol>\n<li>In <em>Volume<\/em> section add this new volume to persist Jenkins<br \/>\nconfiguration: \/var\/jenkins_home<\/li>\n<li>In <em>Networking<\/em> section be sure to select <em>Managed Network on<br \/>\ndocker0<\/em><\/li>\n<\/ol>\n<p>After a while you will see your Jenkins container running on your third<br \/>\nhost.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-jenkins-container.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-jenkins-container.png\" alt=\"rancher-jenkins-container\" \/><\/a><\/p>\n<h2>Putting it all together<\/h2>\n<p>In this final step you are going to install and run the VPN client.<br \/>\nThere are two ways to get the client working: using a Docker image I<br \/>\nhave prepared that does not require any configuration, or using any<br \/>\nOpenVPN client that you will need to configure. Once the VPN client is<br \/>\nworking you are browsing to Jenkins in order to create an example CI job<br \/>\nthat will deploy the sample WAR application on Tomcat. You will finally<br \/>\nbrowse to the sample application so you can see how all this works<br \/>\ntogether. Installing Dockerized VPN client In a PC with Docker<br \/>\ninstalled you will execute the command that we saw before in<br \/>\nrancher-vpn-server container logs. According to my example I will<br \/>\nexecute this command:<\/p>\n<p>sudo docker run -ti -d &#8211;privileged &#8211;name rancher-vpn-client -e VPN_SERVERS=54.149.62.184:1194 -e VPN_PASSWORD=mmAG840NGfKEXw73PP5m nixel\/rancher-vpn-client:latest<\/p>\n<p>Adapt it to your environment. Then show rancher-vpn-client container<br \/>\nlogs:<\/p>\n<p>sudo docker logs rancher-vpn-client<\/p>\n<p>You will see a message printing the route you need to add in your system<br \/>\nin order to be able to reach Rancher network.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-client-route.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/rancher-vpn-client-route.png\" alt=\"rancher-vpn-client-route\" \/><\/a><br \/>\nIn my case I\u2019m executing this command:<\/p>\n<p>sudo route add -net 10.42.0.0\/16 gw 172.17.0.8<\/p>\n<p>At this point you are able to ping all your containers, no matter in<br \/>\nwhich host they run. Now your PC is actually connected to Rancher<br \/>\nnetwork and you can reach any container and service running on your<br \/>\nRancher infrastructure. If you repeat this step in a Linux Gateway at<br \/>\nyour office you will, in fact, expose Rancher network to all the<br \/>\ncomputers connected in your LAN, which is really interesting.<br \/>\nInstalling a custom OpenVPN client If you prefer to use an existing<br \/>\nor custom OpenVPN client, you can do it. You will need your OpenVPN<br \/>\nconfiguration file that you can get executing the SSH command that we<br \/>\ngot before in rancher-vpn-server container log. In my case I can get<br \/>\nRancherVPNClient.ovpn file executing this command:<\/p>\n<p>sshpass -p mmAG840NGfKEXw73PP5m ssh -p 2222 -o ConnectTimeout=4 -o UserKnownHostsFile=\/dev\/null -o StrictHostKeyChecking=no root@54.149.62.184 &#8220;get_vpn_client_conf.sh 54.149.62.184:1194&#8221; &gt; RancherVPNClient.ovpn<\/p>\n<p>Now, for example, you can execute OpenVPN executing this command:<\/p>\n<p>\/usr\/sbin\/openvpn &#8211;config RancherVPNClient.ovpn<\/p>\n<p>You can also use OpenVPN iOS\/Android application with this<br \/>\nRancherVPNClient.ovpn file and you will also be able to access your<br \/>\nRancher network from your mobile or tablet. Again, you can extend your<br \/>\nVPN for all users in your LAN if you repeat this step in a Linux Gateway<br \/>\nin your office. Configuring Jenkins Now it\u2019s time to configure<br \/>\nJenkins to compile and deploy our sample WAR in Tomcat. Browse to<br \/>\n<a href=\"http:\/\/jenkins_container_ip:8080\">http:\/\/JENKINS_CONTAINER_IP:8080<\/a><br \/>\n(in my case <a href=\"http:\/\/10.42.13.224:8080\">http:\/\/10.42.13.224:8080<\/a>) and you will see Jenkins<br \/>\nDashboard.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-dashboard.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-dashboard.png\" alt=\"jenkins-dashboard\" \/><\/a><br \/>\nBefore starting you must install Github Plugin and Maven following these<br \/>\nsteps:<\/p>\n<ol>\n<li>Click <em>Manage Jenkins<\/em> menu option and then <em>Manage Plugins<\/em><\/li>\n<li>Go to <em>Available<\/em> tab and search for Github plugin, named \u201cGithub<br \/>\nPlugin\u201d. Activate its checkbox<\/li>\n<li>Click <em>Download now and install after restart<\/em> button<\/li>\n<li>When the plugin is installed enable checkbox <em>Restart Jenkins when<br \/>\ninstallation is complete and no jobs are running,<\/em> and then wait for<br \/>\nJenkins to be restarted<\/li>\n<li>When Jenkins is running again, go to <em>Manage Jenkins<\/em> and click<br \/>\n<em>Configure System<\/em><\/li>\n<li>In Maven section click <em>Add Maven<\/em> button, enter a name for the<br \/>\ninstallation and choose last maven version.<\/li>\n<li>Click Save button to finish<\/li>\n<\/ol>\n<p><a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-install-maven.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-install-maven.png\" alt=\"jenkins-install-maven\" \/><\/a><br \/>\nWhen you are back in Dashboard click <em>create new jobs<\/em> link and follow<br \/>\nthese instructions:<\/p>\n<ul>\n<li>Enter a job name, for example CI_Sample<\/li>\n<li>Choose <em>Maven project<\/em> option and click OK<\/li>\n<li>In <em>Source Code Management<\/em> section choose <em>Git<\/em> and enter this<br \/>\n<em>Repository URL<\/em>: <a href=\"https:\/\/github.com\/nixelsolutions\/sample-war.git\">https:\/\/github.com\/nixelsolutions\/sample-war.git<\/a><\/li>\n<\/ul>\n<p><a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-git-url.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-git-url.png\" alt=\"jenkins-git-url\" \/><\/a><\/p>\n<ul>\n<li>In <em>Build<\/em> section enter the following maven <em>goals and options<\/em>.<br \/>\nReplace TOMCAT_CONTAINER_IP with the IP assigned to your<br \/>\nTomcat container (10.42.236.18 in my case) and<br \/>\nTOMCAT_ADMIN_PASSWORD with the password we saw before for<br \/>\nadmin user (6xc3gzOi4pMG in my case).<\/li>\n<\/ul>\n<p>clean package tomcat7:redeploy -DTOMCAT_HOST=TOMCAT_CONTAINER_IP -DTOMCAT_PORT=8080 -DTOMCAT_USER=admin -DTOMCAT_PASS=TOMCAT_ADMIN_PASSWORD<\/p>\n<p>I am setting this maven configuration:<\/p>\n<p>clean package tomcat7:redeploy -DTOMCAT_HOST=10.42.236.18 -DTOMCAT_PORT=8080 -DTOMCAT_USER=admin -DTOMCAT_PASS=6xc3gzOi4pMG<\/p>\n<ul>\n<li>Save your job<\/li>\n<\/ul>\n<p><a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-maven-goals.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-maven-goals.png\" alt=\"jenkins-maven-goals\" \/><\/a><br \/>\nNow you can click <em>Build Now<\/em> button to run your job. Open your<br \/>\nexecution (listed in <em>Build History<\/em> table) and then click <em>Console<br \/>\nOutput<\/em> option. If you go to the bottom you will see something like<br \/>\nthis:<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-job-result.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/jenkins-job-result.png\" alt=\"jenkins-job-result\" \/><\/a><br \/>\nTesting the sample application Now browse to<br \/>\n<a href=\"http:\/\/tomcat_container_ip:8080\/sample\/\">http:\/\/TOMCAT_CONTAINER_IP:8080\/sample\/<\/a><br \/>\nand you will see this page showing information about Tomcat server and<br \/>\nyour browser client.<br \/>\n<a href=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/sample-application.png\"><img decoding=\"async\" src=\"http:\/\/cdn.rancher.com\/wp-content\/uploads\/2015\/04\/24142158\/sample-application.png\" alt=\"sample-application\" \/><\/a><\/p>\n<h2>Conclusion<\/h2>\n<p>In this post we have installed a basic Continuous Integration<br \/>\nenvironment as an example to make your Docker containers reachable from<br \/>\nyour PC, your LAN, and even a mobile device or any system that can<br \/>\nexecute an OpenVPN client. This is possible thanks to Rancher Network, a<br \/>\ngreat functionality that improves Docker networking by connecting your<br \/>\ncontainers under the same network. What we actually did was to extend<br \/>\nRancher network using an OpenVPN link that is really easy to configure<br \/>\nwith Docker, and secure to use because all your traffic is being<br \/>\nencrypted. This functionality can help many companies to better manage<br \/>\nthe way they give access to their containers from any unknown or<br \/>\nuncontrolled network. Now you don\u2019t need to think anymore about exposing<br \/>\nor mapping ports, changing firewall rules, or taking care about what<br \/>\nservices you publish to the Internet. For more information on managing<br \/>\ndocker with Rancher, please join our next online meetup, where we\u2019ll be<br \/>\ndemonstrating Rancher, Docker Compose, service discovery and many other<br \/>\ncapabilities. <em>Manel Martinez is a Linux<br \/>\nsystems engineer with experience in the design and management of<br \/>\nscalable, distributable and highly available open source web<br \/>\ninfrastructures based on products like KVM, Docker, Apache, Nginx,<br \/>\nTomcat, Jboss, RabbitMQ, HAProxy, MySQL and XtraDB. He lives in Spain,<br \/>\nand you can find him on Twitter<br \/>\n<a href=\"http:\/\/twitter.com\/manel_martinezg\">@manel_martinezg<\/a>.<\/em><\/p>\n<p><a href=\"https:\/\/rancher.com\/building-a-continuous-integration-environment-using-docker-jenkins-and-openvpn\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Build a CI\/CD Pipeline with Kubernetes and Rancher 2.0 Recorded Online Meetup of best practices and tools for building pipelines with containers and kubernetes. Watch the training Since I started playing with Docker I have been thinking that its network implementation is something that will need to be improved before I could really use it &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw93\/index.php\/2019\/02\/17\/building-a-continuous-integration-environment-using-docker-jenkins-and-openvpn\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Building a Continuous Integration Environment using Docker, Jenkins and OpenVPN&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1343","post","type-post","status-publish","format-standard","hentry","category-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/comments?post=1343"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1343\/revisions"}],"predecessor-version":[{"id":1417,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/posts\/1343\/revisions\/1417"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/media?parent=1343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/categories?post=1343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw93\/index.php\/wp-json\/wp\/v2\/tags?post=1343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}