helm-charts
helm-charts copied to clipboard
Inject containerRuntime config failed
Bug report:
The config_path setting within the containerd configuration occasionally fails to be injected properly.
Expected behavior:
The config_path is intended to be successfully injected in the end; nonetheless, if injection fails at any point, it is imperative that the process either retries or throws an error to promptly notify the user.
How to reproduce it:
kind config
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker
use kind to install kubernetes
$ kind create cluster --config kind-config.yaml
Creating cluster "kind" ...
â Ensuring node image (kindest/node:v1.29.2) đŧ
â Preparing nodes đĻ đĻ đĻ
â Writing configuration đ
â Starting control-plane đšī¸
â Installing CNI đ
â Installing StorageClass đž
â Joining worker nodes đ
Set kubectl context to "kind-kind"
You can now use your cluster with:
kubectl cluster-info --context kind-kind
Have a nice day! đ
kind load image
kind load docker-image dragonflyoss/scheduler:v2.1.43
kind load docker-image dragonflyoss/manager:v2.1.43
kind load docker-image dragonflyoss/dfdaemon:v2.1.43
kind load docker-image busybox:latest
kind load docker-image jaegertracing/all-in-one:1.39.0
kind load docker-image bitnami/redis:7.0.8-debian-11-r0
kind load docker-image bitnami/mysql:8.0.31-debian-11-r30
kind load docker-image dragonflyoss/openssl:latest
add charts-config.yaml
containerRuntime:
containerd:
enable: true
injectConfigPath: true
registries:
- 'https://docker.io'
- 'https://ghcr.io'
scheduler:
image:
repository: dragonflyoss/scheduler
tag: v2.1.43
replicas: 1
metrics:
enable: true
config:
verbose: true
pprofPort: 18066
seedPeer:
image:
repository: dragonflyoss/dfdaemon
tag: v2.1.43
replicas: 1
metrics:
enable: true
config:
verbose: true
pprofPort: 18066
dfdaemon:
image:
repository: dragonflyoss/dfdaemon
tag: v2.1.43
metrics:
enable: true
config:
verbose: true
pprofPort: 18066
manager:
image:
repository: dragonflyoss/manager
tag: v2.1.43
replicas: 1
metrics:
enable: true
config:
verbose: true
pprofPort: 18066
jaeger:
enable: true
use helm to install dragonfly
$ helm upgrade --cleanup-on-fail \
--install dragonfly ./dragonfly \
--namespace dragonfly-system \
--create-namespace \
--values charts-config.yaml
check config.toml of containerd in node, there is nothing about config_path
$ docker exec -it kind-worker2 bash
root@kind-worker2:/# grep "config_path" /etc/containerd/config.toml
root@kind-worker2:/#
check log of container update-containerd, find that there is a create error
k -n dragonfly-system logs dragonfly-dfdaemon-4dx8m -c update-containerd
...
+ tmp=
+ '[[' -z ]]
+ echo inject config_path into /host/etc/containerd/config.toml
+ grep -q '\[plugins."io.containerd.grpc.v1.cri".registry\]' /host/etc/containerd/config.toml
inject config_path into /host/etc/containerd/config.toml
/bin/sh: can't create /host/etc/containerd/config.toml: Interrupted system call
+ cat
+ echo 'Registry config_path /host/etc/containerd/certs.d added'
+ need_restart=1
Registry config_path /host/etc/containerd/certs.d added
...
Environment:
- Dragonfly version: v2.1.43
- OS: WSL debian12
- Kernel (e.g.
uname -a):- node of kind: Linux kind-worker2 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux
- wsl kernel: Linux debian-wsl 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 GNU/Linux
- Others:
- version of kind node: kindest/node:v1.29.2
I created this PR #286 to solve this problem. When the injection script fails, it terminates immediately, and update-containerd solves the problem by retrying. Even if the retry fails, the user can be notified to avoid unexpected problems.
This picture shows the retry process
Even if an error occurs in the middle of the process, the configpath is injected successfully in the end.
@linuzb You can try the latest version of the charts, refer to https://d7y.io/docs/next/getting-started/installation/helm-charts/.