fix:容器化aio安装时选择containerd运行时失败

pull/1014/head 3.1.0
gjmzj 2021-04-26 10:02:21 +08:00
parent 5314315ca3
commit bbed72b9f3
2 changed files with 56 additions and 47 deletions

View File

@ -42,6 +42,8 @@ https://www.toutiao.com/c/user/token/MS4wLjABAAAA0YFomuMNm87NNysXeUsQdI0Tt3gOgz8
- fix:restart ex-lb when master nodes change - fix:restart ex-lb when master nodes change
- fix:多条默认路由网卡自动识别问题 - fix:多条默认路由网卡自动识别问题
- fix:安装aio集群时docker cgroupdriver设置问题 - fix:安装aio集群时docker cgroupdriver设置问题
- fix:add scheme:https to service-account-issuer
- fix:容器化aio安装时选择containerd运行时失败
- feat:增加可选配置apiserver安全端口 - feat:增加可选配置apiserver安全端口
- feat:允许修改配置ingress port #999 - feat:允许修改配置ingress port #999
- feat:增加支持ubuntu 20.04 - feat:增加支持ubuntu 20.04

View File

@ -2,20 +2,26 @@
shell: 'systemctl status docker|grep Active || echo "NOT FOUND"' shell: 'systemctl status docker|grep Active || echo "NOT FOUND"'
register: docker_status register: docker_status
- name: 停止docker - name: WARNNING 提示
shell: 'systemctl stop docker' debug:
msg: "[WARN]: docker is running, and containerd will be installed"
when: '"running" in docker_status.stdout' when: '"running" in docker_status.stdout'
- name: 准备containerd相关目录 - name: 获取是否已经安装containerd
shell: 'systemctl status containerd|grep Active || echo "NoFound"'
register: containerd_svc
- block:
- name: 准备containerd相关目录
file: name={{ item }} state=directory file: name={{ item }} state=directory
with_items: with_items:
- "{{ bin_dir }}" - "{{ bin_dir }}"
- "/etc/containerd" - "/etc/containerd"
- name: 加载内核模块 overlay - name: 加载内核模块 overlay
modprobe: name=overlay state=present modprobe: name=overlay state=present
- name: 下载 containerd 二进制文件 - name: 下载 containerd 二进制文件
copy: src={{ base_dir }}/bin/containerd-bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755 copy: src={{ base_dir }}/bin/containerd-bin/{{ item }} dest={{ bin_dir }}/{{ item }} mode=0755
with_items: with_items:
- containerd - containerd
@ -27,26 +33,26 @@
- runc - runc
tags: upgrade tags: upgrade
- name: 创建 containerd 配置文件 - name: 创建 containerd 配置文件
template: src=config.toml.j2 dest=/etc/containerd/config.toml template: src=config.toml.j2 dest=/etc/containerd/config.toml
tags: upgrade tags: upgrade
- name: 创建systemd unit文件 - name: 创建systemd unit文件
template: src=containerd.service.j2 dest=/etc/systemd/system/containerd.service template: src=containerd.service.j2 dest=/etc/systemd/system/containerd.service
tags: upgrade tags: upgrade
- name: 创建 crictl 配置 - name: 创建 crictl 配置
template: src=crictl.yaml.j2 dest=/etc/crictl.yaml template: src=crictl.yaml.j2 dest=/etc/crictl.yaml
- name: 开机启用 containerd 服务 - name: 开机启用 containerd 服务
shell: systemctl enable containerd shell: systemctl enable containerd
ignore_errors: true ignore_errors: true
- name: 开启 containerd 服务 - name: 开启 containerd 服务
shell: systemctl daemon-reload && systemctl restart containerd shell: systemctl daemon-reload && systemctl restart containerd
tags: upgrade tags: upgrade
- name: 轮询等待containerd服务运行 - name: 轮询等待containerd服务运行
shell: "systemctl status containerd.service|grep Active" shell: "systemctl status containerd.service|grep Active"
register: containerd_status register: containerd_status
until: '"running" in containerd_status.stdout' until: '"running" in containerd_status.stdout'
@ -54,9 +60,10 @@
delay: 2 delay: 2
tags: upgrade tags: upgrade
- name: 添加 crictl 命令自动补全 - name: 添加 crictl 命令自动补全
lineinfile: lineinfile:
dest: ~/.bashrc dest: ~/.bashrc
state: present state: present
regexp: 'crictl completion' regexp: 'crictl completion'
line: 'source <(crictl completion)' line: 'source <(crictl completion)'
when: "'running' not in containerd_svc.stdout"