瀏覽代碼

Merge pull request #88 from j0hnL/issue-16

Kubeflow install
Lucas A. Wilson 4 年之前
父節點
當前提交
bbf84d2217

+ 22 - 0
kubernetes/kubeflow.yaml

@@ -0,0 +1,22 @@
+#  Copyright 2020 Dell Technologies
+#
+#  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.
+
+---
+#Playbook for installing Kubeflow v1.0 on Omnia
+ 
+# Start K8s worker servers
+- hosts: master
+  gather_facts: false
+  roles:
+    - kubeflow

+ 89 - 0
kubernetes/roles/kubeflow/tasks/main.yml

@@ -0,0 +1,89 @@
+#  Copyright 2020 Dell Technologies
+#
+#  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.
+
+---
+
+#Configure build and deploy kubeflow v1.0 
+
+- name: Download kfctl v1.0.2 release from the Kubeflow releases page.
+  unarchive:
+    src: https://github.com/kubeflow/kfctl/releases/download/v1.0.2/kfctl_v1.0.2-0-ga476281_linux.tar.gz
+    dest: /usr/bin/
+    remote_src: yes
+
+- name: Delete Omnia Kubeflow Directory if exists
+  file:
+    path: /root/k8s/omnia-kubeflow
+    state: absent
+
+- name: Create Kubeflow Directory
+  file:
+    path: /root/k8s/omnia-kubeflow
+    state: directory
+    recurse: yes
+
+- name: Build Kubeflow Configuration
+  shell: 
+    cmd: /usr/bin/kfctl build -V -f https://raw.githubusercontent.com/kubeflow/manifests/v1.0-branch/kfdef/kfctl_k8s_istio.v1.0.2.yaml
+    chdir: /root/k8s/omnia-kubeflow
+
+- name: Modify Cpu Limit for istio-ingressgateway-service-account 
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/istio-install/base/istio-noauth.yaml
+    after: 'serviceAccountName: istio-ingressgateway-service-account'
+    before: '---'
+    regexp: 'cpu: 100m'
+    replace: 'cpu: 2'
+  
+- name: Modify Mem Limit for istio-ingressgateway-service-account 
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/istio-install/base/istio-noauth.yaml
+    after: 'serviceAccountName: istio-ingressgateway-service-account'
+    before: '---'
+    regexp: 'memory: 128Mi'
+    replace: 'memory: 512Mi'
+
+- name: Modify Cpu Request for istio-ingressgateway-service-account 
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/istio-install/base/istio-noauth.yaml
+    after: 'serviceAccountName: istio-ingressgateway-service-account'
+    before: '---'
+    regexp: 'cpu: 10m'
+    replace: 'cpu: 1'
+  
+- name: Modify Mem Request for istio-ingressgateway-service-account 
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/istio-install/base/istio-noauth.yaml
+    after: 'serviceAccountName: istio-ingressgateway-service-account'
+    before: '---'
+    regexp: 'memory: 40Mi'
+    replace: 'memory: 256Mi'
+
+
+- name: Change Argo base service from NodePort to LoadBalancer
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/argo/base/service.yaml
+    regexp: 'NodePort'
+    replace: 'LoadBalancer'
+
+- name: Change istio-install base istio-noauth service from NodePort to LoadBalancer
+  replace:
+    path: /root/k8s/omnia-kubeflow/kustomize/istio-install/base/istio-noauth.yaml
+    regexp: 'NodePort'
+    replace: 'LoadBalancer'
+
+- name: Apply Kubeflow Configuration
+  shell: 
+    cmd: /usr/bin/kfctl apply -V -f /root/k8s/omnia-kubeflow/kfctl_k8s_istio.v1.0.2.yaml
+    chdir: /root/k8s/omnia-kubeflow

+ 2 - 2
kubernetes/roles/startmaster/tasks/main.yml

@@ -18,7 +18,7 @@
   tags: init
 
 - name: Initialize kubeadm
-  command: /bin/kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.0.0.1
+  command: /bin/kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.0.0.100
   #command: /bin/kubeadm init 
   register: init_output 
   tags: init
@@ -53,7 +53,7 @@
     token:  "{{ K8S_TOKEN.stdout }}"
     hash:   "{{ K8S_MASTER_CA_HASH.stdout }}"
     #ip:     "{{ ansible_ib0.ipv4.address }}"
-    ip:     "{{ ansible_p3p1.ipv4.address }}"
+    ip:     "{{ ansible_p1p1.ipv4.address }}"
   tags: init
 
 - name:

+ 1 - 1
kubernetes/roles/startservices/tasks/main.yml

@@ -66,5 +66,5 @@
   tags: init
 
 - name: Install MPI Operator
-  shell: kubectl create -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/mpi-operator.yaml 
+  shell: kubectl create -f https://raw.githubusercontent.com/kubeflow/mpi-operator/master/deploy/v1alpha2/mpi-operator.yaml
   tags: init