@@ -109,6 +109,92 @@ spec:
109
109
otherwise the secret will be rejected as invalid.
110
110
type : string
111
111
type : object
112
+ cache :
113
+ description : The Cache Key defines a cache policy for proxy caching
114
+ properties :
115
+ allowedCodes :
116
+ description : |-
117
+ AllowedCodes defines which HTTP response codes should be cached.
118
+ Accepts either:
119
+ - The string "any" to cache all response codes (must be the only element)
120
+ - A list of HTTP status codes as integers (100-599)
121
+ Examples: ["any"], [200, 301, 404], [200].
122
+ Invalid: ["any", 200] (cannot mix "any" with specific codes).
123
+ items :
124
+ anyOf :
125
+ - type : integer
126
+ - type : string
127
+ x-kubernetes-int-or-string : true
128
+ type : array
129
+ allowedMethods :
130
+ description : |-
131
+ AllowedMethods defines which HTTP methods should be cached.
132
+ Only "GET", "HEAD", and "POST" are supported by NGINX proxy_cache_methods directive.
133
+ GET and HEAD are always cached by default even if not specified.
134
+ Maximum of 3 items allowed. Examples: ["GET"], ["GET", "HEAD", "POST"].
135
+ Invalid methods: PUT, DELETE, PATCH, etc.
136
+ items :
137
+ type : string
138
+ maxItems : 3
139
+ type : array
140
+ x-kubernetes-validations :
141
+ - message : ' allowed methods must be one of: GET, HEAD, POST'
142
+ rule : self.all(method, method in ['GET', 'HEAD', 'POST'])
143
+ cachePurgeAllow :
144
+ description : |-
145
+ CachePurgeAllow defines IP addresses or CIDR blocks allowed to purge cache.
146
+ This feature is only available in NGINX Plus.
147
+ Examples: ["192.168.1.100", "10.0.0.0/8", "::1"].
148
+ Invalid in NGINX OSS (will be ignored).
149
+ items :
150
+ type : string
151
+ type : array
152
+ cacheZoneName :
153
+ description : |-
154
+ CacheZoneName defines the name of the cache zone. Must start with a lowercase letter,
155
+ followed by alphanumeric characters or underscores, and end with an alphanumeric character.
156
+ Single lowercase letters are also allowed. Examples: "cache", "my_cache", "cache1".
157
+ pattern : ^[a-z][a-zA-Z0-9_]*[a-zA-Z0-9]$|^[a-z]$
158
+ type : string
159
+ cacheZoneSize :
160
+ description : |-
161
+ CacheZoneSize defines the size of the cache zone. Must be a number followed by a size unit:
162
+ 'k' for kilobytes, 'm' for megabytes, or 'g' for gigabytes.
163
+ Examples: "10m", "1g", "512k".
164
+ pattern : ^[0-9]+[kmg]$
165
+ type : string
166
+ levels :
167
+ description : |-
168
+ Levels defines the cache directory hierarchy levels for storing cached files.
169
+ Must be in format "X:Y" or "X:Y:Z" where X, Y, Z are either 1 or 2.
170
+ This controls the number of subdirectory levels and their name lengths.
171
+ Examples: "1:2", "2:2", "1:2:2".
172
+ Invalid: "3:1", "1:3", "1:2:3".
173
+ pattern : ^[12](?::[12]){0,2}$
174
+ type : string
175
+ overrideUpstreamCache :
176
+ default : false
177
+ description : |-
178
+ OverrideUpstreamCache controls whether to override upstream cache headers
179
+ (using proxy_ignore_headers directive). When true, NGINX will ignore
180
+ cache-related headers from upstream servers like Cache-Control, Expires, etc.
181
+ Default: false.
182
+ type : boolean
183
+ time :
184
+ description : |-
185
+ Time defines the default cache time. Required when allowedCodes is specified.
186
+ Must be a number followed by a time unit:
187
+ 's' for seconds, 'm' for minutes, 'h' for hours, 'd' for days.
188
+ Examples: "30s", "5m", "1h", "2d".
189
+ pattern : ^[0-9]+[smhd]$
190
+ type : string
191
+ required :
192
+ - cacheZoneName
193
+ - cacheZoneSize
194
+ type : object
195
+ x-kubernetes-validations :
196
+ - message : time is required when allowedCodes is specified
197
+ rule : ' !has(self.allowedCodes) || (has(self.allowedCodes) && has(self.time))'
112
198
egressMTLS :
113
199
description : The EgressMTLS policy configures upstreams authentication
114
200
and certificate verification.
0 commit comments