main.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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: Helm - create service account
  37. #shell: kubectl create serviceaccount --namespace kube-system tiller
  38. #tags: init
  39. #- name: Helm - create clusterRole Binding for tiller-cluster-rule
  40. #shell: kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  41. #tags: init
  42. #- name: Helm - create clusterRoleBinding for admin
  43. #shell: kubectl create clusterrolebinding tiller-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
  44. #tags: init
  45. #- name: Helm - init
  46. #shell: helm init --upgrade
  47. #tags: init
  48. #- name: Wait for tiller to start
  49. #shell: kubectl rollout status deployment/tiller-deploy -n kube-system
  50. #tags: init
  51. #- name: Helm - patch cluster Role Binding for tiller
  52. #shell: kubectl --namespace kube-system patch deploy tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
  53. #tags: init
  54. #- name: Wait for tiller to start
  55. #shell: kubectl rollout status deployment/tiller-deploy -n kube-system
  56. #tags: init
  57. - name: Start K8S Dashboard
  58. shell: kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta6/aio/deploy/recommended.yaml
  59. tags: init
  60. - name: Helm - Add Stable Repo
  61. shell: helm repo add stable https://kubernetes-charts.storage.googleapis.com/
  62. tags: init
  63. - name: Helm - Add JupyterHub Repo
  64. shell: helm repo add jupyterhub https://jupyterhub.github.io/helm-chart/
  65. tags: init
  66. - name: Helm - Update Repo
  67. shell: helm repo update
  68. tags: init
  69. - name: Start NFS Client Provisioner
  70. shell: helm install stable/nfs-client-provisioner --set nfs.server=10.0.0.1 --set nfs.path=/work --generate-name
  71. tags: init
  72. - name: JupyterHub Persistent Volume Creation (files)
  73. copy: src=jhub-db-pv.yaml dest=/root/k8s/jhub-db-pv.yaml owner=root group=root mode=655
  74. tags: init
  75. - name: jupyterHub Persistent Volume creation
  76. shell: kubectl create -f /root/k8s/jhub-db-pv.yaml
  77. tags: init
  78. - name: JupyterHub Custom Config (files)
  79. copy: src=jupyter_config.yaml dest=/root/k8s/jupyter_config.yaml owner=root group=root mode=655
  80. tags: init
  81. - name: jupyterHub deploy
  82. shell: helm install jupyterhub/jupyterhub --namespace default --version 0.9.0 --values /root/k8s/jupyter_config.yaml --generate-name
  83. tags: init
  84. - name: Prometheus deployment
  85. shell: helm install stable/prometheus --set alertmanager.persistentVolume.storageClass=nfs-client,server.persistentVolume.storageClass=nfs-client,server.service.type=LoadBalancer --generate-name
  86. tags: init
  87. - name: Install MPI Operator
  88. shell: kubectl create -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/mpi-operator.yaml
  89. tags: init