Show / Hide Table of Contents

Class V1ContainerPort

ContainerPort represents a network port in a single container.

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

Constructors

V1ContainerPort()

Declaration
public V1ContainerPort()

V1ContainerPort(V1ContainerPort)

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

Properties

ContainerPort

Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.

Declaration
[JsonPropertyName("containerPort")]
public int ContainerPort { get; set; }
Property Value
Type Description
int

EqualityContract

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

HostIP

What host IP to bind the external port to.

Declaration
[JsonPropertyName("hostIP")]
public string HostIP { get; set; }
Property Value
Type Description
string

HostPort

Number of port to expose on the host. If specified, this must be a valid port number, 0 < x < 65536. If HostNetwork is specified, this must match ContainerPort. Most containers do not need this.

Declaration
[JsonPropertyName("hostPort")]
public int? HostPort { get; set; }
Property Value
Type Description
int?

Name

If specified, this must be an IANA_SVC_NAME and unique within the pod. Each named port in a pod must have a unique name. Name for the port that can be referred to by services.

Declaration
[JsonPropertyName("name")]
public string Name { get; set; }
Property Value
Type Description
string

Protocol

Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".

Declaration
[JsonPropertyName("protocol")]
public string Protocol { get; set; }
Property Value
Type Description
string

Methods

Equals(object?)

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

Equals(V1ContainerPort?)

Declaration
public virtual bool Equals(V1ContainerPort? other)
Parameters
Type Name Description
V1ContainerPort other
Returns
Type Description
bool

GetHashCode()

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

PrintMembers(StringBuilder)

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

ToString()

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

Operators

operator ==(V1ContainerPort?, V1ContainerPort?)

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

operator !=(V1ContainerPort?, V1ContainerPort?)

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

Implements

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