123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- ---
- - name: add kubernetes repo
- copy: src=kubernetes.repo dest=/etc/yum.repos.d/ owner=root group=root mode=644
- tags: install
- # add ElRepo GPG Key
- - rpm_key:
- state: present
- key: https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
- tags: install
- - name: add ElRepo (Nvidia kmod drivers)
- yum:
- name: http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
- state: present
- tags: install
- - name: update sysctl to handle incorrectly routed traffic when iptables is bypassed
- copy: src=k8s.conf dest=/etc/sysctl.d/ owner=root group=root mode=644
- tags: install
- - name: update sysctl
- command: /sbin/sysctl --system
- tags: install
- - name: Install EPEL Repository
- yum: name=epel-release state=present
- tags: install
- #likely need to add a reboot hook in here
- #- name: update kernel and all other system packages
- #yum: name=* state=latest
- #tags: install
- - name: disable swap
- command: /sbin/swapoff -a
- tags: install
- # Disable selinux
- - selinux:
- state: disabled
- tags: install
- - name: install common packages
- yum:
- name:
- - yum-plugin-versionlock
- - gcc
- - nfs-utils
- - python-pip
- - docker
- - bash-completion
- - kubelet-1.16.7
- - kubeadm-1.16.7
- - kubectl-1.16.7
- - nvidia-detect
- state: present
- tags: install
- - name: versionlock kubernetes
- command: yum versionlock kubelet-1.16.7 kubectl-1.16.7 kubeadm-1.16.7
- tags: install
-
- - name: install InfiniBand Support
- yum:
- name: "@Infiniband Support"
- state: present
- - name: upgrade pip
- command: /bin/pip install --upgrade pip
- tags: install
- #- name: Enable DevicePlugins for all GPU nodes (nvidia-container-runtime-hook)
- #copy: src=nvidia dest=/usr/libexec/oci/hooks.d/ owner=root group=root mode=755
- #tags: install
- - name: Add KUBE_EXTRA_ARGS to enable GPUs
- lineinfile:
- path: /usr/lib/systemd/system/kubelet.service.d/10-kubeadm.conf
- line: 'Environment="KUBELET_EXTRA_ARGS=--feature-gates=DevicePlugins=true"'
- insertbefore: 'KUBELET_KUBECONFIG_ARGS='
- tags: install
- - name: Start and Enable docker service
- service:
- name: docker
- state: restarted
- enabled: yes
- tags: install
- - name: Start and Enable Kubernetes - kubelet
- service:
- name: kubelet
- state: restarted
- enabled: yes
- tags: install
- - name: Start and rpcbind service
- service:
- name: rpcbind
- state: restarted
- enabled: yes
- tags: install
- - name: Start and nfs-server service
- service:
- name: nfs-server
- state: restarted
- enabled: yes
- tags: install
- - name: Start and nfs-lock service
- service:
- name: nfs-lock
- #state: restarted
- enabled: yes
- tags: install
- - name: Start and nfs-idmap service
- service:
- name: nfs-idmap
- state: restarted
- enabled: yes
- tags: install
|