1
1
package v1
2
2
3
3
import (
4
+ v1 "github.com/fluxcd/flagger/pkg/apis/gloo/gateway/v1"
4
5
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
5
6
)
6
7
@@ -16,7 +17,14 @@ type Upstream struct {
16
17
}
17
18
18
19
type UpstreamSpec struct {
19
- Kube KubeUpstream `json:"kube,omitempty"`
20
+ Kube * KubeUpstream `json:"kube,omitempty"`
21
+ SslConfig * UpstreamSslConfig `json:"sslConfig,omitempty"`
22
+ CircuitBreakers * CircuitBreakerConfig `json:"circuitBreakers,omitempty"`
23
+ ConnectionConfig * ConnectionConfig `json:"connectionConfig,omitempty"`
24
+ UseHttp2 bool `json:"useHttp2,omitempty"`
25
+ InitialStreamWindowSize uint32 `json:"initialStreamWindowSize,omitempty"`
26
+ InitialConnectionWindowSize uint32 `json:"initialConnectionWindowSize,omitempty"`
27
+ HttpProxyHostname string `json:"httpProxyHostName,omitempty"`
20
28
}
21
29
22
30
type KubeUpstream struct {
@@ -26,6 +34,85 @@ type KubeUpstream struct {
26
34
Selector map [string ]string `json:"selector,omitempty"`
27
35
}
28
36
37
+ type UpstreamSslConfig struct {
38
+ Sni string `json:"sni,omitempty"`
39
+ VerifySubjectAltName []string `json:"verifySubjectAltName,omitempty"`
40
+ Parameters * SslParameters `json:"parameters,omitempty"`
41
+ AlpnProtocols []string `json:"alpnProtocols,omitempty"`
42
+
43
+ /** SSLSecrets -- only one of these should be set */
44
+ * UpstreamSslConfig_Sds `json:"sds,omitempty"`
45
+ SecretRef * v1.ResourceRef `json:"secretRef,omitempty"`
46
+ * UpstreamSslConfig_SslFiles `json:"sslFiles,omitempty"`
47
+ }
48
+
49
+ // SSLFiles reference paths to certificates which can be read by the proxy off of its local filesystem
50
+ type UpstreamSslConfig_SslFiles struct {
51
+ TlsCert string `json:"tlsCert,omitempty"`
52
+ TlsKey string `json:"tlsKey,omitempty"`
53
+ RootCa string `json:"rootCa,omitempty"`
54
+ }
55
+
56
+ // Use secret discovery service.
57
+ type UpstreamSslConfig_Sds struct {
58
+ TargetUri string `json:"targetUri,omitempty"`
59
+ CertificatesSecretName string `json:"certificatesSecretName,omitempty"`
60
+ ValidationContextName string `json:"validationContextName,omitempty"`
61
+
62
+ /** SDSBuilder -- onle one of the following can be set */
63
+ CallCredentials * CallCredentials `json:"callCredentials,omitempty"`
64
+ ClusterName string `json:"clusterName,omitempty"`
65
+ }
66
+
67
+ type CallCredentials struct {
68
+ FileCredentialSource * CallCredentials_FileCredentialSource `json:"fileCredentialSource,omitempty"`
69
+ }
70
+
71
+ type CallCredentials_FileCredentialSource struct {
72
+ TokenFileName string `json:"tokenFileName,omitempty"`
73
+ Header string `json:"header,omitempty"`
74
+ }
75
+
76
+ type SslParameters struct {
77
+ MinimumProtocolVersion int32 `json:"minimumProtocolVersion,omitempty"`
78
+ MaximumProtocolVersion int32 `json:"maximumProtocolVersion,omitempty"`
79
+ CipherSuites []string `json:"cipherSuites,omitempty"`
80
+ EcdhCurves []string `json:"ecdhCurves,omitempty"`
81
+ }
82
+
83
+ type CircuitBreakerConfig struct {
84
+ MaxConnections uint32 `json:"maxConnections,omitempty"`
85
+ MaxPendingRequests uint32 `json:"maxPendingRequests,omitempty"`
86
+ MaxRequests uint32 `json:"maxRequests,omitempty"`
87
+ MaxRetries uint32 `json:"maxRetries,omitempty"`
88
+ }
89
+
90
+ type ConnectionConfig struct {
91
+ MaxRequestsPerConnection uint32 `json:"maxRequestsPerConnection,omitempty"`
92
+ ConnectTimeout * Duration `json:"connectTimeout,omitempty"`
93
+ TcpKeepalive * ConnectionConfig_TcpKeepAlive `json:"tcpKeepalive,omitempty"`
94
+ PerConnectionBufferLimitBytes uint32 `json:"perConnectionBufferLimitBytes,omitempty"`
95
+ CommonHttpProtocolOptions * ConnectionConfig_HttpProtocolOptions `json:"commonHttpProtocolOptions,omitempty"`
96
+ }
97
+
98
+ type ConnectionConfig_TcpKeepAlive struct {
99
+ KeepaliveProbes uint32 `json:"keepaliveProbes,omitempty"`
100
+ KeepaliveTime * Duration `json:"keepaliveTime,omitempty"`
101
+ KeepaliveInterval * Duration `json:"keepaliveInterval,omitempty"`
102
+ }
103
+
104
+ type ConnectionConfig_HttpProtocolOptions struct {
105
+ IdleTimeout * Duration `json:"idleTimeout,omitempty"`
106
+ MaxHeadersCount uint32 `json:"maxHeadersCount,omitempty"`
107
+ MaxStreamDuration * Duration `json:"maxStreamDuration,omitempty"`
108
+ HeadersWithUnderscoresAction uint32 `json:"headersWithUnderscoresAction,omitempty"`
109
+ }
110
+
111
+ type Duration struct {
112
+ Seconds int64 `json:"seconds,omitempty"`
113
+ Nanos int32 `json:"nanos,omitempty"`
114
+ }
115
+
29
116
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
30
117
31
118
// UpstreamList is a list of Upstream resources
0 commit comments