GithubHelp home page GithubHelp logo

Comments (5)

tmsdce avatar tmsdce commented on July 29, 2024 1

Hi @jiaqiluo
Can you take a look at this issue as it seems related to 2e767c8

from rke.

tmsdce avatar tmsdce commented on July 29, 2024

This bug prevents us from upgrading as kube-apiserver has environment variables set (like the RKE_AUDITLOG_CONFIG_CHECKSUM variable).

from rke.

jiaqiluo avatar jiaqiluo commented on July 29, 2024

hi @tmsdce, thank you for reporting the issue. I can confirm that this is a bug.

Root Cause

This bug occurs in RKE v1.5.9.

If extra_env is set for kube-api as below in the cluster config file, the Env list in the container configuration for the kube-apiserver container will contain an empty string (""), which causes the creation to fail with the error invalid environment variable: returned from Docker.

services:
  kube-api:
    extra_env:
    - TEST_VAR=test

Workaround

If your cluster is stuck in the failed status, remove the extra_env for kube-api from the cluster config and run rke up again can bring the cluster back to active.

If you need to set the extra_env for kube-api, please use RKE v1.5.8 for now until the bug is fixed in the coming release.

from rke.

jiaqiluo avatar jiaqiluo commented on July 29, 2024

the fix can be validated by using https://github.com/rancher/rke/releases/tag/v1.6.0-rc6

Root cause

Previously, we declared the Env slice with the size of the c.Services.KubeAPI.ExtraEnv field, which leads to empty strings at the beginning of the Env slice because we use Golang's append function to add new elements, and Docker is not happy with that.

What was fixed, or what changes have occurred

We fix this issue by declaring the Env variable as an empty slice.
We also enhance the getUniqStringList function to properly trim leading and trailing spaces in each element and to ignore empty strings.
We add unit tests for the getUniqStringList function and update the integration tests.

Areas or cases that should be tested

cluster provisioning and upgrading

What areas could experience regressions?

cluster provisioning and upgrading

Are the repro steps accurate/minimal?

yes

We should validate that setting extra env does not cause the reported error when either creating a new cluster or updating an existing cluster.

services:
  kube-api:
    extra_env:
    - TEST_VAR=test

from rke.

slickwarren avatar slickwarren commented on July 29, 2024

tested the following on v1.6.0-rc9:

  • provision an rke1 cluster with no extra_env -- pass
  • provision an rke1 cluster with extra_env -- pass
  • upgrade an rke1 cluster with no extra_env -> with extra_env -- pass
  • upgrade an rke1 cluster with extra_env -> update extra_env -- pass
  • upgrade an rke1 cluster with extra_env -> remove extra_env -- pass

tested with default versions of k8s (1.30.2)

from rke.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.