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
- Kubernetes cluster, version >= v1.16.0 and <= v1.19.0
- Tekton pipelines installed on the cluster, version >= v0.19
- Helm CLI client, version >= 3
- Kubectl Client, version >= v1.16.0 and <= v1.19.0.
- MySQL, version >= 5.7
- Login into mysql and create mysql database schema to store all ketchup data
create database ketchupdb;
- Switch to ketchup database
use ketchupdb;
- Create ketchup tables with initial data
source ketchupdb-init.sql
-
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
-
Update mysql details in application.properties using following properties
- spring.datasource.url
- spring.datasource.username
- spring.datasource.password
-
Update token.signing.key property to a random secret value
-
(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
-
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
- Check installation
- Run the following command, it should list ketchup-core as one of the releases
helm list
- Run the following command, it should show one pod for ketchup-core
kubectl get pods
- 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
- Access all API's via swagger UI in the browser using following URL
http://localhost:8097/swagger-ui.html
Install Ketchup UI
- Create UI configuration file config.js in the current directory. Here is sample below
window.REACT_APP_API_BASE_URL="http://localhost:8097";
-
Update window.REACT_APP_API_BASE_URL property to API server URL accessible outside kubernetes cluster.
-
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
-
Check installation
- Run the following command, it should list ketchup-ui as one of the releases.
helm list
- Run the following command, it should show one pod for ketchup-ui.
kubectl get pods
-
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
- Access UI in the browser using following URL
http://localhost:8080
- Login using admin credentials in the demo.com tenant using following credentials
username: [email protected]
password: Pass@123
- Kubernetes cluster, version >= v1.16.0 and <= v1.19.0.
- Tekton pipelines installed on the cluster, version >= v0.19
- Helm CLI client, version >= 3
- Kubectl Client, version >= v1.16.0 and <= v1.19.0
- MySQL, version >= 5.7
- Java JDK, version >= 1.8
- Git, version >= 2.6.0
- Clone the code repo
git clone https://github.com/zigmoi/ketchup-core.git
- Prepare database
- Update application.properties in src/main/resources folder
- Build and package jar, run following command inside the root directory of project
mvn clean install
- Run application
java -jar target/ketchup-core-0.0.1-SNAPSHOT.jar
- Access all API's via swagger UI in the browser using following URL
http://localhost:8097/swagger-ui.html
- (Optional) Install Ketchup UI to work with API's via web interface