From e4b2593a213034a0a6ec875fbfdf2c5279a09b34 Mon Sep 17 00:00:00 2001 From: Daniel Pawlik Date: Mon, 7 Nov 2022 15:16:08 +0100 Subject: [PATCH] [kind] Set containers limit for podman The sf-operator can not be deployed when there is already deployed operator by somone. The new pods got an error that some limits are reached. This commit is setting the podman pids_limit to unlimited [1]. [1] https://github.com/kubernetes-sigs/kind/issues/2896#issuecomment-1226184890 Change-Id: Ie314ed4e60ea127bca1af7e9d60548a5346fa203 --- roles/extra/kind/tasks/main.yaml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/roles/extra/kind/tasks/main.yaml b/roles/extra/kind/tasks/main.yaml index 851c067b..93eabc2e 100644 --- a/roles/extra/kind/tasks/main.yaml +++ b/roles/extra/kind/tasks/main.yaml @@ -73,3 +73,25 @@ shell: | sysctl -w fs.inotify.max_user_watches=5242880 sysctl -w fs.inotify.max_user_instances=1280 + +# NOTE: taking advice from https://github.com/kubernetes-sigs/kind/issues/2896#issuecomment-1226184890 +- name: Create containers configuration file if not exists + become: true + file: + path: /etc/containers/containers.conf + state: touched + +- name: Set the containers section + become: true + lineinfile: + path: /etc/containers/containers.conf + regexp: "^[containers]" + line: "[containers]" + +- name: Set the podman limit + become: true + lineinfile: + path: /etc/containers/containers.conf + regexp: "^pids_limit" + line: "pids_limit=0" + insertafter: "[containers]"