Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes to get the playbooks working in latest centos (7.7.1908) with k8s 1.16 and crio #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 57 additions & 8 deletions cri-o.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
- wget
when: ansible_distribution == 'Fedora'

- name: install Epel repository
yum:
name: epel-release
state: latest
when: ansible_distribution == 'CentOS'

- name: Make sure we have all required packages on RHEL/CentOS
yum:
name: "{{ item }}"
Expand Down Expand Up @@ -62,6 +68,16 @@
- wget
when: ansible_distribution in ['RedHat', 'CentOS']

- name: Make sure we have all required packages on RHEL
yum:
name: "go-md2man"
when: ansible_distribution == 'RedHat'

- name: Make sure we have all required packages on CentOS
yum:
name: "golang-github-cpuguy83-go-md2man"
when: ansible_distribution == 'CentOS'

- name: Make sure we have all required packages on Ubuntu
package:
name: "{{ item }}"
Expand Down Expand Up @@ -110,7 +126,7 @@
git:
repo: https://github.com/kubernetes-incubator/cri-o
dest: /root/src/github.com/kubernetes-incubator/cri-o
version: kube-1.6.x
version: release-1.16

- name: clone CNI
git:
Expand All @@ -129,13 +145,26 @@

- name: build cri-o
shell: |
export GOPATH=/root && \
export GOBIN=/usr/local/go/bin && \
export PATH=/usr/local/go/bin:$PATH && \
cd /root/src/github.com/kubernetes-incubator/cri-o && \
make install.tools && \
make && \
make install && \
make install.systemd && \
make install.config

- name: clone conmon dependency
git:
repo: http://github.com/containers/conmon
dest: /root/src/github.com/conmon

- name: build and install conmon
shell: |
cd /root/src/github.com/conmon && \
make && \
make install

- name: install policy.json in Ubuntu
shell: |
cd /root/src/github.com/kubernetes-incubator/cri-o && \
Expand All @@ -145,7 +174,7 @@
- name: build CNI stuff
shell: |
cd /root/src/github.com/containernetworking/plugins && \
./build.sh && \
./build_linux.sh && \
mkdir -p /opt/cni/bin && \
cp bin/* /opt/cni/bin/

Expand All @@ -159,15 +188,22 @@

- name: run with overlay2
replace:
regexp: 'storage_driver = ""'
regexp: '^#storage_driver = "overlay"'
replace: 'storage_driver = "overlay2"'
name: /etc/crio/crio.conf
backup: yes

- name: change cgroup_manager to cgroupfs
replace:
regexp: '^cgroup_manager = "systemd"'
replace: 'cgroup_manager = "cgroupfs"'
name: /etc/crio/crio.conf
backup: yes

- name: add overlay2 storage opts on RHEL/CentOS
lineinfile:
dest: /etc/crio/crio.conf
line: '"overlay2.override_kernel_check=1"'
line: 'storage_option = [ "overlay2.override_kernel_check=1" ]'
insertafter: 'storage_option = \['
regexp: 'overlay2\.override_kernel_check=1'
state: present
Expand Down Expand Up @@ -214,10 +250,23 @@
command: "sysctl -p"
ignore_errors: true

- name: kubelet_extra_args copied to /etc/default/kubelet
copy:
content: "KUBELET_EXTRA_ARGS=--feature-gates=\"AllAlpha=false,RunAsGroup=true\" --container-runtime=remote --cgroup-driver=cgroupfs --container-runtime-endpoint='unix:///var/run/crio/crio.sock' --runtime-request-timeout=5m"
force: yes
dest: /etc/default/kubelet

- name: systemd dropin for kubeadm
shell: |
sh -c 'echo "[Service]
Environment=\"KUBELET_EXTRA_ARGS=--enable-cri=true --container-runtime=remote --runtime-request-timeout=15m --image-service-endpoint /var/run/crio.sock --container-runtime-endpoint /var/run/crio.sock\"" > /etc/systemd/system/kubelet.service.d/0-crio.conf'
copy:
content: |
[Service]
Environment=-/etc/default/kubelet
dest: /etc/systemd/system/kubelet.service.d/0-crio.conf
force: yes

- name: just force systemd to reread configs
systemd:
daemon_reload: yes

- name: flush iptables
command: "iptables -F"
Expand Down
4 changes: 2 additions & 2 deletions install/golang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

- name: install Golang upstream
unarchive:
src: "https://golang.org/dl/go1.8.3.linux-amd64.tar.gz"
src: "https://golang.org/dl/go1.13.linux-amd64.tar.gz"
dest: "/usr/local"
remote_src: True
when: '"go1.8.3" not in go_version.stdout'
when: '"go1.13" not in go_version.stdout'

- name: Set custom Golang path in RHEL/CentOS/Fedora
lineinfile:
Expand Down