网站首页 文章专栏 05NetworkPolicy.md
05NetworkPolicy.md
创建于:2021-07-04 07:52:53 更新于:2024-11-23 08:05:54 羽瀚尘 414

主要介绍如何使用rest api调度NetworkPolicy资源。

获取某个NetworkPolicy

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

列出指定命名空间的所有NetworkPolicy

GET /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

列出所有命名空间的NetworkPolicy

GET /apis/networking.k8s.io/v1/networkpolicies

新建一个NetworkPolicy

POST /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies

修改一个已有的NetworkPolicy

PATCH /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

替换一个已有的NetworkPolicy

PUT /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

删除单个NetworkPolicy

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}

删除指定命名空间的所有NetworkPolicy

DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies