Cloud/k8s

[k8s] container runtime별 관리 tools

jinkwon.kim 2023. 3. 6. 09:57
728x90
반응형

개요

container runtime별 관리 tools을 알아보겠습니다. 

containerd

관리 tool

crictl

https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md

 

GitHub - kubernetes-sigs/cri-tools: CLI and validation tools for Kubelet Container Runtime Interface (CRI) .

CLI and validation tools for Kubelet Container Runtime Interface (CRI) . - GitHub - kubernetes-sigs/cri-tools: CLI and validation tools for Kubelet Container Runtime Interface (CRI) .

github.com

crictl의 container runtime 연동

1. socket 설정

$ cat /etc/crictl.yaml
runtime-endpoint: unix:///var/run/dockershim.sock
image-endpoint: unix:///var/run/dockershim.sock
timeout: 2
debug: true
pull-image-on-create: false

2. container runtime 재 시작

crictl을 이용한 container 생성

sandbox json 생성

#cat pod-config.json
{
    "metadata": {
        "name": "nginx-sandbox",
        "namespace": "default",
        "attempt": 1,
        "uid": "hdishd83djaidwnduwk28bcsb"
    },
    "log_directory": "/tmp",
    "linux": {
    }
}

sandbox 생성

#crictl runp pod-config.json
f84dd361f8dc51518ed291fbadd6db537b0496536c1d2d6c05ff943ce8c9a54f

container json 생성

#cat container-config.json
{
  "metadata": {
      "name": "busybox"
  },
  "image":{
      "image": "busybox"
  },
  "command": [
      "top"
  ],
  "log_path":"busybox.0.log",
  "linux": {
  }
}

container 생성

$ crictl create f84dd361f8dc51518ed291fbadd6db537b0496536c1d2d6c05ff943ce8c9a54f container-config.json pod-config.json
3e025dd50a72d956c4f14881fbb5b1080c9275674e95fb67f965f6478a957d60

 

생성확인 

#crictl ps 

728x90
반응형

'Cloud > k8s' 카테고리의 다른 글

[k8s] Prometheus  (1) 2023.12.06
[k8s-deep dive] OCI 란?  (0) 2023.11.21
[급한 k8s] 4. 외부 서비스  (0) 2023.01.01
[k8s] k8s 관련 지식  (0) 2022.11.26
[k8s] 2. 네트워크의 종류 및 CNI  (0) 2022.11.22