美文网首页
kubectl apply报错,spec.ports[0].no

kubectl apply报错,spec.ports[0].no

作者: CokeCode | 来源:发表于2021-02-03 16:38 被阅读0次
* spec.ports[0].nodePort: Forbidden: may not be used when `type` is 'ClusterIP'

将service的type: LoadBalancer改成type: ClusterIP时,执行kubectl apply会报错。可以先删除service,然后再执行kubectl apply。

apiVersion: v1
kind: Service
metadata:
spec:
  type: LoadBalancer

删除service的命令:

$ kubectl delete svc xxx_service -n xxx_ns

删除xxx_ns命名空间下的xxx_service服务

相关文章

网友评论

      本文标题:kubectl apply报错,spec.ports[0].no

      本文链接:https://www.haomeiwen.com/subject/tkgytltx.html