BUG: 扩容时,sealos 从镜像的 OCI 配置中读取环境变量,但没有将我在 Clusterfile 中定义的 spec.env 覆盖合并 || BUG: When expanding, sealos reads environment variables from the OCI configuration of the image, but does not overwrite and merge the spec.env I defined in the Clusterfile.
Author: OpamperCreated Jul 14, 2026Updated Aug 22, 2026
Labelskind/bug
Sealos Version
5.0.1
How to reproduce the bug?
初始创建集群时会将 spec.env 合并到 status.mounts[].env 中。
扩容节点时,没有执行将 spec.env 合并到 status.mounts[].env 的逻辑,只有 OCIToImageMount 函数从镜像的 OCI 配置中提取环境变量,这意味着 status.mounts.env 中的值来自镜像本身的元数据,无法被自定义。
apiVersion: apps.sealos.io/v1beta1
kind: Cluster
metadata:
creationTimestamp: null
name: sealos-prod
spec:
env:
- sandboxImage=skynet/sealos/pause:3.9
- registryDomain=sealos.hub
- registryPort=5000
- registryUsername=admin
- registryPassword=Passw0rd!
- registryData=/data/kubernetes/registry
hosts:
- ips:
- 192.168.0.10
roles:
- master
- registry
ssh:
passwd: xxx
port: 22
user: root
- ips:
- 192.168.0.11
roles:
- node
ssh:
passwd: xxx
port: 22
user: root
image:
- kubernetes:v1.29.9
ssh:
pk: /root/.ssh/id_rsa
port: 22
status:
mounts:
- env:
SEALOS_SYS_CRI_ENDPOINT: /var/run/containerd/containerd.sock
SEALOS_SYS_IMAGE_ENDPOINT: /var/run/image-cri-shim.sock
criData: /var/lib/containerd
defaultVIP: 10.103.97.2
disableApparmor: "false"
registryConfig: /etc/registry
registryData: /var/lib/registry
registryDomain: sealos.hub
registryPassword: passw0rd
registryPort: "5000"
registryUsername: admin
sandboxImage: pause:3.9
imageName: kubernetes:v1.29.9
labels:
check: check.sh $registryData
clean: clean.sh && bash clean-cri.sh $criData
clean-registry: clean-registry.sh $registryData $registryConfig
image: labring/lvscare:v5.0.1
init: init-cri.sh $registryDomain $registryPort && bash init.sh
init-registry: init-registry.sh $registryData $registryConfig
io.buildah.version: 1.25.0-dev
sealos.io.type: rootfs
sealos.io.version: v1beta1
version: v1.29.9
vip: $defaultVIPWhat is the expected behavior?
No response
What do you see instead?
No response
Operating environment
- Sealos version:
- Docker version:
- Kubernetes version:
- Operating system:
- Runtime environment:
- Cluster size:
- Additional information:Additional information
No response
Sealos Version
5.0.1
How to reproduce the bug?
Spec.env will be merged into status.mounts[].env when the cluster is initially created.
When expanding a node, the logic of merging spec.env into status.mounts[].env is not executed. Only the OCIToImageMount function extracts environment variables from the OCI configuration of the image, which means that the value in status.mounts.env comes from the metadata of the image itself and cannot be customized.
apiVersion: apps.sealos.io/v1beta1
Kind: Cluster
metadata:
creationTimestamp: null
name: sealos-prod
spec:
env:
- sandboxImage=skynet/sealos/pause:3.9
- registryDomain=sealos.hub
- registryPort=5000
- registryUsername=admin
- registryPassword=Passw0rd!
- registryData=/data/kubernetes/registry
hosts:
-ips:
- 192.168.0.10
roles:
- master
-registry
ssh:
passwd:xxx
port: 22
user: root
-ips:
- 192.168.0.11
roles:
-node
ssh:
passwd:xxx
port: 22
user: root
image:
-kubernetes:v1.29.9
ssh:
pk: /root/.ssh/id_rsa
port: 22
status:
mounts:
-env:
SEALOS_SYS_CRI_ENDPOINT: /var/run/containerd/containerd.sock
SEALOS_SYS_IMAGE_ENDPOINT: /var/run/image-cri-shim.sock
criData: /var/lib/containerd
defaultVIP: 10.103.97.2
disableApparmor: "false"
registryConfig: /etc/registry
registryData: /var/lib/registry
registryDomain: sealos.hub
registryPassword: passw0rd
registryPort: "5000"
registryUsername:admin
sandboxImage: pause:3.9
imageName: kubernetes:v1.29.9
labels:
check: check.sh $registryData
clean: clean.sh && bash clean-cri.sh $criData
clean-registry: clean-registry.sh $registryData $registryConfig
image: labring/lvscare:v5.0.1
init: init-cri.sh $registryDomain $registryPort && bash init.sh
init-registry: init-registry.sh $registryData $registryConfig
io.buildah.version: 1.25.0-dev
sealos.io.type: rootfs
sealos.io.version: v1beta1
version: v1.29.9
vip: $defaultVIPWhat is the expected behavior?
No response
What do you see instead?
No response
Operating environment
- Sealos version:
-Docker version:
- Kubernetes version:
- Operating system:
- Runtime environment:
-Cluster size:
-Additional information:Additional information
No response
Source: labring/sealos