Skip to content

Project Milestone 4

prathameshd edited this page Apr 25, 2019 · 10 revisions

Milestone 4

Deliverables

  • Multi-cloud deployment at TACC and IU Jetstream instances
  • Blue green deployment
  • OpenID Connect Login

Architecture Diagram

Multi-cloud deployment

Used HAProxy to act as intermediary between TACC and IU.
We deployed only 1 HAProxy (IU cloud), which load balances across TACC instances as well
To check the health of nodes, please visit the HAProxy dashboard below:

HAProxy dashboard URL

http://149.165.170.244:32700
Username: someuser
Password: password

Kubernetes has been deployed on IU and TACC cloud instances.

Kubernetes dashboard URLs

TACC
IU
Contact us for login token

Jenkins dashboard

http://149.165.170.7:8080
Contact us for credentials

Jobs of importance:
kubernetes_deployment
kubernetes_deployment_blue

Steps to test this milestone

Website should be accessed from the below URL only

js-170-244.jetstream-cloud.org

OpenID Connect

  • Click on login at top right corner
  • Click on the "Login with Google" button
  • Provide valid Google credentials to be redirected
    Note: Since a Spotify account is required to access the app, you would be presented with a Spotify login afterwards (one-time only)
    Note: Spotify login is required in order to fetch Spotify token for the API calls

Blue-Green Deployment Strategy

  • There are two branches for blue green deployment
    1. Project-4-Blue: This branch will have latest code and will deploy on TACC jet stream whenever there is a commit.
    2. Project-4: This branch will deploy code on IU jet stream whenever there is commit.
  • All task branches will be merged to Project-4-Blue branch whenever there is a pull request and it will update the TACC jet stream instances through Jenkins job. Hence this will be blue instance now.
  • Project-4-Blue branch will be merged to Project-4 through pull request and it will update the IU jet stream instances through Jenkins job (kubernetes_deployment). When this step is done, both the jet stream instances will be at the same code level.

Testing Blue-Green Deployment:

  • Do a dummy commit to Project-4-Blue branch
  • Jenkins Job (kubernetes_deployment_blue) will be triggered and TACC jet stream instance will be updated
  • Access the app and keep refreshing the browser till the change is visible, because the HAProxy can redirect you to any one of the instances, TACC (new version) or IU (old version), in a round robin fashion.
  • This way you can see the blue version and green version of the application

Design choices made

  • Used only 1 HAProxy in IU cloud (outside the Kubernetes cluster) as the load balancer between both TACC and IU instances
  • Had to do this because Spotify needs to know only one redirect URL, after successful sign-in, to validate the app
  • If we had kept 2 HAProxy instances, we wouldn't know which instance the request went to as HAProxy internally load balances between all registered nodes. Hence identifying the right redirect URL (IU one or TACC one) would not be possible.

Attempts at load balancing

  • We tried running 2 HAProxy instances (in TACC and IU). However, since we did not have an external DNS proxy to redirect client requests (and also due to the Spotify redirect issue mentioned above), decided not to explore further

Drawbacks

  • Since only 1 HAProxy is available (at IU JetStream), it becomes a single point of failure