Skip to main content

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

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
kindstringKind 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:...
metadataV1ObjectMeta
specV1IPAddressSpec

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.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
itemsV1IPAddress[]items is the list of IPAddresses.
kindstringKind 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:...
metadataV1ListMeta

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.

Source

PropertyTypeDescription
parentRefV1ParentReference

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.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
kindstringKind 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:...
metadataV1ObjectMeta
specV1IngressSpec
statusV1IngressStatus

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.

Source

PropertyTypeDescription
resourceV1TypedLocalObjectReference
serviceV1IngressServiceBackend

V1IngressClass

  • IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The ingressclass.kubernetes.io/is-default-class annotation 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.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
kindstringKind 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:...
metadataV1ObjectMeta
specV1IngressClassSpec

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.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
itemsV1IngressClass[]items is the list of IngressClasses.
kindstringKind 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:...
metadataV1ListMeta

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.

Source

PropertyTypeDescription
apiGroupstringapiGroup 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.
kindstringkind is the type of resource being referenced.
namestringname is the name of resource being referenced.
namespacestringnamespace 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".
scopestringscope 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.

Source

PropertyTypeDescription
controllerstringcontroller 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...
parametersV1IngressClassParametersReference

V1IngressList

  • IngressList is a collection of Ingress.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
itemsV1Ingress[]items is the list of Ingress.
kindstringKind 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:...
metadataV1ListMeta

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.

Source

PropertyTypeDescription
hostnamestringhostname is set for load-balancer ingress points that are DNS based.
ipstringip is set for load-balancer ingress points that are IP based.
portsV1IngressPortStatus[]ports provides information about the ports exposed by this LoadBalancer.

V1IngressLoadBalancerStatus

  • IngressLoadBalancerStatus represents the status of a load-balancer.

Source

PropertyTypeDescription
ingressV1IngressLoadBalancerIngress[]ingress is a list containing ingress points for the load-balancer.

V1IngressPortStatus

  • IngressPortStatus represents the error condition of a service port

Source

PropertyTypeDescription
errorstringerror 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 ...
portnumberport is the port number of the ingress port.
protocolstringprotocol 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.

Source

PropertyTypeDescription
hoststringhost 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....
httpV1HTTPIngressRuleValue

V1IngressServiceBackend

  • IngressServiceBackend references a Kubernetes Service as a Backend.

Source

PropertyTypeDescription
namestringname is the referenced service. The service must exist in the same namespace as the Ingress object.
portV1ServiceBackendPort

V1IngressSpec

  • IngressSpec describes the Ingress the user wishes to exist.

Source

PropertyTypeDescription
ingressClassNamestringingressClassName 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...
rulesV1IngressRule[]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.
tlsV1IngressTLS[]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...
defaultBackendV1IngressBackend

V1IngressStatus

  • IngressStatus describe the current state of the Ingress.

Source

PropertyTypeDescription
loadBalancerV1IngressLoadBalancerStatus

V1IngressTLS

  • IngressTLS describes the transport layer security associated with an ingress.

Source

PropertyTypeDescription
hostsstring[]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...
secretNamestringsecretName 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

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
kindstringKind 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:...
metadataV1ObjectMeta
specV1NetworkPolicySpec

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

Source

PropertyTypeDescription
portsV1NetworkPolicyPort[]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...
toV1NetworkPolicyPeer[]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.

Source

PropertyTypeDescription
_fromV1NetworkPolicyPeer[]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...
portsV1NetworkPolicyPort[]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.

Source

PropertyTypeDescription
apiVersionstringAPIVersion 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:...
itemsV1NetworkPolicy[]items is a list of schema objects.
kindstringKind 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:...
metadataV1ListMeta

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

Source

PropertyTypeDescription
ipBlockV1IPBlock
namespaceSelectorV1LabelSelector
podSelectorV1LabelSelector

V1NetworkPolicyPort

  • NetworkPolicyPort describes a port to allow traffic on

Source

PropertyTypeDescription
endPortnumberendPort 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...
portIntOrStringIntOrString 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...
protocolstringprotocol 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

Source

PropertyTypeDescription
egressV1NetworkPolicyEgressRule[]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),...
ingressV1NetworkPolicyIngressRule[]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),...
policyTypesstring[]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...
podSelectorV1LabelSelector