/deploy-kubernetes-multi-env

Continuously Build and Deploy a NodeJS docker image to multiple kubernetes environments

Primary LanguageJavaScript

Deploying a NodeJS docker image to beta and production Kubernetes cluster with your Shippable pipeline.

AyeAye

This repository demonstrates the following :

  • Setup CI for a NodeJS application that builds a docker image and deploys it to DockerHub.
  • Setup a CD pipeline to deploy the NodeJS docker image to beta and production Kubernetes clusters.

Prerequisites to run this sample

  • Source control account (e.g. GitHub, Bitbucket, Gitlab)
  • Shippable account (sign up for free at www.shippable.com)
  • Kubernetes cluster.

Setup

  • Fork this repo into your local repository in your source control account.
  • Login into Shippable with your source control account(wwww.shippable.com).
  • Create a Docker Hub integration on shippable to your docker hub.
  • All your CI configuration is in shippable.yml file, while you will modify next to reflect your integration.
  • Update the integrationName in the integration.hub section with the integration name created above.
  • Change the DOCKER_REPO and DOCKER_ACC to point to your repo and docker account.
  • Next, follow these CI Setup Instructions to enable your forked project for CI.
  • Build your CI project by clicking on the build button. Once the build completes, the NodeJS docker image will be pushed to your DockerHub account.
  • Create the Kubernetes integrations for beta and production environments using instructions provided here.

Add the pipeline in Shippable

  • Sign in with your shippable account, select your subscription from the dropdown menu in upper left (three horizontal lines).
  • Select the Pipelines tab.
  • Select the "+" icon in the upper right.
  • Select the source control repo where your fork is. This will render all the jobs in the Single pane of glass (SPOG).
  • Run the pipeline following instructions here.

CI Console Output

CI Console Output

##Build link CI build on Shippable

##Build status badge Run Status

Pipeline View

Pipeline

Deploy job View

Beta Deploy1 Prod Deploy2 Blue Deploy Green Deploy