From 90b88bb7b4c652f9170472db9cbb557187673b64 Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Wed, 26 Jun 2024 12:23:53 +0000 Subject: [PATCH] Kustomize for aimlfw Introduced kustomize to install kubeflow with leofs. Change-Id: I4d28bc193adf2a28715f0a4634b2324b01c20524 Signed-off-by: subhash kumar singh --- .../aimlfw-configuration-pipeline-patch.yaml | 29 +++++++++++++++++ .../aimlfw-configuration-pipeline-ui-patch.yaml | 27 ++++++++++++++++ tools/kubeflow/aimlfw-kustomize/config | 20 ++++++++++++ tools/kubeflow/aimlfw-kustomize/kustomization.yaml | 31 ++++++++++++++++++ .../minio-artifact-secret-patch.env | 2 ++ tools/kubeflow/aimlfw-kustomize/params.env | 3 ++ .../aimlfw-kustomize/viewer-pod-template.json | 37 ++++++++++++++++++++++ 7 files changed, 149 insertions(+) create mode 100644 tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-patch.yaml create mode 100644 tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-ui-patch.yaml create mode 100644 tools/kubeflow/aimlfw-kustomize/config create mode 100644 tools/kubeflow/aimlfw-kustomize/kustomization.yaml create mode 100644 tools/kubeflow/aimlfw-kustomize/minio-artifact-secret-patch.env create mode 100644 tools/kubeflow/aimlfw-kustomize/params.env create mode 100644 tools/kubeflow/aimlfw-kustomize/viewer-pod-template.json diff --git a/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-patch.yaml b/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-patch.yaml new file mode 100644 index 0000000..86127ef --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-patch.yaml @@ -0,0 +1,29 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ml-pipeline +spec: + template: + metadata: + labels: + app: ml-pipeline + spec: + containers: + - env: + - name: OBJECTSTORECONFIG_SECURE + value: "false" + - name: OBJECTSTORECONFIG_BUCKETNAME + valueFrom: + configMapKeyRef: + name: pipeline-install-config + key: bucketName + - name: OBJECTSTORECONFIG_HOST + valueFrom: + configMapKeyRef: + name: pipeline-install-config + key: minioServiceHost + - name: OBJECTSTORECONFIG_REGION + value: "" + - name: OBJECTSTORECONFIG_PORT + value: "8080" + name: ml-pipeline-api-server diff --git a/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-ui-patch.yaml b/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-ui-patch.yaml new file mode 100644 index 0000000..2a4de38 --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-ui-patch.yaml @@ -0,0 +1,27 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ml-pipeline-ui +spec: + template: + metadata: + labels: + app: ml-pipeline-ui + spec: + volumes: + - name: config-volume + configMap: + name: ml-pipeline-ui-configmap + containers: + - name: ml-pipeline-ui + env: + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: mlpipeline-minio-artifact + key: accesskey + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: mlpipeline-minio-artifact + key: secretkey diff --git a/tools/kubeflow/aimlfw-kustomize/config b/tools/kubeflow/aimlfw-kustomize/config new file mode 100644 index 0000000..94a3825 --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/config @@ -0,0 +1,20 @@ +{ +artifactRepository: +{ + s3: { + bucket: $(kfp-artifact-bucket-name), + keyPrefix: artifacts, + endpoint: leofs.kubeflow:8080, + insecure: true, + accessKeySecret: { + name: mlpipeline-minio-artifact, + key: accesskey + }, + secretKeySecret: { + name: mlpipeline-minio-artifact, + key: secretkey + } + }, + archiveLogs: true +} +} diff --git a/tools/kubeflow/aimlfw-kustomize/kustomization.yaml b/tools/kubeflow/aimlfw-kustomize/kustomization.yaml new file mode 100644 index 0000000..273c63b --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/kustomization.yaml @@ -0,0 +1,31 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: kubeflow +resources: + - ../../env/platform-agnostic +configMapGenerator: + - name: pipeline-install-config + env: params.env + behavior: merge + - name: workflow-controller-configmap + behavior: replace + files: + - config + - name: ml-pipeline-ui-configmap + behavior: replace + files: + - viewer-pod-template.json +secretGenerator: + - name: mlpipeline-minio-artifact + env: minio-artifact-secret-patch.env + behavior: merge +generatorOptions: + disableNameSuffixHash: true +patches: + - path: aimlfw-configuration-pipeline-patch.yaml + - path: aimlfw-configuration-pipeline-ui-patch.yaml +# Identifier for application manager to apply ownerReference. +# The ownerReference ensures the resources get garbage collected +# when application is deleted. +commonLabels: + application-crd-id: kubeflow-pipelines diff --git a/tools/kubeflow/aimlfw-kustomize/minio-artifact-secret-patch.env b/tools/kubeflow/aimlfw-kustomize/minio-artifact-secret-patch.env new file mode 100644 index 0000000..760375d --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/minio-artifact-secret-patch.env @@ -0,0 +1,2 @@ +accesskey=leofs +secretkey= diff --git a/tools/kubeflow/aimlfw-kustomize/params.env b/tools/kubeflow/aimlfw-kustomize/params.env new file mode 100644 index 0000000..1052484 --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/params.env @@ -0,0 +1,3 @@ +bucketName=mlpipeline +minioServiceHost=leofs.kubeflow +minioServiceRegion= \ No newline at end of file diff --git a/tools/kubeflow/aimlfw-kustomize/viewer-pod-template.json b/tools/kubeflow/aimlfw-kustomize/viewer-pod-template.json new file mode 100644 index 0000000..5cce566 --- /dev/null +++ b/tools/kubeflow/aimlfw-kustomize/viewer-pod-template.json @@ -0,0 +1,37 @@ +{ + "spec": { + "containers": [ + { + "env": [ + { + "name": "AWS_ACCESS_KEY_ID", + "valueFrom": { + "secretKeyRef": { + "name": "mlpipeline-minio-artifact", + "key": "accesskey" + } + } + }, + { + "name": "AWS_SECRET_ACCESS_KEY", + "valueFrom": { + "secretKeyRef": { + "name": "mlpipeline-minio-artifact", + "key": "secretkey" + } + } + }, + { + "name": "AWS_REGION", + "valueFrom": { + "configMapKeyRef": { + "name": "pipeline-install-config", + "key": "minioServiceRegion" + } + } + } + ] + } + ] + } +} \ No newline at end of file -- 2.16.6