-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart_kubernetes.sh
executable file
·32 lines (22 loc) · 1.04 KB
/
start_kubernetes.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
minikube start --driver=docker
# Set the Docker environment to use Minikube’s Docker daemon
# This allows you to build and manage Docker images directly in Minikube’s context
eval $(minikube docker-env)
# Load local images from docker (make sure Docker Desktop is running)
minikube image load microservice-example-server:latest
minikube image load postgres:latest
# Setup namespace
# Right now default will be used for simplicity
# kubectl create namespace microservice-example
# Load the architecture
kubectl apply -f kubernetes/volumes/db-data-persistentvolumeclaim.yaml
kubectl apply -f kubernetes/secrets/db-password-secret.yaml
kubectl apply -f kubernetes/deployments/postgres-db-deployment.yaml
kubectl apply -f kubernetes/deployments/server-deployment.yaml
kubectl apply -f kubernetes/services/postgres-db-service.yaml
kubectl apply -f kubernetes/services/server-service.yaml
# Set the Docker environment to user Docker daemon again if needed
# eval $(minikube docker-env --unset)
# Expose the services to host machine
minikube tunnel