diff --git a/deploy/k3s/api.yaml b/deploy/k3s/api.yaml index 0ceeb39..3872920 100644 --- a/deploy/k3s/api.yaml +++ b/deploy/k3s/api.yaml @@ -7,7 +7,7 @@ metadata: labels: app: student-api spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: student-api @@ -21,51 +21,58 @@ spec: labels: app: student-api spec: + nodeSelector: + kubernetes.io/hostname: hp62a containers: - name: api - image: docker.io/library/academia-api:v2 - imagePullPolicy: IfNotPresent + image: academia-api:latest + imagePullPolicy: Never ports: - containerPort: 5000 name: http env: - name: ASPNETCORE_ENVIRONMENT - valueFrom: - configMapKeyRef: - name: student-config - key: ASPNETCORE_ENVIRONMENT + value: "Production" - name: ASPNETCORE_URLS - valueFrom: - configMapKeyRef: - name: student-config - key: ASPNETCORE_URLS + value: "http://+:5000" - name: ConnectionStrings__DefaultConnection valueFrom: secretKeyRef: name: student-secrets key: db-connection-string + # Optimización de memoria .NET + - name: DOTNET_gcServer + value: "0" + - name: DOTNET_GCHeapCount + value: "1" + - name: DOTNET_gcConcurrent + value: "1" + - name: DOTNET_GCConserveMemory + value: "9" + - name: CORS_ORIGINS + value: "https://academia.ingeniumcodex.com" resources: requests: - memory: "256Mi" - cpu: "100m" + memory: "128Mi" + cpu: "50m" limits: - memory: "512Mi" + memory: "256Mi" cpu: "500m" livenessProbe: httpGet: path: /health port: 5000 - initialDelaySeconds: 15 - periodSeconds: 20 - timeoutSeconds: 5 + initialDelaySeconds: 30 + periodSeconds: 30 + timeoutSeconds: 10 failureThreshold: 3 readinessProbe: httpGet: path: /health port: 5000 - initialDelaySeconds: 10 + initialDelaySeconds: 15 periodSeconds: 10 - timeoutSeconds: 3 + timeoutSeconds: 5 failureThreshold: 3 securityContext: allowPrivilegeEscalation: false diff --git a/deploy/k3s/frontend.yaml b/deploy/k3s/frontend.yaml index f1cd8ba..5f7b5f4 100644 --- a/deploy/k3s/frontend.yaml +++ b/deploy/k3s/frontend.yaml @@ -7,7 +7,7 @@ metadata: labels: app: student-frontend spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: student-frontend @@ -21,26 +21,28 @@ spec: labels: app: student-frontend spec: + nodeSelector: + kubernetes.io/hostname: hp62a containers: - name: frontend - image: docker.io/library/academia-frontend:v2 - imagePullPolicy: IfNotPresent + image: academia-frontend:latest + imagePullPolicy: Never ports: - containerPort: 80 name: http resources: requests: - memory: "64Mi" - cpu: "50m" + memory: "32Mi" + cpu: "10m" limits: - memory: "128Mi" - cpu: "200m" + memory: "64Mi" + cpu: "100m" livenessProbe: httpGet: path: / port: 80 initialDelaySeconds: 10 - periodSeconds: 30 + periodSeconds: 60 readinessProbe: httpGet: path: /