Reputation: 19398
I am reading the Kubernetes docs here https://kubernetes.io/docs/concepts/services-networking/network-policies/
I would assume there is an equivalent object ofr a NetworkPolicy but I didnt find one in the source code or any examples setting the network policy on groups of pods.
Am I looking at the right place?
Upvotes: 0
Views: 464
Reputation: 2298
There’s a handler for it in https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/handlers/NetworkPolicyHandler.java, so I guess it’s supported. The actual NetworkPolicy class seems to be in a dependency library, kubernetes-model.
Upvotes: 1
Reputation: 380
Here is an example of creating NetworkPolicy using fabric8 kubernetes client.
https://github.com/fabric8io/kubernetes-client/pull/976
To select group of pods you can use PodSelector in NetworkPolicySpec.
Upvotes: 1