main.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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: Wait for CoreDNS to restart
  16. command: kubectl rollout status deployment/coredns -n kube-system
  17. changed_when: false
  18. ignore_errors: True
  19. tags: init
  20. - name: Deploy MetalLB
  21. command: "kubectl apply -f '{{ metallb_yaml_url }}'"
  22. changed_when: true
  23. tags: init
  24. - name: Create MetalLB Setup Config Files
  25. copy:
  26. src: metal-config.yaml
  27. dest: "{{ metallb_config_file_dest }}"
  28. owner: root
  29. group: root
  30. mode: "{{ metallb_config_file_mode }}"
  31. tags: init
  32. - name: Create MetalLB Setup Deployment Files
  33. copy:
  34. src: metallb.yaml
  35. dest: "{{ metallb_deployment_file_dest }}"
  36. owner: root
  37. group: root
  38. mode: "{{ metallb_deployment_file_mode }}"
  39. tags: init
  40. - name: Deploy MetalLB
  41. command: "kubectl apply -f '{{ metallb_deployment_file_dest }}'"
  42. changed_when: true
  43. tags: init
  44. - name: Create default setup for MetalLB
  45. command: "kubectl apply -f '{{ metallb_config_file_dest }}'"
  46. changed_when: true
  47. tags: init
  48. - name: Start k8s dashboard
  49. command: "kubectl create -f '{{ k8s_dashboard_yaml_url }}'"
  50. changed_when: true
  51. register: result
  52. tags: init
  53. - name: Helm - add stable repo
  54. command: "helm repo add stable '{{ helm_stable_repo_url }}'"
  55. changed_when: true
  56. tags: init
  57. - name: Helm - add Nvidia k8s-device-plugin (nvdp) repo
  58. command: "helm repo add nvdp '{{ nvidia_k8s_device_plugin_repo_url }}'"
  59. changed_when: true
  60. tags: init
  61. - name: Helm - add Nvidia GPU discovery (nvgfd) repo
  62. command: "helm repo add nvgfd '{{ nvidia_gpu_discovery_repo_url }}'"
  63. changed_when: true
  64. tags: init
  65. - name: Helm - update repo
  66. command: helm repo update
  67. changed_when: true
  68. tags: init
  69. - name: Start NFS Client Provisioner
  70. command: "helm install stable/nfs-client-provisioner --set nfs.server='{{ nfs_server }}' --set nfs.path='{{ nfs_path }}' --generate-name"
  71. changed_when: true
  72. register: result
  73. tags: init
  74. - name: Set NFS-Client Provisioner as DEFAULT StorageClass
  75. shell: >
  76. kubectl patch storageclasses.storage.k8s.io nfs-client \
  77. -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
  78. changed_when: true
  79. tags: init
  80. - name: Prometheus deployment
  81. command: >
  82. helm install stable/prometheus \
  83. --set alertmanager.persistentVolume.storageClass=nfs-client,server.persistentVolume.storageClass=nfs-client,server.service.type=LoadBalancer \
  84. --generate-name
  85. changed_when: true
  86. tags: init
  87. - name: Install MPI Operator
  88. command: "kubectl create -f '{{ mpi_operator_yaml_url }}'"
  89. changed_when: true
  90. tags: init
  91. - name: Install nvidia-device-plugin
  92. command: "helm install --version='{{ nvidia_device_plugin_version }}' --generate-name --set migStrategy='{{ mig_strategy }}' nvdp/nvidia-device-plugin"
  93. changed_when: true
  94. tags: init
  95. - name: Install GPU Feature Discovery
  96. command: "helm install --version='{{ gpu_feature_discovery_version }}' --generate-name --set migStrategy='{{ mig_strategy }}' nvgfd/gpu-feature-discovery"
  97. changed_when: true
  98. tags: init
  99. - name: Deploy Xilinx Device plugin
  100. command: "kubectl create -f '{{ fpga_device_plugin_yaml_url }}'"
  101. changed_when: true
  102. register: fpga_enable
  103. tags: init