Switch minikube to cri-o
This results in a much more elegant and flexible solution, and supports our use of quay.io (unlike docker). Change-Id: I00257b175c0445fc770a51bc69d30377c6f57382
This commit is contained in:
parent
e5a1ae603a
commit
bb5c04b369
@ -7,45 +7,15 @@
|
||||
- role: ensure-helm
|
||||
tasks:
|
||||
- name: Start minikube
|
||||
command: minikube start --cpus max --memory max
|
||||
command: minikube start --cpus max --memory max --container-runtime cri-o
|
||||
|
||||
- name: Patch minikube docker daemon config to use the buildset registry
|
||||
- name: Replace minikube registries.conf
|
||||
block:
|
||||
- name: Load minikube docker daemon config
|
||||
command: minikube ssh sudo cat /etc/docker/daemon.json
|
||||
register: daemon_json
|
||||
- name: Copy registries.conf from the host to minikube
|
||||
command: minikube cp /etc/containers/registries.conf /etc/containers/registries.conf
|
||||
|
||||
- name: Parse docker minikube daemon config
|
||||
set_fact:
|
||||
daemon_json_parsed: "{{ daemon_json.stdout | from_json }}"
|
||||
|
||||
- name: Add buildset registry to minikube docker daemon config
|
||||
vars:
|
||||
new_entries:
|
||||
registry-mirrors: "['https://{{ buildset_registry_alias }}:{{ buildset_registry.port }}/']"
|
||||
set_fact:
|
||||
new_daemon_json_parsed: "{{ daemon_json_parsed | combine(new_entries) }}"
|
||||
|
||||
- name: Serialise new minikube docker daemon config
|
||||
set_fact:
|
||||
new_daemon_json: "{{ new_daemon_json_parsed | to_json }}"
|
||||
|
||||
- name: Save tmp new minikube docker daemon config
|
||||
copy:
|
||||
content: "{{ new_daemon_json }}"
|
||||
dest: /tmp/minikube_docker_daemon.json
|
||||
mode: 0644
|
||||
|
||||
- name: Copy new minikube docker daemon config
|
||||
command: minikube cp /tmp/minikube_docker_daemon.json /etc/docker/daemon.json
|
||||
|
||||
- name: Clean up tmp new minikube docker daemon config
|
||||
file:
|
||||
path: /tmp/minikube_docker_daemon.json
|
||||
state: absent
|
||||
|
||||
- name: Restart minikube docker daemon
|
||||
command: minikube ssh sudo systemctl restart docker
|
||||
- name: Restart minikube crio daemon
|
||||
command: minikube ssh sudo systemctl restart crio
|
||||
|
||||
- name: Wait for minikube k8s API to be back up
|
||||
command: kubectl get node
|
||||
|
Loading…
Reference in New Issue
Block a user