-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
04a2cee
commit 57f5be4
Showing
5 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
version: "3.8" | ||
|
||
networks: | ||
user-net: | ||
driver: bridge | ||
|
||
services: | ||
traefik: | ||
image: traefik:v3.0 | ||
command: | ||
- "--api.insecure=true" | ||
- "--providers.docker=true" | ||
- "--entrypoints.web.address=:80" | ||
ports: | ||
- "80:80" # Expose HTTP | ||
- "8080:8080" # Expose Traefik dashboard | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock:ro" # Allow Traefik to listen to Docker | ||
networks: | ||
- user-net | ||
|
||
|
||
user-frontend: | ||
image: user-frontend:1.0 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.frontend.rule=Host(`frontend.localhost`)" | ||
- "traefik.http.services.frontend.loadbalancer.server.port=80" | ||
depends_on: | ||
- user-backend | ||
networks: | ||
- user-net | ||
|
||
user-backend: | ||
image: user-backend:1.0 | ||
labels: | ||
- "traefik.enable=true" | ||
- "traefik.http.routers.backend.rule=Host(`backend.localhost`)" | ||
- "traefik.http.services.backend.loadbalancer.server.port=8082" | ||
networks: | ||
- user-net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
docker network create web | ||
docker-compose up -d | ||
|
||
sudo systemctl stop nginx | ||
sudo systemctl stop apache2 | ||
|
||
sudo lsof -i :80 | ||
sudo lsof -i :8080 | ||
|
||
|
||
helm create frontend-chart | ||
|
||
helm install frontend-release ./frontend-chart | ||
|
||
helm install backend-release ./backend-chart | ||
|
||
##Verify Deployment | ||
```bash | ||
#deploying backend-chart | ||
kubectl get pods | ||
kubectl get services | ||
eval $(minikube docker-env) | ||
helm install backend-release ./backend-chart | ||
kubectl get pods | ||
kubectl get service | ||
minikube ip #to get the ip address of minikube service 192.168.49.2 | ||
minikube service backend-release-backend-chart --url # http://192.168.49.2:32040 | ||
#Always comment the liveness and readiness checks in the values.yaml file of the chart | ||
#### | ||
kubectl get ingresses | ||
helm uninstall frontend-release | ||
kubectl get deployments | ||
###steps to deploy frontend-release | ||
helm create frontend-chart | ||
helm install frontend-release frontend-chart | ||
kubectl get pods | ||
kubectl get services | ||
minikube ip | ||
minikube service frontend-release-frontend-chart --url ##http://192.168.49.2:31182 | ||
##Debuging images | ||
docker build -t user-frontend:1.0 . | ||
minikube image load user-frontend:1.0 | ||
minikube ssh -- docker system prune -af | ||
|
||
##Rebuild or upgrage deployment | ||
helm upgrade --install frontend-release frontend-chart | ||
helm upgrade --install backend-release backend-chart | ||
const API_BASE_URL = "http://192.168.49.2:8082"; // Replace with Minikube service URL if needed | ||
if we are using minikube | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
entryPoints: | ||
web: | ||
address: ":80" | ||
admin: | ||
address: ":8080" | ||
|
||
api: | ||
dashboard: true | ||
|
||
providers: | ||
docker: | ||
exposedByDefault: false |