It's not possible to explicitly set environment variables in EdgeWorkload
Opened this issue · 0 comments
gciavarrini commented
For example the following EdgeWorkload
:
(example source https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/)
---
apiVersion: management.project-flotta.io/v1alpha1
kind:EdgeWorkload
metadata:
name: greeting-with-env
spec:
deviceSelector:
matchLabels:
app: ee-ansible
type: pod
pod:
spec:
containers:
- name: greeting-with-env-container
image: gcr.io/google-samples/node-hello:1.0
env:
- name: DEMO_GREETING
value: "Hello from the environment"
- name: DEMO_FAREWELL
value: "Such a sweet sorrow"
Produces the error:
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:52: sending HTTP request: GET https://project-flotta.io:8043/api/flotta-management/v1/control/edgedevice1/in
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:53: request: &{GET https://project-flotta.io:8043/api/flotta-management/v1/control/edgedevice1/in HTTP/1.1 1 1 map[User-Agent:[yggdrasil/0.2.99]] <nil> <nil> 0 [] false project-flotta.io:8043 map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0000b2020}
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:99: received HTTP 200 OK:
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:52: sending HTTP request: GET https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:53: request: &{GET https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in HTTP/1.1 1 1 map[User-Agent:[yggdrasil/0.2.99]] <nil> <nil> 0 [] false project-flotta.io:8043 map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0000b2020}
Jul 30 17:12:28 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:28 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/transport/http.go:71: cannot get HTTP request: cannot download from URL: Get "https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in": stream error: stream ID 1707; INTERNAL_ERROR; received from peer
+++Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:52: sending HTTP request: GET https://project-flotta.io:8043/api/flotta-management/v1/control/edgedevice1/in
Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:53: request: &{GET https://project-flotta.io:8043/api/flotta-management/v1/control/edgedevice1/in HTTP/1.1 1 1 map[User-Agent:[yggdrasil/0.2.99]] <nil> <nil> 0 [] false project-flotta.io:8043 map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0000b2020}
Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:99: received HTTP 200 OK:
Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:52: sending HTTP request: GET https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in
Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/http/client.go:53: request: &{GET https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in HTTP/1.1 1 1 map[User-Agent:[yggdrasil/0.2.99]] <nil> <nil> 0 [] false project-flotta.io:8043 map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0000b2020}
Jul 30 17:12:33 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:33 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/internal/transport/http.go:71: cannot get HTTP request: cannot download from URL: Get "https://project-flotta.io:8043/api/flotta-management/v1/data/edgedevice1/in": stream error: stream ID 1711; INTERNAL_ERROR; received from peer
Jul 30 17:12:36 ece4fdf0da6d yggdrasild[124]: [yggdrasild] 2022/07/30 17:12:36 /builddir/build/BUILD/yggdrasil-0.2.99-0.86.git.3eb009b/cmd/yggd/worker.go:114: /usr/libexec/yggdrasil/device-worker: no workloads to return. DeviceID: edgedevice1;
Removing the env
section "resolve" the problem.
However, the environment variables can be successfully be defined via a ConfigMap
.