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

Inject containerRuntime config failed #285

Open
linuzb opened this issue Jun 15, 2024 · 2 comments
Open

Inject containerRuntime config failed #285

linuzb opened this issue Jun 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@linuzb
Copy link

linuzb commented Jun 15, 2024

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):
  • Others:
    • version of kind node: kindest/node:v1.29.2
@linuzb linuzb added the bug Something isn't working label Jun 15, 2024
@linuzb
Copy link
Author

linuzb commented Jun 15, 2024

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
f4dd5c1d4e8ed3db9eacaca65e15dc2

Even if an error occurs in the middle of the process, the configpath is injected successfully in the end.
image

@gaius-qi
Copy link
Member

gaius-qi commented Jul 4, 2024

@linuzb You can try the latest version of the charts, refer to https://d7y.io/docs/next/getting-started/installation/helm-charts/.

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

2 participants