k8s svc 端口映射

kubectl create service nodeport < svc-name > --tcp=< port > -o yaml

创建svc

kubectl get svc

查看当前svc

svc.png

kubectl edit svc < svc-name >

修改nodePort为映射端口

yaml.png

修改selector条件为实际需要映射端口的服务

vm.png

# k8s  svc 

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×