package kubecaml

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

Service_spec describes the attributes that a user creates on a service.

type t
val to_yojson : t -> Yojson.Safe.t
val make : ?type_:string -> ?session_affinity_config: Kubernetes.Definitions.Api.Core.V1.Session_affinity_config.t -> ?session_affinity:string -> ?selector:Object.Of_strings.t -> ?publish_not_ready_addresses:bool -> ?ports:Kubernetes.Definitions.Api.Core.V1.Service_port.t list -> ?load_balancer_source_ranges:string list -> ?load_balancer_ip:string -> ?health_check_node_port:int -> ?external_traffic_policy:string -> ?external_name:string -> ?external_ips:string list -> ?cluster_ip:string -> unit -> t
val cluster_ip : t -> string option

cluster_ip is the Ip address of the service and is usually assigned randomly by the master. If an address is specified manually and is not in use by others, it will be allocated to the service; otherwise, creation of the service will fail. This field can not be changed through updates. Valid values are "none", empty string (""), or a valid Ip address. "none" can be specified for headless services when proxying is not required. Only applies to types Cluster_ip, Node_port, and Load_balancer. Ignored if type is External_name. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

val external_ips : t -> string list option

external_ips is a list of Ip addresses for which nodes in the cluster will also accept traffic for this service. These Ips are not managed by Kubernetes. The user is responsible for ensuring that traffic arrives at a node with this Ip. A common example is external load_balancers that are not part of the Kubernetes system.

val external_name : t -> string option

external_name is the external reference that kubedns or equivalent will return as a Cname record for this service. No proxying will be involved. Must be a valid Rfc_1123 hostname (https://tools.ietf.org/html/rfc1123) and requires Type to be External_name.

val external_traffic_policy : t -> string option

external_traffic_policy denotes if this Service desires to route external traffic to node_local or cluster_wide endpoints. "local" preserves the client source Ip and avoids a second hop for Load_balancer and Nodeport type services, but risks potentially imbalanced traffic spreading. "cluster" obscures the client source Ip and may cause a second hop to another node, but should have good overall load_spreading.

val health_check_node_port : t -> int option

health_check_node_port specifies the healthcheck node_port for the service. If not specified, Health_check_node_port is created by the service api backend with the allocated node_port. Will use user_specified node_port value if specified by the client. Only effects when Type is set to Load_balancer and External_traffic_policy is set to Local.

val load_balancer_ip : t -> string option

Only applies to Service Type: Load_balancer Load_balancer will get created with the Ip specified in this field. This feature depends on whether the underlying cloud_provider supports specifying the load_balancer_ip when a load balancer is created. This field will be ignored if the cloud_provider does not support the feature.

val load_balancer_source_ranges : t -> string list option

If specified and supported by the platform, this will restrict traffic through the cloud_provider load_balancer will be restricted to the specified client Ips. This field will be ignored if the cloud_provider does not support the feature. More info: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/

The list of ports that are exposed by this service. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

val publish_not_ready_addresses : t -> bool option

publish_not_ready_addresses, when set to true, indicates that Dns implementations must publish the not_ready_addresses of subsets for the Endpoints associated with the Service. The default value is false. The primary use case for setting this field is to use a Stateful_set's Headless Service to propagate Srv records for its Pods without respect to their readiness for purpose of peer discovery. This field will replace the service.alpha.kubernetes.io/tolerate_unready_endpoints when that annotation is deprecated and all clients have been converted to use this field.

val selector : t -> Object.Of_strings.t option

Route service traffic to pods with label keys and values matching this selector. If empty or not present, the service is assumed to have an external process managing its endpoints, which Kubernetes will not modify. Only applies to types Cluster_ip, Node_port, and Load_balancer. Ignored if type is External_name. More info: https://kubernetes.io/docs/concepts/services-networking/service/

val session_affinity : t -> string option

Supports "client_ip" and "none". Used to maintain session affinity. Enable client Ip based session affinity. Must be Client_ip or None. Defaults to None. More info: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies

val session_affinity_config : t -> Kubernetes.Definitions.Api.Core.V1.Session_affinity_config.t option

session_affinity_config contains the configurations of session affinity.

val type_ : t -> string option

type determines how the Service is exposed. Defaults to Cluster_ip. Valid options are External_name, Cluster_ip, Node_port, and Load_balancer. "external_name" maps to the specified external_name. "cluster_ip" allocates a cluster_internal Ip address for load_balancing to endpoints. Endpoints are determined by the selector or if that is not specified, by manual construction of an Endpoints object. If cluster_ip is "none", no virtual Ip is allocated and the endpoints are published as a set of endpoints rather than a stable Ip. "node_port" builds on Cluster_ip and allocates a port on every node which routes to the cluster_ip. "load_balancer" builds on Node_port and creates an external load_balancer (if supported in the current cloud) which routes to the cluster_ip. More info: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types

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

Innovation. Community. Security.