Skip to content

Commit

Permalink
fix ulimit settings
Browse files Browse the repository at this point in the history
  • Loading branch information
gjmzj committed Sep 2, 2018
1 parent 9e41498 commit 3f85b6d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
11 changes: 1 addition & 10 deletions roles/prepare/tasks/centos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,4 @@
line: "SELINUX=disabled"

- name: 设置 Centos ulimits
lineinfile:
dest: /etc/security/limits.conf
regexp: "{{ item }}"
line: "{{ item }} 65535"
with_items:
- "* soft nofile"
- "* hard nofile"
- "* soft nproc"
- "* hard nproc"

template: src=30-kubeasz.conf.j2 dest=/etc/security/limits.d/30-kubeasz.conf
10 changes: 5 additions & 5 deletions roles/prepare/tasks/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
# 设置系统参数for k8s
# 消除docker info 警告WARNING: bridge-nf-call-ip[6]tables is disabled
- name: 设置系统参数
copy: src=95-k8s-sysctl.conf dest=/etc/sysctl.d/95-k8s-sysctl.conf
template: src=95-k8s-sysctl.conf.j2 dest=/etc/sysctl.d/95-k8s-sysctl.conf

- name: 生效系统参数
shell: "sysctl -p /etc/sysctl.d/95-k8s-sysctl.conf"
ignore_errors: true

- name: 加载内核模块
modprobe: name={{ item }} state=present
Expand All @@ -26,7 +30,3 @@
- nf_conntrack_ipv4
ignore_errors: true

- name: 生效系统参数
shell: "sysctl -p /etc/sysctl.d/95-k8s-sysctl.conf"
ignore_errors: true

2 changes: 2 additions & 0 deletions roles/prepare/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@
regexp: "ulimit -SHn"
line: "ulimit -SHn 65535"

- name: 设置 ulimits2
template: src=30-kubeasz.conf.j2 dest=/etc/security/limits.d/30-kubeasz.conf
4 changes: 4 additions & 0 deletions roles/prepare/templates/30-kubeasz.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
* soft nofile 65535
* hard nofile 65535
* soft nproc 65535
* hard nproc 65535
File renamed without changes.

0 comments on commit 3f85b6d

Please sign in to comment.