Add base kubernetes support 3
This commit is contained in:
@@ -40,8 +40,16 @@ COPY <<'EOF' /docker-entrypoint.d/30-substitute-env.sh
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Default values for environment variables
|
# Handle VITE_API_URL specially to preserve empty values
|
||||||
export VITE_API_URL=${VITE_API_URL:-"http://gateway-service:8000"}
|
# If VITE_API_URL is unset, use default; if empty, preserve empty; otherwise use value
|
||||||
|
if [ -z "${VITE_API_URL+x}" ]; then
|
||||||
|
export VITE_API_URL="http://gateway-service:8000"
|
||||||
|
elif [ -z "$VITE_API_URL" ]; then
|
||||||
|
# If VITE_API_URL is explicitly set to empty string, preserve it
|
||||||
|
export VITE_API_URL=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Default values for other environment variables
|
||||||
export VITE_APP_TITLE=${VITE_APP_TITLE:-"PanIA Dashboard"}
|
export VITE_APP_TITLE=${VITE_APP_TITLE:-"PanIA Dashboard"}
|
||||||
export VITE_APP_VERSION=${VITE_APP_VERSION:-"1.0.0"}
|
export VITE_APP_VERSION=${VITE_APP_VERSION:-"1.0.0"}
|
||||||
|
|
||||||
|
|||||||
@@ -28,10 +28,11 @@ export default defineConfig({
|
|||||||
},
|
},
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: process.env.VITE_API_URL ||
|
target: process.env.VITE_API_URL !== undefined
|
||||||
(process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
|
? (process.env.VITE_API_URL || '') // Use value or empty string
|
||||||
? 'http://gateway-service:8000' // Kubernetes internal service
|
: (process.env.NODE_ENV === 'development' && process.env.KUBERNETES_SERVICE_HOST
|
||||||
: 'http://localhost:8000'), // Local development
|
? 'http://gateway-service:8000' // Kubernetes internal service
|
||||||
|
: 'http://localhost:8000'), // Local development
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,9 +12,12 @@ data:
|
|||||||
PROFILING_ENABLED: "true"
|
PROFILING_ENABLED: "true"
|
||||||
MOCK_EXTERNAL_APIS: "true"
|
MOCK_EXTERNAL_APIS: "true"
|
||||||
|
|
||||||
|
# CORS Configuration for Development
|
||||||
|
CORS_ORIGINS: "http://frontend-service:3000,http://localhost:3000,http://localhost:3001,http://127.0.1:3000,http://127.0.0.1:3001,https://localhost,https://127.0.0.1"
|
||||||
|
|
||||||
# Frontend Development Configuration
|
# Frontend Development Configuration
|
||||||
VITE_ENVIRONMENT: "development"
|
VITE_ENVIRONMENT: "development"
|
||||||
VITE_API_URL: "http://gateway-service:8000"
|
VITE_API_URL: ""
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -86,11 +86,29 @@ patchesJson6902:
|
|||||||
path: /spec/template/spec/containers/0/resources
|
path: /spec/template/spec/containers/0/resources
|
||||||
value:
|
value:
|
||||||
requests:
|
requests:
|
||||||
memory: "128Mi"
|
memory: "64Mi"
|
||||||
cpu: "50m"
|
cpu: "25m"
|
||||||
limits:
|
limits:
|
||||||
memory: "256Mi"
|
memory: "128Mi"
|
||||||
cpu: "200m"
|
cpu: "100m"
|
||||||
|
- target:
|
||||||
|
group: apps
|
||||||
|
version: v1
|
||||||
|
kind: Deployment
|
||||||
|
name: gateway
|
||||||
|
patch: |-
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/imagePullPolicy
|
||||||
|
value: Never
|
||||||
|
- op: replace
|
||||||
|
path: /spec/template/spec/containers/0/resources
|
||||||
|
value:
|
||||||
|
requests:
|
||||||
|
memory: "64Mi"
|
||||||
|
cpu: "25m"
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
- target:
|
- target:
|
||||||
group: apps
|
group: apps
|
||||||
version: v1
|
version: v1
|
||||||
|
|||||||
Reference in New Issue
Block a user