Skip to main content

Global Server Load Balancing (Extension)

TypeComponent

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 primaryGeoTag set to the primary geo tag. The configMap must be in the k8gb namespace.

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.

  contextExtensionRefs:
- contextKey: primaryGeoTag
apiVersion: v1
kind: ConfigMap
name: k8gb-config
namespace: k8gb
path: .data.primaryGeoTag