Skip to content

Commit de7c74a

Browse files
authored
chore(sidecar): adding env and envfrom field in sidecar (#442)
* chore(sidecar): adding envfrom field in sidecar Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io> * chore(sidecar): adding env field in sidecar Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io> Signed-off-by: Shubham Chaudhary <shubham.chaudhary@harness.io>
1 parent 0023351 commit de7c74a

File tree

4 files changed

+327
-3
lines changed

4 files changed

+327
-3
lines changed

api/litmuschaos/v1alpha1/chaosengine_types.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,16 @@ type ComponentParams struct {
155155
}
156156

157157
type Sidecar struct {
158-
//Image of the runner pod
158+
//Image of the sidecar container
159159
Image string `json:"image"`
160-
//ImagePullPolicy for runner pod
160+
//ImagePullPolicy of the sidecar container
161161
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
162-
// Secrets for runner pod
162+
// Secrets for the sidecar container
163163
Secrets []Secret `json:"secrets,omitempty"`
164+
// EnvFrom for the sidecar container
165+
EnvFrom []corev1.EnvFromSource `json:"envFrom"`
166+
// ENV contains ENV passed to the sidecar container
167+
ENV []corev1.EnvVar `json:"env,omitempty"`
164168
}
165169

166170
// RunnerInfo defines the information of the runnerinfo pod

api/litmuschaos/v1alpha1/zz_generated.deepcopy.go

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deploy/chaos_crds.yaml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,159 @@ spec:
109109
type: object
110110
x-kubernetes-preserve-unknown-fields: true
111111
properties:
112+
env:
113+
description: ENV contains ENV passed to the sidecar container
114+
items:
115+
description: EnvVar represents an environment variable
116+
present in a Container.
117+
properties:
118+
name:
119+
description: Name of the environment variable. Must
120+
be a C_IDENTIFIER.
121+
type: string
122+
value:
123+
description: 'Variable references $(VAR_NAME) are
124+
expanded using the previous defined environment
125+
variables in the container and any service environment
126+
variables. If a variable cannot be resolved, the
127+
reference in the input string will be unchanged.
128+
The $(VAR_NAME) syntax can be escaped with a double
129+
$$, ie: $$(VAR_NAME). Escaped references will never
130+
be expanded, regardless of whether the variable
131+
exists or not. Defaults to "".'
132+
type: string
133+
valueFrom:
134+
description: Source for the environment variable's
135+
value. Cannot be used if value is not empty.
136+
properties:
137+
configMapKeyRef:
138+
description: Selects a key of a ConfigMap.
139+
properties:
140+
key:
141+
description: The key to select.
142+
type: string
143+
name:
144+
description: 'Name of the referent. More info:
145+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
146+
TODO: Add other useful fields. apiVersion,
147+
kind, uid?'
148+
type: string
149+
optional:
150+
description: Specify whether the ConfigMap
151+
or its key must be defined
152+
type: boolean
153+
required:
154+
- key
155+
type: object
156+
fieldRef:
157+
description: 'Selects a field of the pod: supports
158+
metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`,
159+
`metadata.annotations[''<KEY>'']`, spec.nodeName,
160+
spec.serviceAccountName, status.hostIP, status.podIP,
161+
status.podIPs.'
162+
properties:
163+
apiVersion:
164+
description: Version of the schema the FieldPath
165+
is written in terms of, defaults to "v1".
166+
type: string
167+
fieldPath:
168+
description: Path of the field to select in
169+
the specified API version.
170+
type: string
171+
required:
172+
- fieldPath
173+
type: object
174+
resourceFieldRef:
175+
description: 'Selects a resource of the container:
176+
only resources limits and requests (limits.cpu,
177+
limits.memory, limits.ephemeral-storage, requests.cpu,
178+
requests.memory and requests.ephemeral-storage)
179+
are currently supported.'
180+
properties:
181+
containerName:
182+
description: 'Container name: required for
183+
volumes, optional for env vars'
184+
type: string
185+
divisor:
186+
anyOf:
187+
- type: integer
188+
- type: string
189+
description: Specifies the output format of
190+
the exposed resources, defaults to "1"
191+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
192+
x-kubernetes-int-or-string: true
193+
resource:
194+
description: 'Required: resource to select'
195+
type: string
196+
required:
197+
- resource
198+
type: object
199+
secretKeyRef:
200+
description: Selects a key of a secret in the
201+
pod's namespace
202+
properties:
203+
key:
204+
description: The key of the secret to select
205+
from. Must be a valid secret key.
206+
type: string
207+
name:
208+
description: 'Name of the referent. More info:
209+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
210+
TODO: Add other useful fields. apiVersion,
211+
kind, uid?'
212+
type: string
213+
optional:
214+
description: Specify whether the Secret or
215+
its key must be defined
216+
type: boolean
217+
required:
218+
- key
219+
type: object
220+
type: object
221+
required:
222+
- name
223+
type: object
224+
type: array
225+
envFrom:
226+
description: EnvFrom for the sidecar container
227+
items:
228+
description: EnvFromSource represents the source of a
229+
set of ConfigMaps
230+
properties:
231+
configMapRef:
232+
description: The ConfigMap to select from
233+
properties:
234+
name:
235+
description: 'Name of the referent. More info:
236+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
237+
TODO: Add other useful fields. apiVersion, kind,
238+
uid?'
239+
type: string
240+
optional:
241+
description: Specify whether the ConfigMap must
242+
be defined
243+
type: boolean
244+
type: object
245+
prefix:
246+
description: An optional identifier to prepend to
247+
each key in the ConfigMap. Must be a C_IDENTIFIER.
248+
type: string
249+
secretRef:
250+
description: The Secret to select from
251+
properties:
252+
name:
253+
description: 'Name of the referent. More info:
254+
https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
255+
TODO: Add other useful fields. apiVersion, kind,
256+
uid?'
257+
type: string
258+
optional:
259+
description: Specify whether the Secret must be
260+
defined
261+
type: boolean
262+
type: object
263+
type: object
264+
type: array
112265
image:
113266
type: string
114267
imagePullPolicy:

0 commit comments

Comments
 (0)