bruno_paris
Intern
Intern
  • UID10130
  • Fans0
  • Follows0
  • Posts1
Reads:299Replies:0

Can't use kubectl port-forward on Serverless Kubernetes

Created#
More Posted time:Nov 1, 2021 20:34 PM
Hello,


With the Serverless Kubernetes service, I created a pod with a nginx image running on the port 80. Then I try tu use the kubectl port-forward command :
kubectl port-forward nginx-helloworld 8080:80
It fails with the following message :
error: error upgrading connection: unable to upgrade connection: 404 request not found
The content of my pod resource is:

apiVersion: v1
kind: Pod
metadata:
 name: nginx-helloworld
spec:
 containers:
 - name: nginx-helloworld
   image: devopstestlab/nginx-helloworld
I tried too with:
   ports:
   - containerPort: 80
Does anyone know why? Port forwarding is not allowed?
Thank you.
Guest