Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

containerd can't use private repositity pause to create pod #813

Closed
hmtai opened this issue Jun 11, 2018 · 11 comments
Closed

containerd can't use private repositity pause to create pod #813

hmtai opened this issue Jun 11, 2018 · 11 comments

Comments

@hmtai
Copy link

hmtai commented Jun 11, 2018

When I install kubernetes 1.10 with containerd and I config the kubelet.service --pod-infra-container-image=registry/mdelder/pause:3.0.After the whole cluster running,I found that containerd pull the k8s.gcr.io/pause:3.1to create pods.How I config to use my private repositity pause image?Did I make the wrong configuration?

@Random-Liu
Copy link
Member

Random-Liu commented Jun 11, 2018

  1. You shouldn't configure kubelet flag --pod-infra-container-image. That flag is for dockershim. You should use sandbox_image in containerd config instead (see https://github.com/containerd/cri/blob/master/docs/config.md).
  2. containerd doesn't support pulling pause image from private registry which requires authentication. Does your registry/mdelder registry require authentication?

@hmtai
Copy link
Author

hmtai commented Jun 12, 2018

@Random-Liu Yes, my registry requires authentication,and this is my configuration for containerd:

[plugins]
  [plugins.cgroups]
    no_prometheus = false
  [plugins.cri]
    stream_server_address = ""
    stream_server_port = "10010"
    enable_selinux = false
    sandbox_image = "{{ k8s_pause_image }}"
    stats_collect_period = 10
    systemd_cgroup = false
    [plugins.cri.containerd]
      snapshotter = "overlayfs"
      [plugins.cri.containerd.default_runtime]
        runtime_type = "io.containerd.runtime.v1.linux"

sandbox_imageis my private registry pause image which I use ctr cri loadto load into contaienrd.But when the pod running,I inspect it,it use k8s.gcr.io/pause:3.1image.

crictl inspectp 97f9718d71e1e| grep info -A 15
  "info": {
    "pid": 2953,
    "processStatus": "running",
    "netNamespaceClosed": false,
    "image": "k8s.gcr.io/pause:3.1",
    "snapshotKey": "97f9718d71e1ea814985d356619bb1834ad0cb9bd016d5dd6c316c0ce4cd0839",
    "snapshotter": "overlayfs",
    "runtime": {
      "runtimeType": "io.containerd.runtime.v1.linux",
      "runtimeEngine": "",
      "runtimeRoot": ""
    },
    "config": {
      "metadata": {
        "name": "k8s-master-10.10.24.111",
        "uid": "000737af6f45ed5f4e62c3865f41391a",

@Random-Liu
Copy link
Member

Random-Liu commented Jun 12, 2018

@hmtai Hm, Let me look into it tonight.

@Random-Liu
Copy link
Member

Random-Liu commented Jun 12, 2018

I tried changing sandbox image to nginx, and it works for me.

$ cat /etc/containerd/config.toml 
disabled_plugins = ["restart"]
[plugins.linux]
  shim_debug = true
[plugins.cri]
  sandbox_image = "nginx"
$ crictl inspectp e | grep info -A 15
  "info": {
    "pid": 0,
    "processStatus": "deleted",
    "netNamespaceClosed": false,
    "image": "docker.io/library/nginx:latest",
    "snapshotKey": "e50a2079080a0f168e38dc93fd530c70d95adc0b68b1e826665c2ebd58f7f74d",
    "snapshotter": "overlayfs",
    "runtime": {
      "runtimeType": "io.containerd.runtime.v1.linux",
      "runtimeEngine": "",
      "runtimeRoot": ""
    },
    "config": {
      "metadata": {
        "name": "nginx-sandbox",
        "uid": "hdishd83djaidwnduwk28bcsb",

Can you show me your final containerd config on that node? (Without the template string).

@hmtai
Copy link
Author

hmtai commented Jun 13, 2018

@Random-Liu Thanks for you help.I want to use /etc/containerd/config.toml to change default config,but it seems that the config.toml didn't work.Any other steps that I missed?

  1. install containerd
tar -C / -zxf cri-containerd-1.1.0.linux-amd64.tar.gz
systemctl daemon-reload
systemctl start containerd
  1. create the config.toml
vim /etc/containerd/config.toml

@Random-Liu
Copy link
Member

Random-Liu commented Jun 13, 2018 via email

@Random-Liu
Copy link
Member

Random-Liu commented Jun 13, 2018 via email

@hmtai
Copy link
Author

hmtai commented Jun 13, 2018

@Random-Liu Thanks,when I systemctl restart containerd it works well.

root@kvm-016081:/etc/containerd# crictl inspectp 2f037b9a2bf1d71ed68b851200fe61e77a94a612e7ee3fcdc16512b77a208a92 | grep info -A 10
  "info": {
    "pid": 0,
    "processStatus": "deleted",
    "netNamespaceClosed": false,
    "image": "registry.ng.bluemix.net/mdelder/pause:3.0",
    "snapshotKey": "2f037b9a2bf1d71ed68b851200fe61e77a94a612e7ee3fcdc16512b77a208a92",
    "snapshotter": "overlayfs",
    "runtime": {
      "runtimeType": "io.containerd.runtime.v1.linux",
      "runtimeEngine": "",
      "runtimeRoot": ""

@hmtai hmtai closed this as completed Jun 13, 2018
@Random-Liu
Copy link
Member

Random-Liu commented Jun 13, 2018 via email

@hmtai
Copy link
Author

hmtai commented Jun 13, 2018

@Random-Liu When I change the /etc/containerd/config.toml ,it seems I should restart containerd that containerd can use my new config.toml.

@mikebrow
Copy link
Member

@Random-Liu that ole do we support live config updates question :-)

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

No branches or pull requests

3 participants