Skip to content

Commit

Permalink
Changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
rafzei committed Feb 14, 2022
1 parent b5b004a commit fbec80d
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ansible/playbooks/roles/containerd/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
path: /var/lib/kubelet/kubeadm-flags.env
regexp: '{{ item.regexp }}'
replace: '{{ item.replace }}'
backup: yes
backup: true
loop:
- { regexp: '^(KUBELET_KUBEADM_ARGS=\")(.*)(--container-runtime=[a-zA-Z0-9_]+)(.*)', replace: '\1\2--container-runtime=remote\4' }
- { regexp: '^(KUBELET_KUBEADM_ARGS=\")(.*)(--container-runtime-endpoint=.*\.sock)(.*)', replace: '\1\2--container-runtime-endpoint=/run/containerd/containerd.sock\4' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ oom_score = 0
privileged_without_host_devices = false
base_runtime_spec = ""
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "/opt/cni/bin"
conf_dir = "/etc/cni/net.d"
Expand Down
4 changes: 3 additions & 1 deletion ansible/playbooks/roles/docker/tasks/remove-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
name: docker
state: stopped
enabled: no
when: "'docker.service' in ansible_facts.services"
when:
- "'docker.service' in ansible_facts.services"
- ansible_facts.services['docker.service']['status'] != 'not-found'

- name: Remove Docker packages
package:
Expand Down
3 changes: 1 addition & 2 deletions docs/changelogs/CHANGELOG-2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
- [#2950](https://github.com/epiphany-platform/epiphany/issues/2950) - CLI refactor to make it more consistant
- [#2844](https://github.com/epiphany-platform/epiphany/issues/2844) - Refactor K8s upgrade task in order to simplify its flow
- [#2716](https://github.com/epiphany-platform/epiphany/issues/2716) - Change container runtime to containerd
- [#2701](https://github.com/epiphany-platform/epiphany/issues/2701) - Epicli prepare - generate files in separate directory
- [#2716](https://github.com/epiphany-platform/epiphany/issues/2716) - Change container runtime to containerd

### Fixed

- [#2653](https://github.com/epiphany-platform/epiphany/issues/2653) - Epicli is failing in air-gapped infra mode
Expand Down
15 changes: 13 additions & 2 deletions tests/spec/spec/kubernetes_master/kubernetes_master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@
its(:exit_status) { should eq 0 }
end
end

end

describe 'Check the kubelet cgroup driver' do
Expand Down Expand Up @@ -215,12 +214,24 @@
describe command("kubectl get nodes -o jsonpath='{.items[].status.nodeInfo.containerRuntimeVersion}'") do
its(:stdout) { should include('containerd://1.4.12') }
end
describe file('/etc/containerd/config.toml') do
let(:disable_sudo) { false }
its(:content) { should match(/SystemdCgroup = true/) }
end
end

describe 'Check the OCI-spec' do
describe command('crictl --runtime-endpoint unix:///run/containerd/containerd.sock info') do
let(:disable_sudo) { false }
its(:stdout) { should contain('\"defaultRuntimeName\": \"runc\"') }
its(:stdout) { should match('\"defaultRuntimeName\": \"runc\"') }
end
end

describe 'Check the kubelet cgroup driver' do
describe file('/var/lib/kubelet/config.yaml') do
let(:disable_sudo) { false }
its(:content_as_yaml) { should include('cgroupDriver' => 'systemd') }
its(:content_as_yaml) { should_not include('cgroupDriver' => 'cgroupfs') }
end
end

Expand Down
4 changes: 4 additions & 0 deletions tests/spec/spec/kubernetes_node/kubernetes_node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
let(:disable_sudo) { false }
its(:stdout) { should include('RuntimeName: containerd') }
end
describe file('/etc/containerd/config.toml') do
let(:disable_sudo) { false }
its(:content) { should match(/SystemdCgroup = true/) }
end
end

describe 'Check the kubelet cgroup driver' do
Expand Down

0 comments on commit fbec80d

Please sign in to comment.