Skip to content

krol3/app-jenkinsfile-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample scalable Application using a canary deployment, Helm and Kubernetes

Dev, stage and production environments with canary deployment.

  • Golang
  • Backend: ./app
  • frontend: ./app -frontend=true -backend-service=http://backend:8080 -port=8085
  • Jenkinsfile
  • Kubernetes deployments

Production Service

Canary Service

Settings kubernetes cluster and Jenkins

Setting kubernetes, helm and jenkins ... more details

Deploy using minikube

We will test using minikube minikube start

  • Install CI: Jenknis make jenkins-install

    User: admin Password: printf $(kubectl get secret --namespace ci j-v1-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

  • Create Job (future work: Initialize job by groove) Configure a multibranch pipeline

  • Install kubernetes files


$ kubectl create namespace production
$ kubectl create namespace stage
$ kubectl --namespace=production apply -f k8s/production
$ kubectl --namespace=production apply -f k8s/canary
$ kubectl --namespace=production apply -f k8s/services

  • Run locally

make backend-local
make frontend-local

Environments isolate by namespaces in kubernetes

Scale the production service


kubectl --namespace=production autoscale deployment app-frontend-production --min=1 --max=5 --cpu-percent=80

deployment.apps "app-frontend-production" autoscaled

Information about the Horizontal pod autoscaler


kubectl --namespace=production get hpa

Canary deployment in kubernetes

Job - Multibranch pipeline

Pipeline jenkins



About

Sample app using jenkinsfile and kubernetes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published