Kustomize for aimlfw 33/13033/3
authorsubhash kumar singh <subh.singh@samsung.com>
Wed, 26 Jun 2024 12:23:53 +0000 (12:23 +0000)
committersubhash kumar singh <subh.singh@samsung.com>
Wed, 26 Jun 2024 12:43:07 +0000 (12:43 +0000)
Introduced kustomize to install kubeflow with leofs.

Change-Id: I4d28bc193adf2a28715f0a4634b2324b01c20524
Signed-off-by: subhash kumar singh <subh.singh@samsung.com>
tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-patch.yaml [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/aimlfw-configuration-pipeline-ui-patch.yaml [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/config [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/kustomization.yaml [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/minio-artifact-secret-patch.env [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/params.env [new file with mode: 0644]
tools/kubeflow/aimlfw-kustomize/viewer-pod-template.json [new file with mode: 0644]

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 (file)
index 0000000..86127ef
--- /dev/null
@@ -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 (file)
index 0000000..2a4de38
--- /dev/null
@@ -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 (file)
index 0000000..94a3825
--- /dev/null
@@ -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 (file)
index 0000000..273c63b
--- /dev/null
@@ -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 (file)
index 0000000..760375d
--- /dev/null
@@ -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 (file)
index 0000000..1052484
--- /dev/null
@@ -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 (file)
index 0000000..5cce566
--- /dev/null
@@ -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