Package io.fabric8.kubernetes.api.model
Class ContainerPort
- java.lang.Object
-
- io.fabric8.kubernetes.api.model.ContainerPort
-
- All Implemented Interfaces:
io.fabric8.kubernetes.api.builder.Editable<ContainerPortBuilder>,KubernetesResource,Serializable
@Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator") public class ContainerPort extends Object implements io.fabric8.kubernetes.api.builder.Editable<ContainerPortBuilder>, KubernetesResource
ContainerPort represents a network port in a single container.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ContainerPort()No args constructor for use in serializationContainerPort(Integer containerPort, String hostIP, Integer hostPort, String name, String protocol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContainerPortBuilderedit()Map<String,Object>getAdditionalProperties()IntegergetContainerPort()Number of port to expose on the pod's IP address.StringgetHostIP()What host IP to bind the external port to.IntegergetHostPort()Number of port to expose on the host.StringgetName()If specified, this must be an IANA_SVC_NAME and unique within the pod.StringgetProtocol()Protocol for port.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetContainerPort(Integer containerPort)Number of port to expose on the pod's IP address.voidsetHostIP(String hostIP)What host IP to bind the external port to.voidsetHostPort(Integer hostPort)Number of port to expose on the host.voidsetName(String name)If specified, this must be an IANA_SVC_NAME and unique within the pod.voidsetProtocol(String protocol)Protocol for port.ContainerPortBuildertoBuilder()
-
-
-
Method Detail
-
getContainerPort
public Integer getContainerPort()
Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.
-
setContainerPort
public void setContainerPort(Integer containerPort)
Number of port to expose on the pod's IP address. This must be a valid port number, 0 < x < 65536.
-
getHostIP
public String getHostIP()
What host IP to bind the external port to.
-
setHostIP
public void setHostIP(String hostIP)
What host IP to bind the external port to.
-
getHostPort
public Integer getHostPort()
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.
-
setHostPort
public void setHostPort(Integer 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.
-
getName
public String getName()
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.
-
setName
public void setName(String 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.
-
getProtocol
public String getProtocol()
Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".
-
setProtocol
public void setProtocol(String protocol)
Protocol for port. Must be UDP, TCP, or SCTP. Defaults to "TCP".
-
edit
public ContainerPortBuilder edit()
- Specified by:
editin interfaceio.fabric8.kubernetes.api.builder.Editable<ContainerPortBuilder>
-
toBuilder
public ContainerPortBuilder toBuilder()
-
-