Show / Hide Table of Contents

Class V1NetworkPolicyIngressRule

NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and from.

Inheritance
object
V1NetworkPolicyIngressRule
Implements
IEquatable<V1NetworkPolicyIngressRule>
Inherited Members
object.GetType()
object.MemberwiseClone()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: k8s.Models
Assembly: KubernetesClient.dll
Syntax
public record V1NetworkPolicyIngressRule : IEquatable<V1NetworkPolicyIngressRule>

Constructors

View Source

V1NetworkPolicyIngressRule()

Declaration
public V1NetworkPolicyIngressRule()
View Source

V1NetworkPolicyIngressRule(V1NetworkPolicyIngressRule)

Declaration
protected V1NetworkPolicyIngressRule(V1NetworkPolicyIngressRule original)
Parameters
Type Name Description
V1NetworkPolicyIngressRule original

Properties

View Source

EqualityContract

Declaration
protected virtual Type EqualityContract { get; }
Property Value
Type Description
Type
View Source

FromProperty

from is a list of sources which should be able to access the pods selected for this rule. Items in this list are combined using a logical OR operation. If this field is empty or missing, this rule matches all sources (traffic not restricted by source). If this field is present and contains at least one item, this rule allows traffic only if the traffic matches at least one item in the from list.

Declaration
[JsonPropertyName("from")]
public IList<V1NetworkPolicyPeer> FromProperty { get; set; }
Property Value
Type Description
IList<V1NetworkPolicyPeer>
View Source

Ports

ports is a list of ports which should be made accessible on the pods selected for this rule. Each item in this list is combined using a logical OR. If this field is empty or missing, this rule matches all ports (traffic not restricted by port). If this field is present and contains at least one item, then this rule allows traffic only if the traffic matches at least one port in the list.

Declaration
[JsonPropertyName("ports")]
public IList<V1NetworkPolicyPort> Ports { get; set; }
Property Value
Type Description
IList<V1NetworkPolicyPort>

Methods

View Source

Equals(object?)

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool
Overrides
object.Equals(object)
View Source

Equals(V1NetworkPolicyIngressRule?)

Declaration
public virtual bool Equals(V1NetworkPolicyIngressRule? other)
Parameters
Type Name Description
V1NetworkPolicyIngressRule other
Returns
Type Description
bool
View Source

GetHashCode()

Declaration
public override int GetHashCode()
Returns
Type Description
int
Overrides
object.GetHashCode()
View Source

PrintMembers(StringBuilder)

Declaration
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
Type Name Description
StringBuilder builder
Returns
Type Description
bool
View Source

ToString()

Declaration
public override string ToString()
Returns
Type Description
string
Overrides
object.ToString()

Operators

View Source

operator ==(V1NetworkPolicyIngressRule?, V1NetworkPolicyIngressRule?)

Declaration
public static bool operator ==(V1NetworkPolicyIngressRule? left, V1NetworkPolicyIngressRule? right)
Parameters
Type Name Description
V1NetworkPolicyIngressRule left
V1NetworkPolicyIngressRule right
Returns
Type Description
bool
View Source

operator !=(V1NetworkPolicyIngressRule?, V1NetworkPolicyIngressRule?)

Declaration
public static bool operator !=(V1NetworkPolicyIngressRule? left, V1NetworkPolicyIngressRule? right)
Parameters
Type Name Description
V1NetworkPolicyIngressRule left
V1NetworkPolicyIngressRule right
Returns
Type Description
bool

Implements

IEquatable<T>
  • View Source
In this article
Back to top Generated by DocFX