Actualizar workloads/nginx/nginx-resources.yaml

This commit is contained in:
2026-06-21 07:42:27 +00:00
parent 0fac2b1a58
commit c93de1f494
+5 -11
View File
@@ -1,12 +1,9 @@
--- ---
# 1. El Deployment (Los pods de Nginx)
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: nginx-deployment name: nginx-deployment
namespace: kube-system namespace: nginx-web
labels:
app: nginx
spec: spec:
replicas: 1 replicas: 1
selector: selector:
@@ -24,12 +21,11 @@ spec:
- containerPort: 80 - containerPort: 80
--- ---
# 2. El Service (Para comunicar el Ingress con los Pods)
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: nginx-service name: nginx-service
namespace: kube-system namespace: nginx-web
spec: spec:
selector: selector:
app: nginx app: nginx
@@ -39,17 +35,15 @@ spec:
targetPort: 80 targetPort: 80
--- ---
---
# 3. El Ingress (Versión a prueba de fallos)
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: nginx-ingress name: nginx-ingress
namespace: kube-system namespace: nginx-web
# 🔴 Hemos quitado todas las annotations para ver si el clúster lo toma por defecto
spec: spec:
ingressClassName: nginx # 🔴 LA CLAVE: Esto enlaza el Ingress con el Controller que está en kube-system
rules: rules:
- host: app.cruzcloud.net - host: nginx.cruzcloud.net
http: http:
paths: paths:
- path: / - path: /