Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Biometric Backend
#### Helm
#### Kubernetes
see https://github.com/ObrienlabsDev/biometric-backend/tree/main/biometric-nbi/src/kubernetes

The following script runs both the mysql and biometric-nbi springboot containers

```
kubernetes % ./deploy.sh
(venv-t214) michaelobrien@mbp8 kubernetes % kubectl get pods -n mysql
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: biometric-nbi
labels:
app: biometric-nbi
spec:
replicas: 1
selector:
matchLabels:
app: biometric-nbi
template:
metadata:
labels:
app: biometric-nbi
spec:
containers:
- name: biometric-nbi
image: obrienlabs/biometric-nbi:latest
ports:
- containerPort: 8080
env:
- name: SPRING_DATASOURCE_URL
value: jdbc:mysql://mysql.mysql.svc.cluster.local:3306/biometric
- name: SPRING_DATASOURCE_USERNAME
value: root
- name: SPRING_DATASOURCE_PASSWORD
value: password
15 changes: 15 additions & 0 deletions biometric-nbi/src/kubernetes/biometric-nbi-springboot-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: biometric-nbi
labels:
app: biometric-nbi
spec:
type: NodePort
selector:
app: biometric-nbi
ports:
- protocol: TCP
port: 8080
targetPort: 8080
nodePort: 30888
5 changes: 5 additions & 0 deletions biometric-nbi/src/kubernetes/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ kubectl apply -f mysql-storage.yaml
kubectl apply -f mysql-secret.yaml
kubectl apply -f mysql-deployment.yaml
kubectl apply -f mysql-service.yaml
# job to create and populated the database
kubectl apply -f biometric-nbi-springboot-deployment.yaml
kubectl apply -f biometric-nbi-springboot-service.yaml




#kubectl get namespaces
Expand Down
2 changes: 2 additions & 0 deletions biometric-nbi/src/kubernetes/undeploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

kubectl delete -f biometric-nbi-springboot-service.yaml
kubectl delete -f biometric-nbi-springboot-deployment.yaml
kubectl delete -f mysql-service.yaml
kubectl delete -f mysql-deployment.yaml
kubectl delete -f mysql-secret.yaml
Expand Down