From fa26c24d15caa3649cea6a4d8bc61fbeb039a65e Mon Sep 17 00:00:00 2001 From: dvirlabs <114520947+dvirlabs@users.noreply.github.com> Date: Thu, 3 Jul 2025 14:38:38 +0300 Subject: [PATCH] Fetch the data correct --- frontend/src/App.jsx | 2 +- navix-helm/templates/backend-deployment.yaml | 2 +- navix-helm/templates/frontend-deployment.yaml | 2 +- navix-helm/templates/ingress.yaml | 26 ++++++++++++------- navix-helm/values.yaml | 13 +++++----- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index c3abd8b..820d4da 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -10,7 +10,7 @@ function App() { const [sections, setSections] = useState([]); const fetchSections = () => { - fetch('/apps') + fetch('/api/apps') .then(res => res.json()) .then(data => setSections(data.sections || [])); }; diff --git a/navix-helm/templates/backend-deployment.yaml b/navix-helm/templates/backend-deployment.yaml index 68fe22b..35c4627 100644 --- a/navix-helm/templates/backend-deployment.yaml +++ b/navix-helm/templates/backend-deployment.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: backend - image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.image.tag }}" + image: "{{ .Values.backend.image.repository }}:{{ .Values.backend.tag }}" imagePullPolicy: {{ .Values.backend.image.pullPolicy }} ports: - containerPort: 8000 diff --git a/navix-helm/templates/frontend-deployment.yaml b/navix-helm/templates/frontend-deployment.yaml index 4c5725d..9819a6f 100644 --- a/navix-helm/templates/frontend-deployment.yaml +++ b/navix-helm/templates/frontend-deployment.yaml @@ -24,7 +24,7 @@ spec: containers: - name: frontend - image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag }}" + image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.tag }}" imagePullPolicy: {{ .Values.frontend.image.pullPolicy }} ports: - containerPort: 80 diff --git a/navix-helm/templates/ingress.yaml b/navix-helm/templates/ingress.yaml index 6f721aa..15822f1 100644 --- a/navix-helm/templates/ingress.yaml +++ b/navix-helm/templates/ingress.yaml @@ -10,16 +10,20 @@ metadata: spec: ingressClassName: {{ .Values.frontend.ingress.className }} rules: - - host: {{ .Values.frontend.ingress.hosts[0].host }} + {{- range .Values.frontend.ingress.hosts }} + - host: {{ .host }} http: paths: - - path: / - pathType: Prefix + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} backend: service: name: navix-frontend port: - number: {{ .Values.frontend.service.port }} + number: {{ $.Values.frontend.service.port }} + {{- end }} + {{- end }} {{- end }} --- @@ -36,14 +40,18 @@ metadata: spec: ingressClassName: {{ .Values.backend.ingress.className }} rules: - - host: {{ .Values.backend.ingress.hosts[0].host }} + {{- range .Values.backend.ingress.hosts }} + - host: {{ .host }} http: paths: - - path: /api - pathType: Prefix + {{- range .paths }} + - path: {{ .path }} + pathType: {{ .pathType }} backend: service: name: navix-backend port: - number: {{ .Values.backend.service.port }} -{{- end }} \ No newline at end of file + number: {{ $.Values.backend.service.port }} + {{- end }} + {{- end }} +{{- end }} diff --git a/navix-helm/values.yaml b/navix-helm/values.yaml index 0e67780..c0650ad 100644 --- a/navix-helm/values.yaml +++ b/navix-helm/values.yaml @@ -1,8 +1,8 @@ frontend: image: - repository: harbor.dvirlabs.com/my-apps/navix-front - tag: latest + repository: harbor.dvirlabs.com/my-apps/navix-frontend pullPolicy: IfNotPresent + tag: master-4fc5494 service: type: ClusterIP port: 80 @@ -21,12 +21,12 @@ frontend: API_BASE: "https://navix.dvirlabs.com/api" MINIO_ENDPOINT: "s3.dvirlabs.com" MINIO_BUCKET: "navix-icons" - + tag: master-4fc5494 backend: image: - repository: harbor.dvirlabs.com/my-apps/navix-back - tag: latest + repository: harbor.dvirlabs.com/my-apps/navix-backend pullPolicy: IfNotPresent + tag: master-4fc5494 service: type: ClusterIP port: 8000 @@ -42,7 +42,8 @@ backend: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" hosts: - - host: navix.dvirlabs.com + - host: api-navix.dvirlabs.com paths: - path: /api pathType: Prefix +