You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

24 lines
943 B

# Fuente: https://docs.k0sproject.io/v1.24.4+k0s.0/examples/nginx-ingress/
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.3/deploy/static/provider/baremetal/deploy.yaml
watch kubectl get pods -n ingress-nginx
kubectl get services -n ingress-nginx
kubectl -n ingress-nginx get ingressclasses
kubectl -n ingress-nginx annotate ingressclasses nginx ingressclass.kubernetes.io/is-default-class="true"
echo "Intenta conectar: curl <worker-external-ip>:<node-port>"
echo "La dirección es la del servidor y el puerto NodePort el resultado de kubectl get services -n ingress-nginx"
echo "Como no hay ningún servicio configurado, dará 404 Not Found"
# crear pequeña app verificación
kubectl apply -f app-verificacion.yaml
# conectar (dirección y puerto igual que arriba)
curl k8s-server:32478 -H 'Host: web.example.com'
# resultado correcto:
#
# <html><body><h1>It works!</h1></body></html>
#