I have setup Istio's "ingress gateway" to listen on 8080, and have issues with running the Knative hello-world. Has anyone setup Knative like this?
I would like internet traffic coming in to port 8080 to show the output of the Knative hello world.
I have setup Istio's "ingress gateway" to listen on 8080, and have issues with running the Knative hello-world. Has anyone setup Knative like this?
I would like internet traffic coming in to port 8080 to show the output of the Knative hello world.
If you have an existing container which listens on port 80 instead of $PORT
, you can set spec.template.spec.containers[0].ports[0].containerPort
to indicate which port the container listens on.
For example:
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: helloworld-go
namespace: default
spec:
template:
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go
env:
- name: TARGET
value: "Go Sample v1"
ports:
- containerPort: 80
Knative will automatically set the $PORT
environment variable to the requested container port, so setting containerPort should work with any of the Knative samples.
If I understand the question this is similar to an issue I've run into trying to configure Knative with the Istio ingress gateway on non-standard ports. Following the Knative instructions for Istio integration I applied the Knative Istio controller (net-istio). This includes a networking.istio.io Gateway
that selects istio: ingressgateway
that specifies port 80. Modifying this resource to the correct port (8080 in the question) should fix the issue.