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

kubernetes v1.27 using cri-dockerd v0.3.1 #178

Open
cuisongliu opened this issue Apr 13, 2023 · 5 comments
Open

kubernetes v1.27 using cri-dockerd v0.3.1 #178

cuisongliu opened this issue Apr 13, 2023 · 5 comments

Comments

@cuisongliu
Copy link

I0413 15:00:40.876631   16395 checks.go:833] failed to detect the sandbox image for local container runtime, output: time="2023-04-13T15:00:40+08:00" level=fatal msg="getting status of runtime: failed to template data: template: tmplExecuteRawJSON:1:9: executing \"tmplExecuteRawJSON\" at <.config.sandboxImage>: map has no entry for key \"config\""

sandboxImage using from cri, kubelete remove sandboxImage flags

image

@cuisongliu
Copy link
Author

kubernetes/kubernetes#108045

("pod-infra-container-image", "will be removed in 1.27. Image garbage collector will get sandbox image information from container runtimes")

same in 1.27 remove this flags ? kubeadm init detect the sandbox image failed in cri-dockerd cri.

@afbjorklund
Copy link
Contributor

Right, "config" is only implemented in containerd. The other runtimes only do "status", for their crictl info.

sudo crictl -r unix:///var/run/cri-dockerd.sock info

{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": false,
        "reason": "NetworkPluginNotReady",
        "message": "docker: network plugin is not ready: cni config uninitialized"
      }
    ]
  }
}

sudo crictl -r unix:///run/crio/crio.sock info

{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": false,
        "reason": "NetworkPluginNotReady",
        "message": "Network plugin returns error: No CNI configuration file in /etc/cni/net.d/. Has your network provider started?"
      }
    ]
  }
}

As far as I know, the output is only advisory anyway ? It shows if you forgot to configure your container runtime...

@cuisongliu
Copy link
Author

// SandboxImage returns the sandbox image used by the container runtime
func (runtime *CRIRuntime) SandboxImage() (string, error) {
	args := []string{"-D=false", "info", "-o", "go-template", "--template", "{{.config.sandboxImage}}"}
	out, err := runtime.crictl(args...).CombinedOutput()
	if err != nil {
		return "", errors.Wrapf(err, "output: %s, error", string(out))
	}

	sandboxImage := strings.TrimSpace(string(out))
	if len(sandboxImage) > 0 {
		return sandboxImage, nil
	}

	return "", errors.Errorf("the detected sandbox image is empty")
}

@afbjorklund
Copy link
Contributor

afbjorklund commented Aug 9, 2023

The flag is still there for 1.28, and the help text now says "in a future release" (without specifying which)

kubernetes/kubernetes@a1def4b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants