ServiceExt

Trait ServiceExt 

Source
pub trait ServiceExt: ResourceBuilder {
    const EXTERNAL_NAME: &str = "ExternalName";
    const CLUSTER_IP: &str = "ClusterIP";
    const NODE_PORT: &str = "NodePort";
    const LOAD_BALANCER: &str = "LoadBalancer";

    // Required methods
    fn new(name: impl ToString) -> Self;
    fn cluster_ip(
        name: impl ToString,
        ports: impl IntoIterator<Item = ServicePort>,
    ) -> Self;
    fn headless(
        name: impl ToString,
        ports: impl IntoIterator<Item = ServicePort>,
    ) -> Self;
    fn node_port(name: impl ToString) -> Self;
    fn load_balancer(name: impl ToString) -> Self;
    fn external_name(name: impl ToString, external_name: impl ToString) -> Self;
    fn with_labels(
        name: impl ToString,
        labels: impl IntoIterator<Item = (impl ToString, impl ToString)>,
    ) -> Self;
    fn spec(self, spec: ServiceSpec) -> Self;
    fn selector(
        self,
        match_labels: impl IntoIterator<Item = (impl ToString, impl ToString)>,
    ) -> Self;
}

Provided Associated Constants§

Source

const EXTERNAL_NAME: &str = "ExternalName"

Source

const CLUSTER_IP: &str = "ClusterIP"

Source

const NODE_PORT: &str = "NodePort"

Source

const LOAD_BALANCER: &str = "LoadBalancer"

Required Methods§

Source

fn new(name: impl ToString) -> Self

Source

fn cluster_ip( name: impl ToString, ports: impl IntoIterator<Item = ServicePort>, ) -> Self

Create new “ClusterIP” service

Source

fn headless( name: impl ToString, ports: impl IntoIterator<Item = ServicePort>, ) -> Self

Create new “ClusterIP” service with spec.cluster_ip set to “None”

Source

fn node_port(name: impl ToString) -> Self

Create new “NodePort” service

Source

fn load_balancer(name: impl ToString) -> Self

Create new “LoadBalancer” service

Source

fn external_name(name: impl ToString, external_name: impl ToString) -> Self

Create new “ExternalName” service

Source

fn with_labels( name: impl ToString, labels: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self

Source

fn spec(self, spec: ServiceSpec) -> Self

Source

fn selector( self, match_labels: impl IntoIterator<Item = (impl ToString, impl ToString)>, ) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§