Skip to main content

Cluster

Flinkwerk deploys projects and related applications to Kubernetes clusters which you define in the Flinkwerk Config file.

You can use clusters available inside or outside Flinkwerk Marketplace.

You must define at least one cluster to be able to deploy Flinkwerk projects.

Use clusters from Flinkwerk Marketplace

As per the configuration schema reference, clusters are defined as either dependencies or global resources.

Here is an example to automatically purchase a cluster in Flinkwerk Marketplace as a global resource:

.flinkwerk/config.yml
global:
my-cluster:
type: cluster
sku: flinkwerk/trial

Based on this configuration, Flinkwerk will set up a cluster with the resources provided by the cluster product with the SKU flinkwerk/trial. The running cluster will have the name my-cluster.

Connect third-party clusters

Alternatively, Flinkwerk allows you to use third-party clusters for dependencies as well as global resources by providing a `kubeconfig file.

For example, define the location of your kubeconfig file in the field global.[name].kubeconfig of your project configuration as outlined below.

.flinkwerk/config.yml
global:
my-external-cluster:
type: cluster
kubeconfig: .flinkwerk/.kube/external

Flinkwerk will use the credentials provided in the kubeconfig file to connect and deploy to your third-party cluster.

Reuse clusters across your projects

A global cluster resource configuration in one project applies to all other projects owned by you. Once you define a cluster in one of your Flinkwerk projects, the cluster is available in all other projects as per its name.

note

Cluster names are unique across all projects. Thus, you can reuse the same cluster configuration in various projects. Learn more about the account scope of cluster names.

This means that you can create a dedicated Flinkwerk project which serves only to define clusters. Other projects can then reference these clusters in their environments configuration. This approach allows for a separation of concerns between different teams (e.g. developers and system administrators).

For example, you could define one cluster for all your projects' development Git branches in a dedicated project as follows.

/cluster-project/.flinkwerk/config.yaml
global:
my-development-cluster:
type: cluster
sku: their-org/their-cluster

In all other projects, you would then reference the name of the cluster, i.e. development:

/application-project/.flinkwerk/config.yaml
environments:
development:
cluster: my-development-cluster