containerd的安裝和配置
配置yum源
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
containerd安裝
yum install containerd jq -y
jq是什么?
jq可以對json資料進行分片、過濾、映射和轉換,和sed、awk、grep等命令一樣,都可以讓你輕松地把玩文本,它能輕松的把你擁有的資料轉換成你期望的格式,而且需要寫的程式通常也比你期望的更加簡短,
jq是用C撰寫,沒有運行時依賴,所以幾乎可以運行在任何系統上,預編譯的二進制檔案可以直接在Linux、OS X和windows系統上運行,當然在linux和OS x系統你需要賦予其可執行權限;在Linux系統中也可以直接用yum安裝,
download
在知道jq命令之前,我在linux系統中極少直接去命令處理json資料,除非只是簡單的從中過濾某個字串,那就用grep結合正則運算式來解決,所以,掌握了jq命令,則可以讓Linux命令和shell腳本在處理json資料時變得得心應手,
jq簡明教程
例子檔案:
為了便于演示jq的功能,我們在檔案json.txt中保存內容如下:
cat json.txt
[{“name”:“站長工具”,“url”:“http://tool.china.com”,“address”:{“city”:“廣東”,“country”:“中國”},“arrayBrowser”:[{“name”:“Google”,“url”:“http://www.google.com”},{“name”:“Baidu”,“url”:“http:///www.baidu.com”}]},{“name”:“站長之家”,“url”:“http://tool.zzhome.com”,“address”:{“city”:“北京”,“country”:“中國”},“arrayBrowser”:[{“name”:“360”,“url”:“http://www.so.com”},{“name”:“bing”,“url”:“http://www.bing.com”}]}]
cat json.txt | jq ‘.’
初始化Containerd配置:
containerd config default > /etc/containerd/config.toml
systemctl enable --now containerd
替換containerd默認的sand_box 鏡像,編輯/etc/containerd/config.toml檔案:
sandbox_image = "k8s.gcr.io/pause:3.2"替換成registry.cn-hanzhou.aliyuncs.com/google-containers/pause-amd64:3.2
應用配置并重新運行containerd服務
systemctl daemon-reload
systemctl restart containerd
systemctl status containerd
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/388457.html
標籤:其他
