Networking Models
V1IPAddress
- IPAddress represents a single IP of a single IP Family. The object is designed to be used by APIs that operate on IP addresses. The object is used by the Service core API for allocation of IP addresses. An IP address can be represented in different formats, to guarantee the uniqueness of the IP, the name of the object is the IP address in canonical format, four decimal digits separated by dots suppressing leading zeros for IPv4 and the representation defined by RFC 5952 for IPv6. Valid: 192.168.1.5 or 2001:db8::1 or 2001:db8:aaaa:bbbb:cccc:dddd:eeee:1 Invalid: 10.01.2.3 or 2001:db8:0:0:0::1
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ObjectMeta | |
spec | V1IPAddressSpec |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const body: k8s.V1IPAddress = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createIPAddress({ body });
console.log(res.metadata?.name);
Used by: NetworkingV1Api.createIPAddress · NetworkingV1Api.patchIPAddress · NetworkingV1Api.readIPAddress
V1IPAddressList
- IPAddressList contains a list of IPAddress.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
items | V1IPAddress[] | items is the list of IPAddresses. |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ListMeta |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const res: k8s.V1IPAddressList = await api.listIPAddress({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}
Used by: NetworkingV1Api.listIPAddress
V1IPAddressSpec
- IPAddressSpec describe the attributes in an IP Address.
| Property | Type | Description |
|---|---|---|
parentRef | V1ParentReference |
V1Ingress
- Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ObjectMeta | |
spec | V1IngressSpec | |
status | V1IngressStatus |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const body: k8s.V1Ingress = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createNamespacedIngress({ namespace: 'default', body });
console.log(res.metadata?.name);
Used by: NetworkingV1Api.createNamespacedIngress · NetworkingV1Api.readNamespacedIngress · NetworkingV1Api.readNamespacedIngressStatus
V1IngressBackend
- IngressBackend describes all endpoints for a given service and port.
| Property | Type | Description |
|---|---|---|
resource | V1TypedLocalObjectReference | |
service | V1IngressServiceBackend |
V1IngressClass
- IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The
ingressclass.kubernetes.io/is-default-classannotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ObjectMeta | |
spec | V1IngressClassSpec |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const body: k8s.V1IngressClass = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createIngressClass({ body });
console.log(res.metadata?.name);
Used by: NetworkingV1Api.createIngressClass · NetworkingV1Api.patchIngressClass · NetworkingV1Api.readIngressClass
V1IngressClassList
- IngressClassList is a collection of IngressClasses.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
items | V1IngressClass[] | items is the list of IngressClasses. |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ListMeta |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const res: k8s.V1IngressClassList = await api.listIngressClass({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}
Used by: NetworkingV1Api.listIngressClass
V1IngressClassParametersReference
- IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.
| Property | Type | Description |
|---|---|---|
apiGroup | string | apiGroup is the group for the resource being referenced. If APIGroup is not specified, the specified Kind must be in the core API group. For any other third-party types, APIGroup is required. |
kind | string | kind is the type of resource being referenced. |
name | string | name is the name of resource being referenced. |
namespace | string | namespace is the namespace of the resource being referenced. This field is required when scope is set to "Namespace" and must be unset when scope is set to "Cluster". |
scope | string | scope represents if this refers to a cluster or namespace scoped resource. This may be set to "Cluster" (default) or "Namespace". |
V1IngressClassSpec
- IngressClassSpec provides information about the class of an Ingress.
| Property | Type | Description |
|---|---|---|
controller | string | controller refers to the name of the controller that should handle this class. This allows for different "flavors" that are controlled by the same controller. For example, you may have different... |
parameters | V1IngressClassParametersReference |
V1IngressList
- IngressList is a collection of Ingress.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
items | V1Ingress[] | items is the list of Ingress. |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ListMeta |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const res: k8s.V1IngressList = await api.listNamespacedIngress({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}
Used by: NetworkingV1Api.listIngressForAllNamespaces · NetworkingV1Api.listNamespacedIngress
V1IngressLoadBalancerIngress
- IngressLoadBalancerIngress represents the status of a load-balancer ingress point.
| Property | Type | Description |
|---|---|---|
hostname | string | hostname is set for load-balancer ingress points that are DNS based. |
ip | string | ip is set for load-balancer ingress points that are IP based. |
ports | V1IngressPortStatus[] | ports provides information about the ports exposed by this LoadBalancer. |
V1IngressLoadBalancerStatus
- IngressLoadBalancerStatus represents the status of a load-balancer.
| Property | Type | Description |
|---|---|---|
ingress | V1IngressLoadBalancerIngress[] | ingress is a list containing ingress points for the load-balancer. |
V1IngressPortStatus
- IngressPortStatus represents the error condition of a service port
| Property | Type | Description |
|---|---|---|
error | string | error is to record the problem with the service port The format of the error shall comply with the following rules: - built-in error values shall be specified in this file and those shall use ... |
port | number | port is the port number of the ingress port. |
protocol | string | protocol is the protocol of the ingress port. The supported values are: "TCP", "UDP", "SCTP" |
V1IngressRule
- IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.
| Property | Type | Description |
|---|---|---|
host | string | host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in RFC 3986: 1. IPs are not allowed.... |
http | V1HTTPIngressRuleValue |
V1IngressServiceBackend
- IngressServiceBackend references a Kubernetes Service as a Backend.
| Property | Type | Description |
|---|---|---|
name | string | name is the referenced service. The service must exist in the same namespace as the Ingress object. |
port | V1ServiceBackendPort |
V1IngressSpec
- IngressSpec describes the Ingress the user wishes to exist.
| Property | Type | Description |
|---|---|---|
ingressClassName | string | ingressClassName is the name of an IngressClass cluster resource. Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive... |
rules | V1IngressRule[] | rules is a list of host rules used to configure the Ingress. If unspecified, or no rule matches, all traffic is sent to the default backend. |
tls | V1IngressTLS[] | tls represents the TLS configuration. Currently the Ingress only supports a single TLS port, 443. If multiple members of this list specify different hosts, they will be multiplexed on the same port... |
defaultBackend | V1IngressBackend |
V1IngressStatus
- IngressStatus describe the current state of the Ingress.
| Property | Type | Description |
|---|---|---|
loadBalancer | V1IngressLoadBalancerStatus |
V1IngressTLS
- IngressTLS describes the transport layer security associated with an ingress.
| Property | Type | Description |
|---|---|---|
hosts | string[] | hosts is a list of hosts included in the TLS certificate. The values in this list must match the name/s used in the tlsSecret. Defaults to the wildcard host setting for the loadbalancer controller... |
secretName | string | secretName is the name of the secret used to terminate TLS traffic on port 443. Field is left optional to allow TLS routing based on SNI hostname alone. If the SNI host in a listener conflicts with... |
V1NetworkPolicy
- NetworkPolicy describes what network traffic is allowed for a set of Pods
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ObjectMeta | |
spec | V1NetworkPolicySpec |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const body: k8s.V1NetworkPolicy = {
metadata: { name: 'example' },
spec: { /* ... */ },
};
const res = await api.createNamespacedNetworkPolicy({ namespace: 'default', body });
console.log(res.metadata?.name);
Used by: NetworkingV1Api.createNamespacedNetworkPolicy · NetworkingV1Api.patchNamespacedNetworkPolicy · NetworkingV1Api.readNamespacedNetworkPolicy
V1NetworkPolicyEgressRule
- NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec's podSelector. The traffic must match both ports and to. This type is beta-level in 1.8
| Property | Type | Description |
|---|---|---|
ports | V1NetworkPolicyPort[] | ports is a list of destination ports for outgoing traffic. 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... |
to | V1NetworkPolicyPeer[] | to is a list of destinations for outgoing traffic of 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... |
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.
| Property | Type | Description |
|---|---|---|
_from | V1NetworkPolicyPeer[] | 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... |
ports | V1NetworkPolicyPort[] | 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... |
V1NetworkPolicyList
- NetworkPolicyList is a list of NetworkPolicy objects.
| Property | Type | Description |
|---|---|---|
apiVersion | string | APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info:... |
items | V1NetworkPolicy[] | items is a list of schema objects. |
kind | string | Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info:... |
metadata | V1ListMeta |
Example
import * as k8s from '@kubernetes/client-node';
const kc = new k8s.KubeConfig();
kc.loadFromDefault();
const api = kc.makeApiClient(k8s.NetworkingV1Api);
const res: k8s.V1NetworkPolicyList = await api.listNamespacedNetworkPolicy({ namespace: 'default' });
for (const item of res.items) {
console.log(item.metadata?.name);
}
Used by: NetworkingV1Api.listNamespacedNetworkPolicy · NetworkingV1Api.listNetworkPolicyForAllNamespaces
V1NetworkPolicyPeer
- NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed
| Property | Type | Description |
|---|---|---|
ipBlock | V1IPBlock | |
namespaceSelector | V1LabelSelector | |
podSelector | V1LabelSelector |
V1NetworkPolicyPort
- NetworkPolicyPort describes a port to allow traffic on
| Property | Type | Description |
|---|---|---|
endPort | number | endPort indicates that the range of ports from port to endPort if set, inclusive, should be allowed by the policy. This field cannot be defined if the port field is not defined or if the port field... |
port | IntOrString | IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a... |
protocol | string | protocol represents the protocol (TCP, UDP, or SCTP) which traffic must match. If not specified, this field defaults to TCP. |
V1NetworkPolicySpec
- NetworkPolicySpec provides the specification of a NetworkPolicy
| Property | Type | Description |
|---|---|---|
egress | V1NetworkPolicyEgressRule[] | 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),... |
ingress | V1NetworkPolicyIngressRule[] | 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),... |
policyTypes | string[] | 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... |
podSelector | V1LabelSelector |