helm files for tm component installation 74/9674/1
authorjosephthaliath <jo.thaliath@samsung.com>
Thu, 17 Nov 2022 06:10:11 +0000 (11:40 +0530)
committerjosephthaliath <jo.thaliath@samsung.com>
Thu, 17 Nov 2022 06:12:25 +0000 (11:42 +0530)
Issue-Id: AIMLFW-4

Signed-off-by: josephthaliath <jo.thaliath@samsung.com>
Change-Id: I26d3bcdc8575b35fd37eecf69668a425b52e8865

helm/tm/Chart.yaml [new file with mode: 0644]
helm/tm/requirements.yaml [new file with mode: 0644]
helm/tm/templates/configmap.yaml [new file with mode: 0644]
helm/tm/templates/deployment.yaml [new file with mode: 0644]
helm/tm/templates/service.yaml [new file with mode: 0644]
helm/tm/values.yaml [new file with mode: 0644]

diff --git a/helm/tm/Chart.yaml b/helm/tm/Chart.yaml
new file mode 100644 (file)
index 0000000..838d4fb
--- /dev/null
@@ -0,0 +1,23 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+apiVersion: v1
+name: tm
+description: Helm chart for training manager
+type: application
+version: 1.0.0
+appVersion: "1.0.0"
diff --git a/helm/tm/requirements.yaml b/helm/tm/requirements.yaml
new file mode 100644 (file)
index 0000000..9b38f1d
--- /dev/null
@@ -0,0 +1,21 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+dependencies:
+  - name: aimlfw-common
+    version: 1.0.0
+    repository: "@local"
diff --git a/helm/tm/templates/configmap.yaml b/helm/tm/templates/configmap.yaml
new file mode 100644 (file)
index 0000000..94c707d
--- /dev/null
@@ -0,0 +1,34 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+kind: ConfigMap 
+apiVersion: v1 
+metadata:
+  name: tm-configmap
+  namespace: {{ include "common.namespace.platform" . }}
+data:
+  # Configuration values can be set as key-value properties
+  KF_ADAPTER_PORT: "{{ include "common.serviceport.kfadapter.http" .  }}"
+  KF_ADAPTER_IP: "{{ include "common.servicehost.kfadapter.http" .  }}"
+  DATA_EXTRACTION_API_IP: "{{ include "common.servicehost.data-extraction.http" .  }}"
+  DATA_EXTRACTION_API_PORT: "{{ include "common.serviceport.data-extraction.http" .  }}"
+  TRAINING_MANAGER_PORT: "{{ include "common.serviceport.tm.http" .  }}"
+  TRAINING_MANAGER_IP: {{ .Values.traininghost.ip_address }}
+  PS_USER: postgres
+  PS_IP: tm-db-postgresql.traininghost
+  PS_PORT: "5432"
+  PYTHONUNBUFFERED: "0"
diff --git a/helm/tm/templates/deployment.yaml b/helm/tm/templates/deployment.yaml
new file mode 100644 (file)
index 0000000..dad292d
--- /dev/null
@@ -0,0 +1,64 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: {{ include "tm.fullname" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    {{- include "tm.labels" . | nindent 4 }}
+spec:
+  selector:
+    matchLabels:
+      {{- include "tm.selectorLabels" . | nindent 6 }}
+  template:
+    metadata:
+      {{- with .Values.podAnnotations }}
+      annotations:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      labels:
+        {{- include "tm.selectorLabels" . | nindent 8 }}
+    spec:
+      {{- with .Values.imagePullSecrets }}
+      imagePullSecrets:
+        {{- toYaml . | nindent 8 }}
+      {{- end }}
+      
+      securityContext:
+        {{- toYaml .Values.podSecurityContext | nindent 8 }}
+      containers:
+        - name: {{ .Chart.Name }}
+          image: "{{ .Values.tm.image.repository }}:{{ .Values.tm.image.tag | default .Chart.AppVersion }}"
+          imagePullPolicy: {{ .Values.tm.image.pullPolicy }}
+          env:
+            - name: PS_PASSWORD
+              valueFrom:
+                secretKeyRef:
+                  name: tm-db-postgresql
+                  key: postgres-password
+          ports:
+            - name: serviceport
+              containerPort: {{ include "common.serviceport.tm.http" .  }}
+              protocol: TCP
+          workingDir: /home/app/trainingmgr/
+          command: ["python3"]
+          args: [trainingmgr_main.py]
+          envFrom:
+            - configMapRef:
+                name: tm-configmap
diff --git a/helm/tm/templates/service.yaml b/helm/tm/templates/service.yaml
new file mode 100644 (file)
index 0000000..7c6a77e
--- /dev/null
@@ -0,0 +1,34 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ include "tm.fullname" . }}
+  namespace: {{ include "common.namespace.platform" . }}
+  labels:
+    {{- include "tm.labels" . | nindent 4 }}
+spec:
+  type: NodePort
+  ports:
+    - port: {{ include "common.serviceport.tm.http" .  }}
+      targetPort: {{ include "common.serviceport.tm.http" .  }}
+      nodePort: {{ include "common.serviceport.tm.http" .  }}
+      protocol: TCP
+      name: serviceport
+  selector:
+    {{- include "tm.selectorLabels" . | nindent 4 }}
diff --git a/helm/tm/values.yaml b/helm/tm/values.yaml
new file mode 100644 (file)
index 0000000..2c20eb8
--- /dev/null
@@ -0,0 +1,24 @@
+# ==================================================================================
+#
+#       Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+#
+#   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.
+#
+# ==================================================================================
+# Default values for tm component.
+
+image:
+  repository: tm
+  pullPolicy: IfNotPresent
+  # Overrides the image tag whose default is the chart appVersion.
+  tag: "latest"