argoproj / argo-rollouts

Progressive Delivery for Kubernetes
https://argo-rollouts.readthedocs.io/
Apache License 2.0
2.8k stars 877 forks source link

Cannot set env var using kubectl #2730

Closed tall-dan closed 1 year ago

tall-dan commented 1 year ago

Checklist:

Describe the bug

Cannot set env variable using kubectl.

To Reproduce

kubectl set env rollouts my-rollout MY_VAR=my_val
--- or ---
kubectl set env rollouts/my-rollout MY_VAR=my_val

Expected behavior

In the rollout and underlying pods, the environment variable MY_VAR is set to my_val

Actual behavior

error: no kind "Rollout" is registered for version "argoproj.io/v1alpha1" in scheme "pkg/scheme/scheme.go:28"

Version

1.4.1

Logs

# Paste the logs from the rollout controller
## Comment from the author - I don't think any of these logs are relevant to the bug, but I'm pasting them here anyway
➜ kubectl logs -n argo-rollouts deployment/argo-rollouts | tail -n 50
time="2023-04-18T00:44:48Z" level=info msg="No status changes. Skipping patch" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:44:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=0.42489
time="2023-04-18T00:45:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:45:48.000910111 +0000 UTC m=+16794.529737774)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Running overdue measurement" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Taking 1 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Measurement Completed. Result: Successful" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Enqueueing analysis after 59.99497472s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Patch status successfully" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=150.279838
time="2023-04-18T00:45:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:45:48.15122395 +0000 UTC m=+16794.680051567)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Taking 0 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Enqueueing analysis after 59.848586761s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="No status changes. Skipping patch" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:45:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=0.389721
time="2023-04-18T00:46:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:46:48.00020544 +0000 UTC m=+16854.529033124)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Running overdue measurement" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Taking 1 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Measurement Completed. Result: Successful" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Enqueueing analysis after 59.994693064s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Patch status successfully" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=158.94431
time="2023-04-18T00:46:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:46:48.159221655 +0000 UTC m=+16854.688049387)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Taking 0 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Enqueueing analysis after 59.840538083s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="No status changes. Skipping patch" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:46:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=0.435561
time="2023-04-18T00:47:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:47:48.000702856 +0000 UTC m=+16914.529530551)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Running overdue measurement" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Taking 1 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Measurement Completed. Result: Successful" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Enqueueing analysis after 59.99407125s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Patch status successfully" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=155.665495
time="2023-04-18T00:47:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:47:48.156399359 +0000 UTC m=+16914.685226980)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Taking 0 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Enqueueing analysis after 59.843381902s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="No status changes. Skipping patch" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:47:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=0.417112
time="2023-04-18T00:48:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:48:48.000356755 +0000 UTC m=+16974.529184374)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Running overdue measurement" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Taking 1 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Measurement Completed. Result: Successful" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 metric=error-rate namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Enqueueing analysis after 59.994273326s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Patch status successfully" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=169.839978
time="2023-04-18T00:48:48Z" level=info msg="Started syncing Analysis at (2023-04-18 00:48:48.170801608 +0000 UTC m=+16974.699629281)" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Taking 0 Measurement(s)..." analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Enqueueing analysis after 59.828880305s" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="No status changes. Skipping patch" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect
time="2023-04-18T00:48:48Z" level=info msg="Reconciliation completed" analysisrun=connect-ratings-web-rollout-7ffdb7fcff-2 namespace=connect time_ms=0.50973

Message from the maintainers:

Impacted by this bug? Give it a 👍. We prioritize the issues with the most 👍.

tall-dan commented 1 year ago

Honestly I'm not sure this is a worthwhile endeavor, I was hoping to change an env var in a pod, but I don't think that's going to work. I want to change an env var in a container without restart, but that doesn't seem possible

wanghong230 commented 1 year ago

I want to change an env var in a container without restart, but that doesn't seem possible.

You are right.