[][src]Struct fluvio_cluster::ClusterInstallerBuilder

pub struct ClusterInstallerBuilder { /* fields omitted */ }

A builder for cluster installation options

Implementations

impl ClusterInstallerBuilder[src]

pub fn build(self) -> Result<ClusterInstaller, ClusterError>[src]

Creates a ClusterInstaller with the current configuration.

This may fail if there is a problem conencting to Kubernetes or finding the helm executable on the local system.

Example

The simplest flow to create a ClusterInstaller looks like the following:

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .build()
    .expect("should create ClusterInstaller");

pub fn with_namespace<S: Into<String>>(self, namespace: S) -> Self[src]

Sets the Kubernetes namespace to install Fluvio into.

The default namespace is "default".

pub fn with_image_tag<S: Into<String>>(self, image_tag: S) -> Self[src]

Sets the docker image tag of the Fluvio image to install.

If this is not specified, the installer will use the chart version as the image tag. This should correspond to the image tags of the official published Fluvio images.

Example

Suppose you would like to install version 0.6.0 of Fluvio from Docker Hub, where the image is tagged as infinyon/fluvio:0.6.0. You can do that like this:

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_image_tag("0.6.0")
    .build()
    .unwrap();

pub fn with_image_registry<S: Into<String>>(self, image_registry: S) -> Self[src]

Sets the docker image registry to use to download Fluvio images.

This defaults to infinyon to pull from Infinyon's official Docker Hub registry. This can be used to specify a private registry or a local registry as a source of Fluvio images.

Example

You can create a local Docker registry to publish images to during development. Suppose you have a local registry running such as the following:

docker run -d -p 5000:5000 --restart=always --name registry registry:2

Suppose you tagged your image as infinyon/fluvio:0.1.0 and pushed it to your localhost:5000 registry. Your image is now located at localhost:5000/infinyon. You can specify that to the installer like so:

NOTE: See with_image_tag to see how to specify the 0.1.0 shown here.

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_image_registry("localhost:5000/infinyon")
    .build()
    .unwrap();

Then, when you use installer.install_fluvio(), it will pull the images from your local docker registry.

pub fn with_chart_version<S: Into<String>>(self, chart_version: S) -> Self[src]

Sets a specific version of the Fluvio helm chart to install.

When working with published Fluvio images, the chart version will appear to be a Semver version, such as 0.6.0.

When developing for Fluvio, chart versions are named after the git hash of the revision a chart was built on.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_chart_version("0.6.0")
    .build()
    .unwrap();

pub fn with_local_chart<S: Into<PathBuf>>(self, local_chart_location: S) -> Self[src]

Sets a local helm chart location to search for Fluvio charts.

This is often desirable when developing for Fluvio locally and making edits to the chart. When using this option, the argument is expected to be a local filesystem path.

This option is mutually exclusive from with_remote_chart; if both are used, the latest one defined is the one that's used.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_local_chart("./k8-util/helm/fluvio-app")
    .build()
    .unwrap();

pub fn with_remote_chart<S: Into<String>>(
    self,
    remote_chart_location: S
) -> Self
[src]

Sets a remote helm chart location to search for Fluvio charts.

This is the default case, with the default location being https://charts.fluvio.io, where official Fluvio helm charts are located. Remote helm charts are expected to be a valid URL.

This option is mutually exclusive from with_local_chart; if both are used, the latest one defined is the one that's used.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_remote_chart("https://charts.fluvio.io")
    .build()
    .unwrap();

pub fn with_group_name<S: Into<String>>(self, group_name: S) -> Self[src]

Sets a custom SPU group name. The default is main.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_group_name("orange")
    .build()
    .unwrap();

pub fn with_save_profile(self, save_profile: bool) -> Self[src]

Whether to save a profile of this installation to ~/.fluvio/config. Defaults to false.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_save_profile(true)
    .build()
    .unwrap();

pub fn with_spu_replicas(self, spu_replicas: u16) -> Self[src]

Sets the number of SPU replicas that should be provisioned. Defaults to 1.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_spu_replicas(2)
    .build()
    .unwrap();

pub fn with_rust_log<S: Into<String>>(self, rust_log: S) -> Self[src]

Sets the RUST_LOG environment variable for the installation.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_rust_log("debug")
    .build()
    .unwrap();

pub fn with_tls<C: Into<TlsPolicy>, S: Into<TlsPolicy>>(
    self,
    client: C,
    server: S
) -> Self
[src]

Sets the TLS Policy that the client and server will use to communicate.

By default, these are set to TlsPolicy::Disabled.

Example

use std::path::PathBuf;
use fluvio::config::TlsPaths;
use fluvio_cluster::ClusterInstaller;

let cert_path = PathBuf::from("/tmp/certs");
let client = TlsPaths {
    domain: "fluvio.io".to_string(),
    ca_cert: cert_path.join("ca.crt"),
    cert: cert_path.join("client.crt"),
    key: cert_path.join("client.key"),
};
let server = TlsPaths {
    domain: "fluvio.io".to_string(),
    ca_cert: cert_path.join("ca.crt"),
    cert: cert_path.join("server.crt"),
    key: cert_path.join("server.key"),
};

let installer = ClusterInstaller::new()
    .with_tls(client, server)
    .build()
    .unwrap();

pub fn with_cloud<S: Into<String>>(self, cloud: S) -> Self[src]

Sets the K8 cluster cloud environment.

Example

use fluvio_cluster::ClusterInstaller;
let installer = ClusterInstaller::new()
    .with_cloud("minikube")
    .build()
    .unwrap();

Trait Implementations

impl Debug for ClusterInstallerBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]