forked from kubernetes/ingress-gce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
127 lines (107 loc) · 4.75 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:openapi-gen=true
type BackendConfig struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec BackendConfigSpec `json:"spec,omitempty"`
Status BackendConfigStatus `json:"status,omitempty"`
}
// BackendConfigSpec is the spec for a BackendConfig resource
// +k8s:openapi-gen=true
type BackendConfigSpec struct {
Iap *IAPConfig `json:"iap,omitempty"`
Cdn *CDNConfig `json:"cdn,omitempty"`
SecurityPolicy *SecurityPolicyConfig `json:"securityPolicy,omitempty"`
TimeoutSec *int64 `json:"timeoutSec,omitempty"`
ConnectionDraining *ConnectionDrainingConfig `json:"connectionDraining,omitempty"`
SessionAffinity *SessionAffinityConfig `json:"sessionAffinity,omitempty"`
}
// BackendConfigStatus is the status for a BackendConfig resource
type BackendConfigStatus struct {
}
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// BackendConfigList is a list of BackendConfig resources
type BackendConfigList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata"`
Items []BackendConfig `json:"items"`
}
// IAPConfig contains configuration for IAP-enabled backends.
// +k8s:openapi-gen=true
type IAPConfig struct {
Enabled bool `json:"enabled"`
OAuthClientCredentials *OAuthClientCredentials `json:"oauthclientCredentials"`
}
// OAuthClientCredentials contains credentials for a single IAP-enabled backend.
// +k8s:openapi-gen=true
type OAuthClientCredentials struct {
// The name of a k8s secret which stores the OAuth client id & secret.
SecretName string `json:"secretName"`
// Direct reference to OAuth client id.
ClientID string `json:"clientID,omitempty"`
// Direct reference to OAuth client secret.
ClientSecret string `json:"clientSecret,omitempty"`
}
// CDNConfig contains configuration for CDN-enabled backends.
// +k8s:openapi-gen=true
type CDNConfig struct {
Enabled bool `json:"enabled"`
CachePolicy *CacheKeyPolicy `json:"cachePolicy,omitempty"`
}
// CacheKeyPolicy contains configuration for how requests to a CDN-enabled backend are cached.
// +k8s:openapi-gen=true
type CacheKeyPolicy struct {
// If true, requests to different hosts will be cached separately.
IncludeHost bool `json:"includeHost,omitempty"`
// If true, http and https requests will be cached separately.
IncludeProtocol bool `json:"includeProtocol,omitempty"`
// If true, query string parameters are included in the cache key
// according to QueryStringBlacklist and QueryStringWhitelist.
// If neither is set, the entire query string is included and if false
// the entire query string is excluded.
IncludeQueryString bool `json:"includeQueryString,omitempty"`
// Names of query strint parameters to exclude from cache keys. All other
// parameters are included. Either specify QueryStringBlacklist or
// QueryStringWhitelist, but not both.
QueryStringBlacklist []string `json:"queryStringBlacklist,omitempty"`
// Names of query string parameters to include in cache keys. All other
// parameters are excluded. Either specify QueryStringBlacklist or
// QueryStringWhitelist, but not both.
QueryStringWhitelist []string `json:"queryStringWhitelist,omitempty"`
}
// SecurityPolicyConfig contains configuration for CloudArmor-enabled backends.
type SecurityPolicyConfig struct {
// Name of the security policy that should be associated.
Name string `json:"name"`
}
// ConnectionDrainingConfig contains configuration for connection draining.
// For now the draining timeout. May manage more settings in the future.
// +k8s:openapi-gen=true
type ConnectionDrainingConfig struct {
// Draining timeout in seconds.
DrainingTimeoutSec int64 `json:"drainingTimeoutSec,omitempty"`
}
// SessionAffinityConfig contains configuration for stickyness parameters.
// +k8s:openapi-gen=true
type SessionAffinityConfig struct {
AffinityType string `json:"affinityType,omitempty"`
AffinityCookieTtlSec *int64 `json:"affinityCookieTtlSec,omitempty"`
}