This topic tells you how to use Availability Targets on Tanzu Platform for Kubernetes.
Availability Targets are groupings of clusters that define where applications are scheduled. With Availability Targets, platform teams can abstract sets of clusters into logical groups that provide compute capacity without requiring their developers to know exactly which cluster their workload cluster is running on.
Clusters are automatically matched to the Availability Target based on rules and labels defined in the Availability Target. The best practice is to use cluster labels that match the label selectors for an Availability Target.
To create an Availability Target:
Click Create Availability Targets > Step by Step.
Create a YAML file (example name: availabilitytarget.yaml
) and include the following:
apiVersion: spaces.tanzu.vmware.com/v1alpha1
kind: AvailabilityTarget
metadata:
name: example-at
description: "Availability Target example"
namespace: default
spec:
affinity:
clusterAffinity:
clusterSelectorTerms:
- matchExpressions:
- key: topology.kubernetes.io/region
operator: In
values:
- <cluster-region>
Flag | Description |
---|---|
name |
The name of the Availability Target. Names must be unique within the Project. |
description |
A human-readable description to provide additional information about the Availability Target. |
key |
A Kubernetes-compliant label name. The key must match the label on the clusters. |
operator |
The matching rule to use to define inclusion or exclusion criteria for clusters in the Availability Target. Acceptable values are In , Not In , Exists , Does Not Exist . If using Exists or Does Not Exist , the values field is not required. |
values |
A comma-separated list of values that are compared to the key to determine Availability Target cluster membership. |
Run the following Tanzu CLI command:
tanzu availability-target create -f availabilitytarget.yaml