cce
更新指定的networkpolicy
更新时间:2020/12/16 GMT+08:00
功能介绍
This API is used to partially update the specified NetworkPolicy
其中以下字段支持更新:
- metadata.name
- metadata.namespace
- metadata.selfLink
- metadata.resourceVersion
- metadata.generation
- metadata.uid
- metadata.creationTimestamp
- metadata.deletionTimestamp
- metadata.labels
- metadata.annotations
- spec.ingress
Content-Type: application/merge-patch+json { "spec": { "ingress": [{ "from": [{ "podSelector": { "matchLabels": { "app": "nginx2" } } }] }] } }
响应示例:
{ "kind": "NetworkPolicy", "apiVersion": "networking.k8s.io/v1", "metadata": { "name": "test-network-policy", "namespace": "default", "selfLink": "/apis/networking.k8s.io/v1/namespaces/default/networkpolicies/test-network-policy", "uid": "be347ddd-e8af-11e8-b187-fa163e3cca63", "resourceVersion": "213982", "generation": 1, "creationTimestamp": "2018-11-15T08:23:34Z", "labels": { "app": "nginx" } }, "spec": { "podSelector": { "matchLabels": { "app": "nginx" } }, "ingress": [{ "from": [{ "podSelector": { "matchLabels": { "app": "nginx2" } } }], "ports": [{ "protocol": "TCP", "port": 6379 }] }], "policyTypes":[ "Ingress" ] } }
父主题: NetworkPolicy
