Skip to content

Commit

Permalink
Update ansible setup.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Mar 6, 2018
1 parent 936dcce commit 640e7ac
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 38 deletions.
2 changes: 1 addition & 1 deletion contrib/ansible/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Kubernetes Cluster with Containerd and CRI-Containerd
# Kubernetes Cluster with Containerd
<p align="center">
<img src="https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png" width="50" height="50">
<img src="https://github.com/containerd/containerd/blob/master/docs/images/containerd-dark.png" width="200" >
Expand Down
19 changes: 3 additions & 16 deletions contrib/ansible/cri-containerd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
- include_tasks: tasks/bootstrap_centos.yaml # Contains tasks bootstrap components for centos systems
when: ansible_distribution == "CentOS"
- include_tasks: tasks/k8s.yaml # Contains tasks kubernetes component installation
- include_tasks: tasks/binaries.yaml # Contains tasks for pulling containerd and cri-containerd components
- include_tasks: tasks/binaries.yaml # Contains tasks for pulling containerd components

- name: "Create a directory for containerd config"
file: path=/etc/containerd state=directory
Expand All @@ -21,22 +21,9 @@
[cgroup]
path = "/runtime"
- name: "Create a directory for cri-containerd config"
file: path=/etc/cri-containerd state=directory

- name: "Add cri-containerd config file"
blockinfile:
path: /etc/cri-containerd/config.toml
create: yes
block: |
cgroup_path = "/runtime"
- name: "Start Containerd"
systemd: name=containerd daemon_reload=yes state=started enabled=yes

- name: "Start CRI-Containerd"
systemd: name=cri-containerd daemon_reload=yes state=started enabled=yes

- name: "Load br_netfilter kernel module"
modprobe:
name: br_netfilter
Expand All @@ -59,7 +46,7 @@
- name: "Add runtime args in kubelet conf"
lineinfile:
dest: "/etc/systemd/system/kubelet.service.d/10-kubeadm.conf"
line: "Environment=\"KUBELET_EXTRA_ARGS= --runtime-cgroups=/runtime --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=/var/run/cri-containerd.sock\""
line: "Environment=\"KUBELET_EXTRA_ARGS= --runtime-cgroups=/runtime --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=/run/containerd/containerd.sock\""
insertafter: '\[Service\]'
when: check_args.stdout == ""

Expand All @@ -70,5 +57,5 @@
- name: "Pre-pull pause container image"
shell: |
/usr/local/bin/ctr pull gcr.io/google_containers/pause:3.0
/usr/local/bin/crictl --runtime-endpoint /var/run/cri-containerd.sock \
/usr/local/bin/crictl --runtime-endpoint /run/containerd/containerd.sock \
pull gcr.io/google_containers/pause:3.0
2 changes: 1 addition & 1 deletion contrib/ansible/tasks/binaries.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "Get Containerd and CRI-Containerd"
- name: "Get Containerd"
unarchive:
src: "https://storage.googleapis.com/cri-containerd-release/cri-containerd-{{ cri_containerd_release_version }}.linux-amd64.tar.gz"
dest: "/"
Expand Down
3 changes: 0 additions & 3 deletions contrib/ansible/vars/vars.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
cri_containerd_release_version: 1.0.0-beta.0
cri_release_directory: /opt/cri-containerd/
local_bin_dir: /usr/local/bin/
local_sbin_dir: /usr/local/sbin/
cni_bin_dir: /opt/cni/bin/
cni_conf_dir: /etc/cni/net.d/
17 changes: 0 additions & 17 deletions contrib/systemd-units/cri-containerd.service

This file was deleted.

0 comments on commit 640e7ac

Please sign in to comment.