VMware Cloud Community
MasterWayZ
Enthusiast
Enthusiast
Jump to solution

vSphere Kubernetes: Using ServiceType NodePort is not allowed

Hi,

Today I am testing out vSphere with Kubernetes, and came across this error:

Error from server: error when creating "https://raw.githubusercontent.com/lamw/vmware-k8s-app-demo/master/yelb.yaml": admission webhook "admission.vmware.com" denied the request: Using ServiceType NodePort is not allowed

This is when trying to deploy the yelb application from this URL: https://raw.githubusercontent.com/lamw/vmware-k8s-app-demo/master/yelb.yaml

To set up the lab, I used the Automated vSphere 7 and vSphere with Kubernetes Lab Deployment Script.

Any idea what could be going wrong?

vExpert 2020
Tags (2)
Reply
0 Kudos
1 Solution

Accepted Solutions
daphnissov
Immortal
Immortal
Jump to solution

That demo appliance is for TKG multicloud, which is different from vSphere 7 with K8s. If you already have the latter, you're all set. You will still have to deploy TKG clusters to use NodePort, but this shouldn't be your first choice. Service of type LoadBalancer is usually preferred with or without an Ingress service.

View solution in original post

Reply
0 Kudos
7 Replies
daphnissov
Immortal
Immortal
Jump to solution

Any idea what could be going wrong?

Yes, when deploying to the supervisor (vSphere Pods), service of type NodePort is not supported. To use NodePort you need to be using Tanzu Kubernetes Grid clusters or some other upstream-compliant K8s distro.

Reply
0 Kudos
MasterWayZ
Enthusiast
Enthusiast
Jump to solution

Hi,

That makes sense. When I tried to deploy Tanzu Kubernetes Grid using the UI build into the Demo Appliance, it did say that I didn't need it though, I'll have to see if there is a way to bypass that.

vExpert 2020
Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

Didn't need what? What exactly are you trying to do, and with what?

Reply
0 Kudos
MasterWayZ
Enthusiast
Enthusiast
Jump to solution

My apologies.

I was attempting to deploy Tanzu Kubernetes Grid using the UI in the Demo Appliance, but it says that deployment is not needed if you have vSphere for Kubernetes set up already. I'll have to go with the CLI and see if that bypasses that so I can deploy it anyway and then try again.

vExpert 2020
Reply
0 Kudos
daphnissov
Immortal
Immortal
Jump to solution

That demo appliance is for TKG multicloud, which is different from vSphere 7 with K8s. If you already have the latter, you're all set. You will still have to deploy TKG clusters to use NodePort, but this shouldn't be your first choice. Service of type LoadBalancer is usually preferred with or without an Ingress service.

Reply
0 Kudos
MasterWayZ
Enthusiast
Enthusiast
Jump to solution

I see, many thanks!

vExpert 2020
Reply
0 Kudos
vCliff
Contributor
Contributor
Jump to solution

Use this -> 

./kubectl apply -f https://raw.githubusercontent.com/lamw/vmware-k8s-app-demo/master/yelb-lb.yaml
Reply
0 Kudos