Skip to content

Commit 66e1ba6

Browse files
committed
K8SPG-873: add env and envFrom fields to backups and restores
https://perconadev.atlassian.net/browse/K8SPG-873
1 parent 71d50b6 commit 66e1ba6

21 files changed

+8644
-227
lines changed

build/crd/crunchy/generated/postgres-operator.crunchydata.com_postgresclusters.yaml

Lines changed: 672 additions & 49 deletions
Large diffs are not rendered by default.

build/crd/percona/generated/pgv2.percona.com_perconapgbackups.yaml

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,212 @@ spec:
7070
type: object
7171
spec:
7272
properties:
73+
containerOptions:
74+
properties:
75+
env:
76+
items:
77+
description: EnvVar represents an environment variable present
78+
in a Container.
79+
properties:
80+
name:
81+
description: |-
82+
Name of the environment variable.
83+
May consist of any printable ASCII characters except '='.
84+
type: string
85+
value:
86+
description: |-
87+
Variable references $(VAR_NAME) are expanded
88+
using the previously defined environment variables in the container and
89+
any service environment variables. If a variable cannot be resolved,
90+
the reference in the input string will be unchanged. Double $$ are reduced
91+
to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e.
92+
"$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)".
93+
Escaped references will never be expanded, regardless of whether the variable
94+
exists or not.
95+
Defaults to "".
96+
type: string
97+
valueFrom:
98+
description: Source for the environment variable's value.
99+
Cannot be used if value is not empty.
100+
properties:
101+
configMapKeyRef:
102+
description: Selects a key of a ConfigMap.
103+
properties:
104+
key:
105+
description: The key to select.
106+
type: string
107+
name:
108+
default: ""
109+
description: |-
110+
Name of the referent.
111+
This field is effectively required, but due to backwards compatibility is
112+
allowed to be empty. Instances of this type with an empty value here are
113+
almost certainly wrong.
114+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
115+
type: string
116+
optional:
117+
description: Specify whether the ConfigMap or its
118+
key must be defined
119+
type: boolean
120+
required:
121+
- key
122+
type: object
123+
x-kubernetes-map-type: atomic
124+
fieldRef:
125+
description: |-
126+
Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
127+
spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
128+
properties:
129+
apiVersion:
130+
description: Version of the schema the FieldPath
131+
is written in terms of, defaults to "v1".
132+
type: string
133+
fieldPath:
134+
description: Path of the field to select in the
135+
specified API version.
136+
type: string
137+
required:
138+
- fieldPath
139+
type: object
140+
x-kubernetes-map-type: atomic
141+
fileKeyRef:
142+
description: |-
143+
FileKeyRef selects a key of the env file.
144+
Requires the EnvFiles feature gate to be enabled.
145+
properties:
146+
key:
147+
description: |-
148+
The key within the env file. An invalid key will prevent the pod from starting.
149+
The keys defined within a source may consist of any printable ASCII characters except '='.
150+
During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
151+
type: string
152+
optional:
153+
default: false
154+
description: |-
155+
Specify whether the file or its key must be defined. If the file or key
156+
does not exist, then the env var is not published.
157+
If optional is set to true and the specified key does not exist,
158+
the environment variable will not be set in the Pod's containers.
159+
160+
If optional is set to false and the specified key does not exist,
161+
an error will be returned during Pod creation.
162+
type: boolean
163+
path:
164+
description: |-
165+
The path within the volume from which to select the file.
166+
Must be relative and may not contain the '..' path or start with '..'.
167+
type: string
168+
volumeName:
169+
description: The name of the volume mount containing
170+
the env file.
171+
type: string
172+
required:
173+
- key
174+
- path
175+
- volumeName
176+
type: object
177+
x-kubernetes-map-type: atomic
178+
resourceFieldRef:
179+
description: |-
180+
Selects a resource of the container: only resources limits and requests
181+
(limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
182+
properties:
183+
containerName:
184+
description: 'Container name: required for volumes,
185+
optional for env vars'
186+
type: string
187+
divisor:
188+
anyOf:
189+
- type: integer
190+
- type: string
191+
description: Specifies the output format of the
192+
exposed resources, defaults to "1"
193+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
194+
x-kubernetes-int-or-string: true
195+
resource:
196+
description: 'Required: resource to select'
197+
type: string
198+
required:
199+
- resource
200+
type: object
201+
x-kubernetes-map-type: atomic
202+
secretKeyRef:
203+
description: Selects a key of a secret in the pod's
204+
namespace
205+
properties:
206+
key:
207+
description: The key of the secret to select from. Must
208+
be a valid secret key.
209+
type: string
210+
name:
211+
default: ""
212+
description: |-
213+
Name of the referent.
214+
This field is effectively required, but due to backwards compatibility is
215+
allowed to be empty. Instances of this type with an empty value here are
216+
almost certainly wrong.
217+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
218+
type: string
219+
optional:
220+
description: Specify whether the Secret or its key
221+
must be defined
222+
type: boolean
223+
required:
224+
- key
225+
type: object
226+
x-kubernetes-map-type: atomic
227+
type: object
228+
required:
229+
- name
230+
type: object
231+
type: array
232+
envFrom:
233+
items:
234+
description: EnvFromSource represents the source of a set of
235+
ConfigMaps or Secrets
236+
properties:
237+
configMapRef:
238+
description: The ConfigMap to select from
239+
properties:
240+
name:
241+
default: ""
242+
description: |-
243+
Name of the referent.
244+
This field is effectively required, but due to backwards compatibility is
245+
allowed to be empty. Instances of this type with an empty value here are
246+
almost certainly wrong.
247+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
248+
type: string
249+
optional:
250+
description: Specify whether the ConfigMap must be defined
251+
type: boolean
252+
type: object
253+
x-kubernetes-map-type: atomic
254+
prefix:
255+
description: |-
256+
Optional text to prepend to the name of each environment variable.
257+
May consist of any printable ASCII characters except '='.
258+
type: string
259+
secretRef:
260+
description: The Secret to select from
261+
properties:
262+
name:
263+
default: ""
264+
description: |-
265+
Name of the referent.
266+
This field is effectively required, but due to backwards compatibility is
267+
allowed to be empty. Instances of this type with an empty value here are
268+
almost certainly wrong.
269+
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
270+
type: string
271+
optional:
272+
description: Specify whether the Secret must be defined
273+
type: boolean
274+
type: object
275+
x-kubernetes-map-type: atomic
276+
type: object
277+
type: array
278+
type: object
73279
options:
74280
description: |-
75281
Command line options to include when running the pgBackRest backup command.
@@ -85,6 +291,7 @@ spec:
85291
pattern: ^repo[1-4]
86292
type: string
87293
required:
294+
- containerOptions
88295
- pgCluster
89296
- repoName
90297
type: object

0 commit comments

Comments
 (0)