main.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 2020 Dell Inc. or its subsidiaries. All Rights Reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ---
  15. #- name: Kick CoreDNS (this is a hack that needs to be fixed)
  16. #shell: kubectl get pods -n kube-system --no-headers=true | awk '/coredns/{print $1}'|xargs kubectl delete -n kube-system pod
  17. #tags: init
  18. - name: Wait for CoreDNS to restart
  19. shell: kubectl rollout status deployment/coredns -n kube-system
  20. tags: init
  21. - name: Deploy MetalLB
  22. shell: kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.1/manifests/metallb.yaml
  23. tags: init
  24. - name: Create MetalLB Setup Config Files
  25. copy: src=metal-config.yaml dest=/root/k8s/metal-config.yaml owner=root group=root mode=655
  26. tags: init
  27. - name: Create MetalLB Setup Deployment Files
  28. copy: src=metallb.yaml dest=/root/k8s/metallb.yaml owner=root group=root mode=655
  29. tags: init
  30. - name: Deploy MetalLB
  31. shell: kubectl apply -f /root/k8s/metallb.yaml
  32. tags: init
  33. - name: Create default setup for MetalLB
  34. shell: kubectl apply -f /root/k8s/metal-config.yaml
  35. tags: init
  36. - name: Start K8S Dashboard
  37. shell: kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml
  38. tags: init
  39. - name: Helm - Add Stable Repo
  40. shell: helm repo add stable https://charts.helm.sh/stable
  41. tags: init
  42. - name: Helm - Add Nvidia k8s-device-plugin (nvdp) Repo
  43. shell: helm repo add nvdp https://nvidia.github.io/k8s-device-plugin
  44. tags: init
  45. - name: Helm - Add Nvidia GPU Discovery (nvgfd) Repo
  46. shell: helm repo add nvgfd https://nvidia.github.io/gpu-feature-discovery
  47. tags: init
  48. - name: Helm - Update Repo
  49. shell: helm repo update
  50. tags: init
  51. - name: Start NFS Client Provisioner
  52. shell: helm install stable/nfs-client-provisioner --set nfs.server={{ nfs_server }} --set nfs.path={{ nfs_path }} --generate-name
  53. tags: init
  54. - name: Set NFS-Client Provisioner as DEFAULT StorageClass
  55. shell: "kubectl patch storageclasses.storage.k8s.io nfs-client -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'"
  56. tags: init
  57. - name: Prometheus deployment
  58. shell: helm install stable/prometheus --set alertmanager.persistentVolume.storageClass=nfs-client,server.persistentVolume.storageClass=nfs-client,server.service.type=LoadBalancer --generate-name
  59. tags: init
  60. - name: Install MPI Operator
  61. shell: kubectl create -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v1alpha2/mpi-operator.yaml
  62. tags: init
  63. - name: Install nvidia-device-plugin
  64. shell: helm install --version=0.7.0 --generate-name --set migStrategy={{ MIG_STRATEGY }} nvdp/nvidia-device-plugin
  65. tags: init
  66. - name: Install GPU Feature Discovery
  67. shell: helm install --version=0.2.0 --generate-name --set migStrategy={{ MIG_STRATEGY }} nvgfd/gpu-feature-discovery
  68. tags: init