Global Server Load Balancing (Extension)
The Global Server Load Balancing extension adds support for Cue templates to access the primaryGeoTag through the context object.
Prerequisites
- A ConfigMap named k8gb-config must be present in the hub cluster with the key-value pair
primaryGeoTagset to the primary geo tag. The configMap must be in thek8gbnamespace.
Example Usage
The example below shows how to create a ConfigMap using the k8s-objects component that sets the primaryGeoTag key to the value us-east-1.
apiVersion: spectrocloud.com/v1beta1
kind: WorkloadProfile
metadata:
name: palette-docs
namespace: docs-ns
spec:
workload:
components:
- name: palette-docs
type: k8s-object
properties:
objects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: k8gb-config
namespace: k8gb
data:
primaryGeoTag: 'us-east-1'
Once the ConfigMap is created, the primaryGeoTag can be accessed inside CUE templates using the context object.
tip
To learn more about CUE template context extensions, check out the Context Extensions section.
if context.primaryGeoTag != _|_ {
primaryGeoTag: context.primaryGeoTag
}
Parameters
No parameters available
Template
The following tabs display the definition's Cue template and the rendered YAML. The rendered YAML is the output of the Cue template when the definition is applied to a cluster.