Git Product home page Git Product logo

weather-app-cd's Introduction

Weather App Deployment

A Continuous Deployment example project

Key Features ๐Ÿ”‘


Jenkins Pipeline ๐ŸŒฉ๏ธ

  • The Jenkins pipeline is executing the below deployment script.
  • Its for testing and demonstration purposes only and as such its deleting the existing cluster (if created).
  • The pipeline is parameterized to support the below deployment options: Flux or manual manifest deployment.
  • Note: This is only an example to demonstrate the CD principle. For real life scenarios you might want to split between the pipelines of deployment and infrastructure creation

Deployment

cd ~/[your-workspace]
https://github.com/devozs/weather-app-cd.git
cd weather-app-cd

running the script ./install-cluster.sh will create a Kind cluster.

There are two possible ways to deploy the sample Java Maven project

Manual Deployment ๐Ÿšช

./install-cluster.sh -t manual

FluxCD Deployment ๐ŸŒฉ๏ธ

./install-cluster.sh -t flux -f your-github-account

For example ./install-cluster.sh -t flux -f devozs

Make sure to have GitHub PAT
For more information refer to the Getting Started with Flux

Testing the deployment

Verify the flux pods are deployed successfully (Skip in case of using Manual Deployment)

kubectl get pods -n flux-system

NAME                                           READY   STATUS    RESTARTS   AGE
helm-controller-6dcbff747f-76xlv               1/1     Running   0          8m10s
image-automation-controller-75f784cfdc-29zcg   1/1     Running   0          8m10s
image-reflector-controller-67d6bdcb59-xb9m5    1/1     Running   0          8m10s
kustomize-controller-5bb9984cf9-7l7nk          1/1     Running   0          8m10s
notification-controller-7569f7c974-clccq       1/1     Running   0          8m10s
source-controller-5b976b8dd6-w6gjn             1/1     Running   0          8m10s

Verify the flux is able to identify the Docker images (Skip in case of using Manual Deployment)

flux get image policy -A

NAMESPACE       NAME            READY   MESSAGE                                                         LATEST IMAGE             
flux-system     weather-app     True    Latest image tag for 'devozs/weather-app' resolved to: 0.0.3    devozs/weather-app:0.0.3     

Verify the application pod is deployed successfully. for example:

kubectl get pod

NAME                         READY   STATUS    RESTARTS   AGE
weather-app-65ccb54c-z7cfv   1/1     Running   0          8m27s

Verify the application pod is running

Run the following script ./verify-deployment.sh or manually run the below commands:

    POD_NAME=$(kubectl get pods --template '{{range .items}}{{.metadata.name}}{{end}}' | grep weather-app)
    kubectl logs ${POD_NAME}

    2021/08/21 11:44:50.011 [INFO] [org.devozs.weather.WeatherApp] Task performed on: Sat Aug 21 11:44:50 GMT 2021, Thread's name: TIMER
    2021/08/21 11:44:50.011 [INFO] [org.devozs.weather.WeatherApp] Getting Weather...
    2021/08/21 11:44:51.722 [INFO] [org.devozs.weather.WeatherApp] Response Code: 200

weather-app-cd's People

Contributors

fluxcdbot avatar devozs avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.