Giter Site home page Giter Site logo

dhavlev / vstakd Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 3.0 526 KB

This repository contains instruction for setting up K8s cluster and setting up CI & CD pipeline on top of it

License: MIT License

Shell 100.00%
eks k8s istio kiali zipkin docker eksctl jenkins-pipeline

vstakd's Introduction

vstakd

This repository contains instruction for setting up K8s cluster and setting up CI & CD pipeline on top of it.

Overview

This is my personal project where I am trying to setup Jenkins Pipeline for web application on top of Kubernetes Cluster.

Architecture diagram

Components - tools

vstakd

  1. Cloud - AWS, AWSCLI, AWS IAM Authentication
  2. Kubernetes Cluster - kubectl, eksctl, istio
  3. Orchestration/CI-CD - Jenkins
  4. Pipeline - Jenkins Shared Library
  5. Web Application - Voting App (5 tier application)
  6. Tracing - Zipkin
  7. Observability - Kiali

Repos & Charts

App Name App Repo App Branch Helm Chart Chart Branch Comment
voting-app-vote voting-app-vote master chart voting-app web application responsible recording vote
voting-app-result voting-app-result master Chart voting-app web application responsible showing results
voting-app-worker voting-app-worker master chart voting-app worker application, read data from redis cache and writes to database
voting-app-redis voting-app-redis master chart voting-app contains Jenkinsfile responsible for calling helm charts for redis
voting-app-db voting-app-db master chart voting-app contains Jenkinsfile responsible for calling helm charts for database

Setup 1 pre1.sh

Steps:

  1. System update
  2. Kubectl installation
  3. Aws iam authentication installation
  4. Istio installation
  5. Aws cli setup
  6. Configure aws profile
chmod 777 pre1.sh
./pre1.sh

Setup 2 - pre2.sh

Steps:

  1. Creation of EKS cluster
  2. Helm installation
  3. Instio setup
  4. Ingress-nginx setup
  5. Jenkins setup
  6. Kiali ingress setup
  7. Zipkin ingress setup
  8. Secrets - kube-secret and aws-secret
  9. Setup Gateway and Virtual service
chmod 777 pre2.sh
./pre2.sh

Please amend docker credentials in pre2.sh

Setup 3

  1. Browse Jenkins using ingress url nginx-ingress
  2. Get the password jenkins-password
  3. Configure global shared library Repo - jenkins-shared-library Screenshot
  4. Make sure kube-secret, aws-secret and docker-config-secret are created
  5. Create Pipeline - db
  6. Create Pipeline - redis
  7. Create Pipeline - Vote
  8. Create Pipeline - Result
  9. Create Pipeline - Worker

Screenshots

  1. Configuring 1st pipeline image
  2. Viewing Jenkins pipelines image
  3. Configuring Global Shared Library image
  4. Viewing installed applications image
  5. Observe your Istio service mesh using Kiali image
  6. Viewing tracing using Zipkin image

Commands

docker-config-secret

kubectl create secret docker-registry docker-config-secret --docker-server=https://index.docker.io/v1/ --docker-username=your-username --docker-password=your-password [email protected] --namespace tooling

kube-secret

kubectl create secret generic kube-secret --from-file=config=kube-secret --namespace tooling

aws-secret

kubectl create secret generic aws-secret --from-file=config=.aws/config --from-file=credentials=.aws/credentials --namespace tooling

nginx-ingress

echo $(kubectl get svc ingress-nginx-ingress-controller -n ingress -o jsonpath='{ .status.loadBalancer.ingress[0].hostname }')

istio-ingress

echo $(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{ .status.loadBalancer.ingress[0].hostname }')

jenkins-password

printf $(kubectl get secret --namespace tooling my-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

Troubleshooting

  1. Unable to schedule jenkins slave
    Make sure k8s secrets are in place for both docker and kube config

vstakd's People

Contributors

dhavlev avatar

Stargazers

 avatar

Watchers

 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.