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

Fix docker cri #182

Merged
merged 1 commit into from
Oct 16, 2024
Merged
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
68 changes: 32 additions & 36 deletions tasks/kubeadm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,38 @@

- debug: msg="Kubeadm version installed = {{ kubeadm_output.stdout }}"

- block:

- name: Create /etc/modules-load.d/containerd.conf
register: containerd_json
copy:
content: |
overlay
br_netfilter
dest: /etc/modules-load.d/containerd.conf

- name: Make modprobes
command: modprobe {{item}}
with_items:
- overlay
- br_netfilter
when: containerd_json is changed

- name: Create /etc/sysctl.d/99-kubernetes-cri.conf
register: containerd_sysctl
copy:
content: |
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
dest: /etc/sysctl.d/99-kubernetes-cri.conf

#- name: Containerd CNI for Cilium network
# template: src=10-containerd-net.conflist.j2 dest=/etc/cni/net.d/10-containerd-net.conflist
# notify: sysctl-system
# when: kube_network == 'cilium''

- name: Apply sysctl params
command: sysctl --system
when: containerd_sysctl is changed

when: kube_cri_runtime in ["containerd", "crio"]
- name: Create /etc/modules-load.d/containerd.conf
register: containerd_json
copy:
content: |
overlay
br_netfilter
dest: /etc/modules-load.d/containerd.conf

- name: Make modprobes
command: modprobe {{item}}
with_items:
- overlay
- br_netfilter
when: containerd_json is changed

- name: Create /etc/sysctl.d/99-kubernetes-cri.conf
register: containerd_sysctl
copy:
content: |
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
dest: /etc/sysctl.d/99-kubernetes-cri.conf

#- name: Containerd CNI for Cilium network
# template: src=10-containerd-net.conflist.j2 dest=/etc/cni/net.d/10-containerd-net.conflist
# notify: sysctl-system
# when: kube_network == 'cilium''

- name: Apply sysctl params
command: sysctl --system
when: containerd_sysctl is changed

- name: Include "{{ansible_os_family}}" Kubernetes recipe
include_tasks: "{{ansible_os_family}}.yaml"
2 changes: 1 addition & 1 deletion templates/kubeadm-config-join.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ nodeRegistration:
{{key}}: {{value}}
{% endfor %}
{% if kube_cri_runtime == "docker" %}
criSocket: "/run/cri-dockerd.sock"
criSocket: "unix:///run/cri-dockerd.sock"
{% endif %}
discovery:
bootstrapToken:
Expand Down
2 changes: 1 addition & 1 deletion templates/kubeadm-config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ bootstrapTokens:
ttl: "{{kube_token_ttl}}" # --token-ttl
{% if kube_cri_runtime == "docker" %}
nodeRegistration:
criSocket: "/run/cri-dockerd.sock"
criSocket: "unix:///run/cri-dockerd.sock"
{% endif %}
Loading