You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v1alpha1/envoygateway_types.go
+27-1Lines changed: 27 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
package v1alpha1
7
7
8
8
import (
9
+
corev1 "k8s.io/api/core/v1"
9
10
"k8s.io/apimachinery/pkg/api/resource"
10
11
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11
12
gwapiv1 "sigs.k8s.io/gateway-api/apis/v1"
@@ -682,17 +683,42 @@ type RedisTLSSettings struct {
682
683
}
683
684
684
685
// RateLimitRedisSettings defines the configuration for connecting to redis database.
686
+
// +kubebuilder:validation:XValidation:rule="has(self.url) != has(self.urlRef)",message="exactly one of url or urlRef must be set"
685
687
typeRateLimitRedisSettingsstruct {
686
688
// URL of the Redis Database.
687
689
// This can reference a single Redis host or a comma delimited list for Sentinel and Cluster deployments of Redis.
688
-
URLstring`json:"url"`
690
+
// Mutually exclusive with URLRef.
691
+
//
692
+
// +optional
693
+
URLstring`json:"url,omitempty"`
694
+
695
+
// URLRef sources the Redis URL from a Kubernetes Secret key. Use this for GitOps
696
+
// flows where the Redis endpoint is provisioned by an external controller.
697
+
// The referenced Secret must exist in the namespace of the Envoy Gateway rate limit
698
+
// deployment. Mutually exclusive with URL.
699
+
//
700
+
// +optional
701
+
URLRef*RedisURLSource`json:"urlRef,omitempty"`
689
702
690
703
// TLS defines TLS configuration for connecting to redis database.
691
704
//
692
705
// +optional
693
706
TLS*RedisTLSSettings`json:"tls,omitempty"`
694
707
}
695
708
709
+
// RedisURLSource specifies where to source the Redis URL from.
710
+
// +kubebuilder:validation:XValidation:rule="!has(self.secretKeyRef.optional) || !self.secretKeyRef.optional",message="urlRef.secretKeyRef.optional must not be true; the Secret is required"
711
+
typeRedisURLSourcestruct {
712
+
// SecretKeyRef references the Secret and key that hold the Redis URL.
713
+
// The Secret must be in the same namespace as the Envoy Gateway rate limit deployment.
714
+
// The reference is always required: optional must not be set to true, otherwise
715
+
// the rate limit pod could start with an unset REDIS_URL instead of waiting for
0 commit comments