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

Add basic crictl info config with sandboxImage #180

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

afbjorklund
Copy link
Contributor

@afbjorklund afbjorklund commented Apr 13, 2023

The "verbose" message now looks like:

{
  "status": {
    "conditions": [
      {
        "type": "RuntimeReady",
        "status": true,
        "reason": "",
        "message": ""
      },
      {
        "type": "NetworkReady",
        "status": false,
        "reason": "NetworkPluginNotReady",
        "message": "docker: network plugin is not ready: cni config uninitialized"
      }
    ]
  },
  "config": {
    "sandboxImage": "registry.k8s.io/pause:3.9"
  }
}

The "quiet" message looks like before.

$ sudo crictl -D=false info -o go-template --template "{{.config.sandboxImage}}"
registry.k8s.io/pause:3.9

kubernetes/kubernetes@d12b4d4


Issue #178

@afbjorklund afbjorklund marked this pull request as ready for review April 14, 2023 14:16
@afbjorklund
Copy link
Contributor Author

afbjorklund commented Apr 14, 2023

Fixes the failure seen in the verbose kubeadm log (with a misleading "fatal", wrapped in info)

[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
W0414 14:07:25.920713   21122 images.go:80] could not find officially supported version of etcd for Kubernetes v1.27.0, falling back to the nearest etcd version (3.5.7-0)
I0414 14:07:25.920739   21122 checks.go:828] using image pull policy: IfNotPresent
I0414 14:07:25.956663   21122 checks.go:846] image exists: registry.k8s.io/kube-apiserver:v1.27.0
I0414 14:07:25.992594   21122 checks.go:846] image exists: registry.k8s.io/kube-controller-manager:v1.27.0
I0414 14:07:26.025759   21122 checks.go:846] image exists: registry.k8s.io/kube-scheduler:v1.27.0
I0414 14:07:26.067020   21122 checks.go:846] image exists: registry.k8s.io/kube-proxy:v1.27.0
I0414 14:07:26.105940   21122 checks.go:833] failed to detect the sandbox image for local container runtime, output: time="2023-04-14T14:07:26Z" 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\""
, error: exit status 1
I0414 14:07:26.140339   21122 checks.go:846] image exists: registry.k8s.io/pause:3.9
I0414 14:07:26.178211   21122 checks.go:846] image exists: registry.k8s.io/etcd:3.5.7-0
I0414 14:07:26.213178   21122 checks.go:846] image exists: registry.k8s.io/coredns/coredns:v1.10.1

The new warn line in the log is instead, if forgetting to configure --pod-infra-container-image:

W0414 14:20:45.738047   41856 checks.go:835] detected that the sandbox image "registry.k8s.io/pause:3.6" of the container runtime is inconsistent with that used by kubeadm. It is recommended that using "registry.k8s.io/pause:3.9" as the CRI sandbox image.

@afbjorklund
Copy link
Contributor Author

afbjorklund commented Apr 14, 2023

There is some cryptic information on what needs to be done, in the kubernetes documentation (linked from kubeadm):

https://kubernetes.io/docs/setup/production-environment/container-runtimes/#override-pause-image-cri-dockerd-mcr

But only for MCR, the "instructions" (hint) are missing for Docker.

$ kubeadm config images list 2>/dev/null | grep pause
registry.k8s.io/pause:3.9

/etc/systemd/system/cri-docker.service.d/10-pause-image.conf

[Service]
ExecStart=
ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --pod-infra-container-image=registry.k8s.io/pause:3.9

@evol262 evol262 merged commit 2791d75 into Mirantis:master Apr 17, 2023
@afbjorklund afbjorklund deleted the info-config-sandbox-image branch January 23, 2024 15:16
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

Successfully merging this pull request may close these issues.

2 participants