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 6ca3b87
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 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
3 changes: 2 additions & 1 deletion roles/setup-kind/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
executable_dir: "/usr/local/bin/"

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

kubectl_release: "v1.18.0"
kubectl_release: "v1.25.2"
kubectl_path: '{{ executable_dir + "kubectl" }}'
27 changes: 26 additions & 1 deletion roles/setup-kind/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,30 @@
- "{{ 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: net.ipv6.conf.all.disable_ipv6
value: '0'
state: present
sysctl_set: true
reload: true
become: true

- name: Create cluster
shell: "{{ kind_path }} create cluster"
shell: |
sudo {{ kind_path }} create cluster --config /tmp/kind.yaml
mkdir ~/.kube
sudo kind get kubeconfig |grep -v 'enabling experimental podman provider' > ~/.kube/config
ignore_errors: true

0 comments on commit 6ca3b87

Please sign in to comment.