An open API service indexing awesome lists of open source software.

https://github.com/kuldeepsingh99/hazelcast-embeded

Spring boot My SQL with Hazelcast Embedded Cache in kubernetes
https://github.com/kuldeepsingh99/hazelcast-embeded

caching caching-sql hazelcast hazelcast-client hazelcast-cluster hazelcast-spring microservice mysql spring-boot

Last synced: 3 months ago
JSON representation

Spring boot My SQL with Hazelcast Embedded Cache in kubernetes

Awesome Lists containing this project

README

        

# hazelcast embeded cache with Spring boot and Mysql

## Prerequisite

We will be deploying this in kubernetes cluster, so make sure kubernetes is install and cluster is ready

Down the customer service and create your own image, and change the image path [here](https://github.com/kuldeepsingh99/hazelcast-embeded/blob/master/deployment/customer.yml#L19) and push it to your own dockerhub account or keep the image locally.

## Step 1 ( Creating secrets)

Execute these statements

```
kubectl create secret generic mysql-root-pass --from-literal=password=root

kubectl create secret generic mysql-user-pass --from-literal=username=root --from-literal=password=root

kubectl create secret generic mysql-db-url --from-literal=database=customerdb
```

## Step 2 (Deploying mysql DB)

Run this command to create mysql DB container
```
kubectl apply -f mysql.yml
```

mysql.yml file is [here](https://github.com/kuldeepsingh99/hazelcast-embeded/blob/master/deployment/mysql.yml)

check whether pods/service/deploymeny are created with these command
```
kubectl get deploy
kubectl get svc
kubectl get pods
```

## Step 3 (Deploying customer service)

Run this command to create mysql DB container
```
kubectl apply -f customer.yml
```

customer.yml file is [here](https://github.com/kuldeepsingh99/hazelcast-embeded/blob/master/deployment/customer.yml)

check whether pods/service/deploymeny are created with these command
```
kubectl get deploy
kubectl get svc
kubectl get pods
```

## Scaling Customer Service

Exceute this commond to scale

```
kubectl scale --replicas=2 deployment/customer
```