Reputation: 131
i made k8s service with kubeadm, flannel, ingress-nginx(bare metal) ON AWS ec2 instance (ubuntu 20.04). without EKS.
i want access my service with master node's public ip.
I tried with helm and kubectl to addon ingress-nginx
helm install nginx-ingress nginx-stable/nginx-ingress --set rbac.create=true
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.2/deploy/static/provider/baremetal/deploy.yaml
Then, applied an app, service, ingress
After that, "kubectl get ingress" command doesn't show me ADDRESS and "kubectl get svc"
doesn't show EXTERNAL-IP
so, i patched external ip of master node with command
"kubectl patch svc nginx-ingress-nginx-ingress -p '{"spec":{"externalIPs":["<ec2-master-pub-ip>"]}}'"
I queried to that ip:port, but can't accessed. also, i patched external ip with worker node's public ip. when queried to worker node, i got 404 error from nginx
I want to know solution!!
thank you
add : ingress.yml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: node
spec:
rules:
- http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: node
port:
number: 3000
Upvotes: 0
Views: 1167