Git Product home page Git Product logo

platform's Introduction

Platform

This creates a platform in kubernetes to build, test and deploy an application.

Design goals

  • Jenkins Configuration as code using the jcasc plugin
  • Reproducible platform
  • Dynamic slaves for jenkins
  • Visibility & Observability
  • Decoupled service deployment (in kubernetes)

Prerequisites

  • docker (1.18.*)
  • docker-compose (1.23.*)
  • minikube
  • kubectl (1.15.*)
  • helm (v2.14.*)

Components

  • Jenkins
  • Prometheus
  • Grafana

Steps

setup minikube and helm

Start a minikube instance

$ minikube start --memory 4096

Enable ingress addon

$ minikube addons enable ingress

Install tiller (make sure minikube is the current context by kubectl config current-context)

$ helm init (installs tiller in kube-system)

install prometheus and grafana

Please note values.yaml has been customized

$ cd kubernetes/monitoring

$ ./install_crd.sh (required because of this: https://github.com/helm/charts/tree/master/stable/prometheus-operator#helm-fails-to-create-crds)

$ ./install

install jenkins

Please note values.yaml has been customized

$ cd kubernetes/jenkins

creates a persistence volume & claim before for jenkins helm chart deployment $ kubectl apply -f manifests/pv.yaml $ kubectl apply -f manifests/pvc.yaml

$ ./install

it may take couple of minutes for jenkins to be up and running

make host file entries

{minikube ip}  prometheus.amit.local
{minikube ip}  grafana.amit.local
{minikube ip}  jenkins.amit.local

Urls

Default passwords

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

Manual steps for jenkins

  • Upload an ssh private key for github in jenkins under the jenkins credential id github_ssh to get access to the private repos
  • Get your current kubeconfig for minikube by running kubectl config view --flatten --minify, you'll need only the minikube context.
  • With the flattened kubeconfig obtained in the previous step replace the existing kubeconfig content of k8s-admin by going here: http://jenkins.amit.local/credentials/store/system/domain/_/credential/k8s-admin/update
  • You may have to manually trigger the multibranch job by clicking Scan Multibranch Pipeline Now button

Limitations

  • No TLS
  • No RBAC in kubernetes or Jenkins
  • Job definition is moved to this public repositry, for JCASC to access and build. This could have been avoided by creating a seed job
  • Could not implement docker image publish as uploading images to docker hub was taking a lot of time. Tried a private registry (registry/docker-compose.yaml) but disabling tls verification for the private registry was not trivial in minikube. This Limitation can easily be fixed by having a local registry.
  • kubernetes-cd can't delete deployments at the momen

Improvements

  • Linting and static code analysis
  • Versioning (app and dependencies)
  • Secrets management
  • Security
  • Scalability
  • Operations using gitops
  • Modularize declarative pipeline by having shared pipeline libraries
  • Need more time to figure out why kubernetes-cd is only deploying to the default namespace of minikube

Owner

Amit Sarkar

platform's People

Contributors

amit242 avatar

Watchers

James Cloos 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.