Skip to content

Commit

Permalink
Merge pull request #14 from DioCrafts/feature/frontend-helm-chart
Browse files Browse the repository at this point in the history
fix errors
  • Loading branch information
DioCrafts authored Nov 17, 2024
2 parents d2081d0 + 08638e1 commit 15fcd94
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 200 deletions.
2 changes: 0 additions & 2 deletions api-gateway/backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ WORKDIR /usr/local/bin
# Copia el binario estático desde la etapa de construcción
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/flusso_api_gateway .

# Copia los archivos estáticos
COPY src/gui/static /usr/local/bin/static

# Exponer los puertos en los que la aplicación escucha
EXPOSE 8080
Expand Down
63 changes: 0 additions & 63 deletions api-gateway/backend/src/gui/gui_server.rs

This file was deleted.

4 changes: 0 additions & 4 deletions api-gateway/backend/src/gui/mod.rs

This file was deleted.

51 changes: 0 additions & 51 deletions api-gateway/backend/src/gui/static/app.js

This file was deleted.

41 changes: 0 additions & 41 deletions api-gateway/backend/src/gui/static/index.html

This file was deleted.

25 changes: 0 additions & 25 deletions api-gateway/backend/src/gui/static/styles.css

This file was deleted.

6 changes: 3 additions & 3 deletions api-gateway/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Etapa 1: Construcción de la aplicación React
# Etapa 1: Construcción de los archivos estáticos
FROM node:18-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json ./
Expand All @@ -8,6 +8,6 @@ RUN npm run build

# Etapa 2: Servidor Nginx para los archivos estáticos
FROM nginx:stable-alpine
COPY --from=builder /app/build /usr/share/nginx/html
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]
5 changes: 3 additions & 2 deletions api-gateway/frontend/src/apiClient.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import axios from 'axios';

// Configura Axios para que apunte al backend
// Configura Axios para que apunte al API REST en Kubernetes
const apiClient = axios.create({
baseURL: 'http://localhost:3000/api', // Cambia esto si el backend está en otra URL o puerto
baseURL: 'http://flusso-api-gateway-api-gateway.default.svc.cluster.local:8081/api', // URL del API REST
});

// Funciones para consumir la API REST
export const getMetrics = async () => {
const response = await apiClient.get('/metrics');
return response.data;
Expand Down
2 changes: 1 addition & 1 deletion api-gateway/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
port: 5173, // Cambia si hay conflictos de puertos
open: true, // Abre el navegador automáticamente
proxy: {
'/api': 'http://localhost:3000', // Redirige las solicitudes al backend
'/api': 'http://flusso-api-gateway-api-gateway.default.svc.cluster.local:8081', // Redirige las solicitudes al API REST en Kubernetes
},
},
});
8 changes: 2 additions & 6 deletions helm/api-gateway/backend/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,15 @@ metadata:
labels:
app: {{ include "api-gateway.name" . }}
spec:
type: LoadBalancer
type: ClusterIP
ports:
- name: main
port: 80
targetPort: 8080
protocol: TCP
- name: dashboard
- name: api-rest
port: 8081
targetPort: 8081
protocol: TCP
- name: api-gateway
port: 8082
targetPort: {{ .Values.apiGateway.port }}
protocol: TCP
selector:
app: {{ include "api-gateway.name" . }}
2 changes: 1 addition & 1 deletion helm/api-gateway/backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ replicaCount: 1

image:
repository: diocrafts/flusso-api-gateway
tag: v0.0.44
tag: v0.0.46
pullPolicy: IfNotPresent

serviceAccount:
Expand Down
2 changes: 1 addition & 1 deletion helm/api-gateway/frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ replicaCount: 1

image:
repository: diocrafts/flusso-api-gateway-gui
tag: v0.0.44
tag: v0.0.50
pullPolicy: IfNotPresent

service:
Expand Down

0 comments on commit 15fcd94

Please sign in to comment.