main.yml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 2020 Dell Technologies
  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-beta6/aio/deploy/recommended.yaml
  38. tags: init
  39. - name: Helm - Add Stable Repo
  40. shell: helm repo add stable https://kubernetes-charts.storage.googleapis.com/
  41. tags: init
  42. - name: Helm - Update Repo
  43. shell: helm repo update
  44. tags: init
  45. - name: Start NFS Client Provisioner
  46. shell: helm install stable/nfs-client-provisioner --set nfs.server=10.0.0.1 --set nfs.path=/work --generate-name
  47. tags: init
  48. - name: Set NFS-Client Provisioner as DEFAULT StorageClass
  49. shell: "kubectl patch storageclasses.storage.k8s.io nfs-client -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'"
  50. tags: init
  51. - name: Prometheus deployment
  52. shell: helm install stable/prometheus --set alertmanager.persistentVolume.storageClass=nfs-client,server.persistentVolume.storageClass=nfs-client,server.service.type=LoadBalancer --generate-name
  53. tags: init
  54. - name: Install MPI Operator
  55. shell: kubectl create -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v1alpha2/mpi-operator.yaml
  56. tags: init