Class NetworkPolicySpec
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.networking.v1.NetworkPolicySpec
-
- All Implemented Interfaces:
com.marcnuri.yakc.model.Model
public class NetworkPolicySpec extends java.lang.Object implements com.marcnuri.yakc.model.Model
NetworkPolicySpec provides the specification of a NetworkPolicy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NetworkPolicySpec.Builder
-
Constructor Summary
Constructors Constructor Description NetworkPolicySpec()
NetworkPolicySpec(java.util.List<NetworkPolicyEgressRule> egress, java.util.List<NetworkPolicyIngressRule> ingress, @NonNull LabelSelector podSelector, java.util.List<java.lang.String> policyTypes)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NetworkPolicySpec.Builder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.util.List<NetworkPolicyEgressRule>
getEgress()
egress is a list of egress rules to be applied to the selected pods.java.util.List<NetworkPolicyIngressRule>
getIngress()
ingress is a list of ingress rules to be applied to the selected pods.@NonNull LabelSelector
getPodSelector()
java.util.List<java.lang.String>
getPolicyTypes()
policyTypes is a list of rule types that the NetworkPolicy relates to.int
hashCode()
void
setEgress(java.util.List<NetworkPolicyEgressRule> egress)
egress is a list of egress rules to be applied to the selected pods.void
setIngress(java.util.List<NetworkPolicyIngressRule> ingress)
ingress is a list of ingress rules to be applied to the selected pods.void
setPodSelector(@NonNull LabelSelector podSelector)
void
setPolicyTypes(java.util.List<java.lang.String> policyTypes)
policyTypes is a list of rule types that the NetworkPolicy relates to.NetworkPolicySpec.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Constructor Detail
-
NetworkPolicySpec
public NetworkPolicySpec(java.util.List<NetworkPolicyEgressRule> egress, java.util.List<NetworkPolicyIngressRule> ingress, @NonNull @NonNull LabelSelector podSelector, java.util.List<java.lang.String> policyTypes)
-
NetworkPolicySpec
public NetworkPolicySpec()
-
-
Method Detail
-
builder
public static NetworkPolicySpec.Builder builder()
-
toBuilder
public NetworkPolicySpec.Builder toBuilder()
-
getEgress
public java.util.List<NetworkPolicyEgressRule> getEgress()
egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
-
getIngress
public java.util.List<NetworkPolicyIngressRule> getIngress()
ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default)
-
getPodSelector
@NonNull public @NonNull LabelSelector getPodSelector()
-
getPolicyTypes
public java.util.List<java.lang.String> getPolicyTypes()
policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
-
setEgress
public void setEgress(java.util.List<NetworkPolicyEgressRule> egress)
egress is a list of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic matches at least one egress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta-level in 1.8
-
setIngress
public void setIngress(java.util.List<NetworkPolicyIngressRule> ingress)
ingress is a list of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no NetworkPolicies selecting the pod (and cluster policy otherwise allows the traffic), OR if the traffic source is the pod's local node, OR if the traffic matches at least one ingress rule across all of the NetworkPolicy objects whose podSelector matches the pod. If this field is empty then this NetworkPolicy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default)
-
setPodSelector
public void setPodSelector(@NonNull @NonNull LabelSelector podSelector)
-
setPolicyTypes
public void setPolicyTypes(java.util.List<java.lang.String> policyTypes)
policyTypes is a list of rule types that the NetworkPolicy relates to. Valid options are ["Ingress"], ["Egress"], or ["Ingress", "Egress"]. If this field is not specified, it will default based on the existence of ingress or egress rules; policies that contain an egress section are assumed to affect egress, and all policies (whether or not they contain an ingress section) are assumed to affect ingress. If you want to write an egress-only policy, you must explicitly specify policyTypes [ "Egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policyTypes value that include "Egress" (since such a policy would not include an egress section and would otherwise default to just [ "Ingress" ]). This field is beta-level in 1.8
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-