diff --git a/api/v1alpha/location_types.go b/api/v1alpha/location_types.go
index d4da0a14..1d3917b7 100644
--- a/api/v1alpha/location_types.go
+++ b/api/v1alpha/location_types.go
@@ -35,6 +35,33 @@ type LocationSpec struct {
//
// +kubebuilder:validation:Required
Provider LocationProvider `json:"provider"`
+
+ // The geographic coordinates of the location, used by consumers that need
+ // to plot the location on a map.
+ //
+ // +kubebuilder:validation:Optional
+ Coordinates *Coordinates `json:"coordinates,omitempty"`
+}
+
+// Coordinates describes a geographic point in decimal degrees (WGS 84).
+//
+// Latitude and longitude are serialized as strings rather than floats, per
+// Kubernetes API convention (float precision/serialization varies across
+// client languages).
+type Coordinates struct {
+ // Latitude in decimal degrees, in the range [-90, 90].
+ //
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:Pattern=`^-?\d{1,2}(\.\d+)?$`
+ // +kubebuilder:validation:XValidation:message="latitude must be between -90 and 90",rule="double(self) >= -90.0 && double(self) <= 90.0"
+ Latitude string `json:"latitude"`
+
+ // Longitude in decimal degrees, in the range [-180, 180].
+ //
+ // +kubebuilder:validation:Required
+ // +kubebuilder:validation:Pattern=`^-?\d{1,3}(\.\d+)?$`
+ // +kubebuilder:validation:XValidation:message="longitude must be between -180 and 180",rule="double(self) >= -180.0 && double(self) <= 180.0"
+ Longitude string `json:"longitude"`
}
type LocationProvider struct {
diff --git a/api/v1alpha/zz_generated.deepcopy.go b/api/v1alpha/zz_generated.deepcopy.go
index e82f9295..aceb7595 100644
--- a/api/v1alpha/zz_generated.deepcopy.go
+++ b/api/v1alpha/zz_generated.deepcopy.go
@@ -90,6 +90,21 @@ func (in *ContactSet) DeepCopy() *ContactSet {
return out
}
+// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
+func (in *Coordinates) DeepCopyInto(out *Coordinates) {
+ *out = *in
+}
+
+// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Coordinates.
+func (in *Coordinates) DeepCopy() *Coordinates {
+ if in == nil {
+ return nil
+ }
+ out := new(Coordinates)
+ in.DeepCopyInto(out)
+ return out
+}
+
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DNSSECInfo) DeepCopyInto(out *DNSSECInfo) {
*out = *in
@@ -831,6 +846,11 @@ func (in *LocationSpec) DeepCopyInto(out *LocationSpec) {
}
}
in.Provider.DeepCopyInto(&out.Provider)
+ if in.Coordinates != nil {
+ in, out := &in.Coordinates, &out.Coordinates
+ *out = new(Coordinates)
+ **out = **in
+ }
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LocationSpec.
diff --git a/config/crd/bases/networking.datumapis.com_locations.yaml b/config/crd/bases/networking.datumapis.com_locations.yaml
index a107c328..a4555080 100644
--- a/config/crd/bases/networking.datumapis.com_locations.yaml
+++ b/config/crd/bases/networking.datumapis.com_locations.yaml
@@ -55,6 +55,30 @@ spec:
spec:
description: LocationSpec defines the desired state of Location.
properties:
+ coordinates:
+ description: |-
+ The geographic coordinates of the location, used by consumers that need
+ to plot the location on a map.
+ properties:
+ latitude:
+ description: Latitude in decimal degrees, in the range [-90, 90].
+ pattern: ^-?\d{1,2}(\.\d+)?$
+ type: string
+ x-kubernetes-validations:
+ - message: latitude must be between -90 and 90
+ rule: double(self) >= -90.0 && double(self) <= 90.0
+ longitude:
+ description: Longitude in decimal degrees, in the range [-180,
+ 180].
+ pattern: ^-?\d{1,3}(\.\d+)?$
+ type: string
+ x-kubernetes-validations:
+ - message: longitude must be between -180 and 180
+ rule: double(self) >= -180.0 && double(self) <= 180.0
+ required:
+ - latitude
+ - longitude
+ type: object
locationClassName:
description: "The location class that indicates control plane behavior
of entities\nassociated with the location.\n\nValid values are:\n\t-
diff --git a/docs/api/locations.md b/docs/api/locations.md
index 2f1aaf1f..217048c9 100644
--- a/docs/api/locations.md
+++ b/docs/api/locations.md
@@ -113,6 +113,14 @@ as:
- topology.datum.net/city-code
| Name | +Type | +Description | +Required | +
|---|---|---|---|
| latitude | +string | +
+ Latitude in decimal degrees, in the range [-90, 90]. + + Validations: |
+ true | +
| longitude | +string | +
+ Longitude in decimal degrees, in the range [-180, 180]. + + Validations: |
+ true | +