Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's not possible to explicitly set environment variables in EdgeWorkload #292

Open
gciavarrini opened this issue Aug 2, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@gciavarrini
Copy link
Collaborator

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.

@pkliczewski pkliczewski added the bug Something isn't working label Aug 3, 2022
@arielireni arielireni removed their assignment Sep 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants