package kubecaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Network_policy_spec provides the specification of a Network_policy

type t
val to_yojson : t -> Yojson.Safe.t

List of egress rules to be applied to the selected pods. Outgoing traffic is allowed if there are no Network_policies selecting the pod (and cluster policy otherwise allows the traffic), Or if the traffic matches at least one egress rule across all of the Network_policy objects whose pod_selector matches the pod. If this field is empty then this Network_policy limits all outgoing traffic (and serves solely to ensure that the pods it selects are isolated by default). This field is beta_level in 1.8

List of ingress rules to be applied to the selected pods. Traffic is allowed to a pod if there are no Network_policies selecting the pod (and cluster policy otherwise allows the traffic), Or if the traffic source is the pod's local node, Or if the traffic matches at least one ingress rule across all of the Network_policy objects whose pod_selector matches the pod. If this field is empty then this Network_policy does not allow any traffic (and serves solely to ensure that the pods it selects are isolated by default)

Selects the pods to which this Network_policy object applies. The array of ingress rules is applied to any pods selected by this field. Multiple network policies can select the same set of pods. In this case, the ingress rules for each are combined additively. This field is Not optional and follows standard label selector semantics. An empty pod_selector matches all pods in this namespace.

val policy_types : t -> string list option

List of rule types that the Network_policy relates to. Valid options are Ingress, Egress, or Ingress,egress. If this field is not specified, it will default based on the existence of Ingress or Egress rules; policies that contain an Egress section are assumed to affect Egress, and all policies (whether or not they contain an Ingress section) are assumed to affect Ingress. If you want to write an egress_only policy, you must explicitly specify policy_types [ "egress" ]. Likewise, if you want to write a policy that specifies that no egress is allowed, you must specify a policy_types value that include "egress" (since such a policy would not include an Egress section and would otherwise default to just [ "ingress" ]). This field is beta_level in 1.8

module Object : Object.S with type value := t
OCaml

Innovation. Community. Security.