Code Monkey home page Code Monkey logo

brxm-repo-maintainer's Introduction

brXM Repo Maintainer Application

A standalone application that takes care of running repository maintenance queries in a kubernetes cluster

Run it locally in minikube:

(Tested minikube version: v1.5.2)

Install virtualbox https://www.virtualbox.org/wiki/Downloads

Install minikube https://github.com/kubernetes/minikube

brew cask install minikube

Start minikube with some additional resources

minikube --memory 8192 --cpus 2 start

Setup helm (tested with v3.0.0) (kubernetes package manager) https://github.com/helm/helm

brew install kubernetes-helm

Switch to kubernetes folder

cd kubernetes

Setup a postgresql db for brxm

./setup_db.sh

After db is up, create a brxm deployment (from kubernetes directory)

./deploy-brxm.sh

Create serviceaccount for brxm-repo-maintainer application so that it can read pod names from kube-apiserver

./setup-serviceaccount.sh

To be able to work with the docker daemon on your mac/linux host use the docker-env command in your shell

eval $(minikube docker-env)

Now that you have run the eval command above, build the brxm-repo-maintainer image: (you have to keep using the same shell!)

cd .. # switch to pom.xml directory
mvn clean compile jib:dockerBuild

Create either a cronjob (brxm-repo-maintainer-cronjob.yaml), job (brxm-repo-maintainer-job.yaml), or a regular deployment (brxm-repo-maintainer.yaml)

kubectl create -f kubernetes/brxm-repo-maintainer-job.yaml

Caveats:

  • This application is built for postgresql. For other relational dbs the jdbc connection and the actual queries run should be tweaked.
  • The k8s manifest files (deployment/job/cronjob) rely on a serviceaccount named "brxm-repo-maintainer". You may or may not have the rights to create such a k8s object in your own organization.
  • Ideally you want to run brxm-repo-maintainer as a cronjob and once a day. (Right after a daily db backup is done for example)
  • BRXM_SELECTOR envrionment variable is used to select the brxm pods. This value should match the labels on brxm pod manfiest. (See "app: brxm" in kubernetes/brxm.yaml)
  • If you are running brXM as stateful sets, you also have to change how journal_id's are constructed. Then, they have the form: pod_name.service_name.namespace_name.svc.cluster.local

brxm-repo-maintainer's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.