bgdnvk / customer-support

Kubernetes and Microservices Full Stack Web App
Apache License 2.0
0 stars 0 forks source link

ingress controller not working #3

Open bgdnvk opened 1 year ago

bgdnvk commented 1 year ago

script to start ingress:

kubectl create namespace ingress-nginx
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.0/deploy/static/provider/cloud/deploy.yaml
kubectl apply -f ingress.yam

ingress yaml:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: api-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx-ingress
  rules:
    - http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: loadbalancer
                port:
                  number: 300

perhaps the ports are wrong? not sure

docs example: https://kubernetes.io/docs/concepts/services-networking/ingress/

bgdnvk commented 1 year ago

delete all pods

kubectl delete pods --all -n ingress-nginx
bgdnvk commented 1 year ago

check deployments and delete: kubectl delete pods --all -n ingress-nginx

delete from namespace: kubectl delete deployment ingress-nginx-controller -n ingress-nginx