Skip to content

Commit 9d08448

Browse files
DespireCI/CD pipeline
andauthored
update limits (#1679)
Closes #1633 --------- Co-authored-by: CI/CD pipeline <CI/CD-pipeline@users.noreply.github.com>
1 parent 49239b7 commit 9d08448

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

manifests/claudie/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
5757
kind: Kustomization
5858
images:
5959
- name: ghcr.io/berops/claudie/ansibler
60-
newTag: 5d487af-3268
60+
newTag: 0940997-3281
6161
- name: ghcr.io/berops/claudie/autoscaler-adapter
6262
newTag: 19ec4b8-3279
6363
- name: ghcr.io/berops/claudie/builder

services/ansibler/server/ansible-playbooks/longhorn-req.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
- hosts: all
33
gather_facts: no
44
become: yes
5+
vars:
6+
nofile_soft: 65535
7+
nofile_hard: 65535
8+
file_max: 2097152
59
# Install longhorn dependencies
610
tasks:
711
- name: install open-iscsi
@@ -34,3 +38,49 @@
3438
# some cloud providers may not use the multipathd service
3539
# thus make the error not fatal.
3640
ignore_errors: yes
41+
42+
# Update node limits.
43+
- name: Modify limits.conf
44+
blockinfile:
45+
path: /etc/security/limits.conf
46+
block: |
47+
* soft nofile {{ nofile_soft }}
48+
* hard nofile {{ nofile_hard }}
49+
root soft nofile {{ nofile_soft }}
50+
root hard nofile {{ nofile_hard }}
51+
state: present
52+
53+
- name: Ensure PAM limits are enabled
54+
lineinfile:
55+
path: /etc/pam.d/common-session
56+
line: "session required pam_limits.so"
57+
state: present
58+
59+
- name: Ensure PAM limits are enabled for non-interactive sessions
60+
lineinfile:
61+
path: /etc/pam.d/common-session-noninteractive
62+
line: "session required pam_limits.so"
63+
state: present
64+
65+
- name: Configure systemd system limits
66+
ansible.builtin.lineinfile:
67+
path: /etc/systemd/system.conf
68+
regexp: "^#?DefaultLimitNOFILE="
69+
line: "DefaultLimitNOFILE={{ nofile_hard }}"
70+
71+
- name: Configure systemd user limits
72+
ansible.builtin.lineinfile:
73+
path: /etc/systemd/user.conf
74+
regexp: "^#?DefaultLimitNOFILE="
75+
line: "DefaultLimitNOFILE={{ nofile_hard }}"
76+
77+
- name: Reload systemd configuration
78+
ansible.builtin.systemd:
79+
daemon_reload: yes
80+
81+
- name: Set kernel file handle maximum
82+
ansible.builtin.sysctl:
83+
name: fs.file-max
84+
value: "{{ file_max }}"
85+
state: present
86+
reload: yes

0 commit comments

Comments
 (0)