Hi I'm having trouble when im changing the image nginxdemos/hello to my own image that is running a nodejs app on port 7000
ReplicationController
apiVersion: v1
kind: ReplicationController
metadata:
name: tea-rc
spec:
replicas: 2
template:
metadata:
labels:
app: tea
spec:
containers:
- name: tea
image: mynode/image
ports:
- containerPort: 7000
Service
apiVersion: v1
kind: Service
metadata:
name: tea-svc
labels:
app: tea
spec:
ports:
- port: 80
targetPort: 7000
protocol: TCP
name: http
selector:
app: tea
Ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: cafe-ingress
spec:
tls:
- hosts:
- cafe.example.com
secretName: cafe-secret
rules:
- host: cafe.example.com
http:
paths:
- path: /tea
backend:
serviceName: tea-svc
servicePort: 80
if i use the nginxdemos/hello image, everything seems to work.
what am i missing? Thanks in advance..
Hi! Maybe you service targetPort doesn't match containerPort:
ReplicationController containerPort = 7000
Service targetPort = 700
@damour i already edited it. it should be 7000.
@rhomnickcoloma
What kind of errors are you seeing?
Could you look into the NGINX logs? To get extended logs, please uncomment https://github.com/nginxinc/kubernetes-ingress/blob/master/examples/complete-example/nginx-ingress-rc.yaml#L28 and redeploy the Ingress controller.
Thanks Guys! It's now working.
@rhomnickcoloma I think I might be experiencing a similar issue. How did you solve?
I am trying to a LoadBalancer and Ingress to send incoming traffic from the LoadBalancer to the deployment pods by sending traffic from port 80 on the LoadBalancer to port 3000 on the pod.
What ended up being your solution?
@rhomnickcoloma, how you solve this issue??
@rhomnickcoloma that's soooo lame.
what is the solution?