Skip to content

zigmoi/ketchup-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ketchup Core

Application to simplify deployment of web applications on kubernetes

  • Deploy web apps to kubernetes cluster
  • No Dockerfile file or kubernetes yaml files required
  • Build packs for different runtimes like java, node-js, react-js, python, dot-net-core & golang
  • Integrated Cloud Native Tekton CI/CD pipelines for application deployment
  • Built in tasks for common operations like fetch and build source, build and store containers & deploy apps
  • Faster and optimized in-cluster container builds using Makisu
  • Helm based deployment
  • Git Webhook support for continuous integration
  • Cluster level application visibility
  • Support for application history and rollbacks
  • Application and pipeline log streaming support
  • Multi-tenancy and project level segregation support
  • Built in user management and fine-grained access controls
  • Ketchup-UI web based user interface for all operations

Install

Prerequisites

  1. Kubernetes cluster, version >= v1.16.0 and <= v1.19.0
  2. Tekton pipelines installed on the cluster, version >= v0.19
  3. Helm CLI client, version >= 3
  4. Kubectl Client, version >= v1.16.0 and <= v1.19.0.
  5. MySQL, version >= 5.7

Prepare Database

  1. Login into mysql and create mysql database schema to store all ketchup data
create database ketchupdb;
  1. Switch to ketchup database
use ketchupdb;
  1. Create ketchup tables with initial data
source ketchupdb-init.sql

Install via Helm

  1. Create an application.properties file in the current directory to store all ketchup configuration

    Sample configuration:

token.signing.key=213asdads@ahgsg123@aaa@@hjj
ketchup.base-url=http://localhost:8080/

spring.jpa.hibernate.ddl-auto=none
spring.datasource.url=jdbc:mysql://localhost:3306/ketchupdb?autoReconnect=true&useSSL=false
spring.datasource.username=mysql-username
spring.datasource.password=mysql-password

spring.datasource.tomcat.max-wait=20000
spring.datasource.tomcat.max-active=50
spring.datasource.tomcat.max-idle=20
spring.datasource.tomcat.min-idle=15

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.properties.hibernate.id.new_generator_mappings = false
spring.jpa.properties.hibernate.format_sql = true
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext
spring.jpa.properties.hibernate.ejb.interceptor=org.zigmoi.ketchup.iam.configurations.TenantInterceptor

logging.level.org.zigmoi.ketchup=ERROR

ketchup.tekton-event-sink-api-path=v1-alpha/applications/revisions/pipeline/tekton-events
spring.mvc.async.request-timeout=300000
  1. Update mysql details in application.properties using following properties

    1. spring.datasource.url
    2. spring.datasource.username
    3. spring.datasource.password
  2. Update token.signing.key property to a random secret value

  3. (Optional) Update Ketchup base URL (ketchup.base-url) property to a URL which can be used to access ketchup application from kubernetes clusters where apps will be deployed Note: use internet accessible domain for CI using cloud git repositories like GitHub and Gitlab

  4. Run following helm commands to install ketchup API server

    applicationProperties variable is set to location of application.properties file.

helm repo add ketchup https://zigmoi.github.io/ketchup-helm-repo
helm repo list
helm repo update
helm install ketchup-core ketchup/ketchup-core --set-file applicationProperties=./application.properties
  1. Check installation
    1. Run the following command, it should list ketchup-core as one of the releases
    helm list
    
    1. Run the following command, it should show one pod for ketchup-core
    kubectl get pods
    
  2. Run following commands to expose ketchup API server outside cluster
export KETCHUP_API_SERVER_POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=ketchup-core,app.kubernetes.io/instance=ketchup-core" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $KETCHUP_API_SERVER_POD_NAME 8097:8097
  1. Access all API's via swagger UI in the browser using following URL
http://localhost:8097/swagger-ui.html

Install Ketchup UI

  1. Create UI configuration file config.js in the current directory. Here is sample below
window.REACT_APP_API_BASE_URL="http://localhost:8097";
  1. Update window.REACT_APP_API_BASE_URL property to API server URL accessible outside kubernetes cluster.

  2. Run following helm commands to install ketchup API server

    applicationProperties variable is set to location of config.js file

helm repo add ketchup https://zigmoi.github.io/ketchup-helm-repo
helm repo list
helm repo update
helm install ketchup-ui ketchup/ketchup-ui --set-file applicationProperties=./config.js
  1. Check installation

    1. Run the following command, it should list ketchup-ui as one of the releases.
    helm list
    
    1. Run the following command, it should show one pod for ketchup-ui.
    kubectl get pods
    
  2. Run following commands to expose ketchup UI outside cluster

export KETCHUP_UI_POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=ketchup-ui,app.kubernetes.io/instance=ketchup-ui" -o jsonpath="{.items[0].metadata.name}")
kubectl port-forward $KETCHUP_UI_POD_NAME 8080:80
  1. Access UI in the browser using following URL
http://localhost:8080
  1. Login using admin credentials in the demo.com tenant using following credentials
username: [email protected]
password: Pass@123

Build source

Prerequisites

  1. Kubernetes cluster, version >= v1.16.0 and <= v1.19.0.
  2. Tekton pipelines installed on the cluster, version >= v0.19
  3. Helm CLI client, version >= 3
  4. Kubectl Client, version >= v1.16.0 and <= v1.19.0
  5. MySQL, version >= 5.7
  6. Java JDK, version >= 1.8
  7. Git, version >= 2.6.0

Compile and Run

  1. Clone the code repo
git clone https://github.com/zigmoi/ketchup-core.git
  1. Prepare database
  2. Update application.properties in src/main/resources folder
  3. Build and package jar, run following command inside the root directory of project
mvn clean install
  1. Run application
java -jar target/ketchup-core-0.0.1-SNAPSHOT.jar
  1. Access all API's via swagger UI in the browser using following URL
http://localhost:8097/swagger-ui.html
  1. (Optional) Install Ketchup UI to work with API's via web interface

About

Ketchup API Server.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages