Skip to content

Commit

Permalink
kind: use podman and a up to date versions
Browse files Browse the repository at this point in the history
- Don't use docker anymore.
- Bump the kubectl and kind versions.
  • Loading branch information
goneri committed Sep 23, 2022
1 parent 5954c52 commit 11fb750
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
8 changes: 5 additions & 3 deletions playbooks/ansible-cloud/k8s/pre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
path: "{{ ansible_user_dir }}/zuul-output/logs/controller"
state: directory

- name: Run ensure-docker role
include_role:
name: ensure-docker
- name: Install podman
package:
name: podman
state: present
become: true

- name: Run ensure-virtualenv role
include_role:
Expand Down
4 changes: 2 additions & 2 deletions roles/setup-kind/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
executable_dir: "/usr/local/bin/"

kind_release: "v0.11.0"
kind_release: "v0.15.0"
kind_path: '{{ executable_dir + "kind" }}'

kubectl_release: "v1.18.0"
kubectl_release: "v1.25.2"
kubectl_path: '{{ executable_dir + "kubectl" }}'
31 changes: 30 additions & 1 deletion roles/setup-kind/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,34 @@
- "{{ kind_path }}"
- "{{ kubectl_path }}"

- copy:
content: |
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
apiServerAddress: {{ ansible_host }}
apiServerPort: 6443
dest: /tmp/kind.yaml

- command: cat /tmp/kind.yaml

- name: Ensure IPv6 is enabled
# See: https://github.com/containers/podman/issues/15395
sysctl:
name: sysctl net.ipv6.conf.all.disable_ipv6
value: '0'
state: present
sysctl_set: yes
state: present
reload: yes
become: true

- name: Create cluster
shell: "{{ kind_path }} create cluster"
shell: "sudo {{ kind_path }} create cluster --config /tmp/kind.yaml"
ignore_errors: true

- name: Expose the ~/.kube directory
shell:
cp -rv /root/.kube {ansible_user_dir}
chowm -R {ansible_user}:{ansible_group} {ansible_user_dir}/.kube
become: true

0 comments on commit 11fb750

Please sign in to comment.