From 4a69964445cc33690dbee5a7cf9b35e89ec0a638 Mon Sep 17 00:00:00 2001 From: Prasath Sivasubramaniyan Date: Mon, 24 Apr 2023 18:20:33 +0530 Subject: [PATCH 1/2] Fixed the docker image --- helm/ml-core-service/templates/configmap.yaml | 57 ++++++++++++------- helm/ml-core-service/values.yaml | 10 +--- 2 files changed, 41 insertions(+), 26 deletions(-) diff --git a/helm/ml-core-service/templates/configmap.yaml b/helm/ml-core-service/templates/configmap.yaml index 68a503ce..22c5c1af 100644 --- a/helm/ml-core-service/templates/configmap.yaml +++ b/helm/ml-core-service/templates/configmap.yaml @@ -3,23 +3,42 @@ kind: ConfigMap metadata: name: {{ .Chart.Name}}-config namespace: {{ .Release.Namespace }} - data: - APP_PORTAL_BASE_URL: {{ .Values.APP_PORTAL_BASE_URL }} - APPLICATION_ENV: {{ .Values.APPLICATION_ENV }} - APPLICATION_PORT: {{ .Values.APPLICATION_PORT | quote}} - AZURE_ACCOUNT_KEY: {{ .Values.AZURE_ACCOUNT_KEY }} - AZURE_ACCOUNT_NAME: {{ .Values.AZURE_ACCOUNT_NAME }} - AZURE_STORAGE_CONTAINER: {{ .Values.AZURE_STORAGE_CONTAINER }} - CLOUD_STORAGE: {{ .Values.CLOUD_STORAGE }} - ELASTICSEARCH_COMMUNICATIONS_ON_OFF: {{ .Values.ELASTICSEARCH_COMMUNICATIONS_ON_OFF }} - ELASTICSEARCH_ENTITIES_INDEX: {{ .Values.ELASTICSEARCH_ENTITIES_INDEX | quote}} - ELASTICSEARCH_HOST_URL: {{ .Values.ELASTICSEARCH_HOST_URL | quote}} - ENABLE_CONSOLE_LOGGING: {{ .Values.ENABLE_CONSOLE_LOGGING }} - GOTENBERG_SERVICE_URL: {{ .Values.GOTENBERG_SERVICE_URL }} - INTERNAL_ACCESS_TOKEN: {{ .Values.INTERNAL_ACCESS_TOKEN }} - KEYCLOAK_PUBLIC_KEY_PATH: {{ .Values.KEYCLOAK_PUBLIC_KEY_PATH }} - ML_PROJECT_SERVICE_URL: {{ .Values.ML_PROJECT_SERVICE_URL }} - ML_SURVEY_SERVICE_URL: {{ .Values.ML_SURVEY_SERVICE_URL }} - MONGODB_URL: {{ .Values.MONGODB_URL }} - USER_SERVICE_URL: {{ .Values.USER_SERVICE_URL }} \ No newline at end of file + APP_PORTAL_BASE_URL: https://staging.sunbirded.org + APPLICATION_ENV: staging + APPLICATION_PORT: "3000" + AZURE_ACCOUNT_KEY: 7xfCipYY8YcaYRWZ+d0nQmTrjhjv5RC7MQJlbOQHG58+Bx2ZvYlWqtPTLwbVOkeL9f0NgA2frTxD1vnrTWpUxA== + AZURE_ACCOUNT_NAME: sunbirdstagingpublic + AZURE_STORAGE_CONTAINER: samiksha + CLOUD_STORAGE: AZURE + ELASTICSEARCH_COMMUNICATIONS_ON_OFF: "OFF" + ELASTICSEARCH_ENTITIES_INDEX: "" + ELASTICSEARCH_HOST_URL: "" + ENABLE_CONSOLE_LOGGING: "OFF" + GOTENBERG_SERVICE_URL: http://gotenberg-service:3000 + INTERNAL_ACCESS_TOKEN: e7220b7539363210ed15 + KEYCLOAK_PUBLIC_KEY_PATH: keycloak-public-keys + ML_PROJECT_SERVICE_URL: http://ml-projects-service:3000 + ML_SURVEY_SERVICE_URL: http://ml-survey-service:3000 + MONGODB_URL: mongodb://11.3.2.26:27017/ml-survey + USER_SERVICE_URL: http://learner-service:9000 + +# data: +# APP_PORTAL_BASE_URL: {{ .Values.APP_PORTAL_BASE_URL }} +# APPLICATION_ENV: {{ .Values.APPLICATION_ENV }} +# APPLICATION_PORT: {{ .Values.APPLICATION_PORT | quote}} +# AZURE_ACCOUNT_KEY: {{ .Values.AZURE_ACCOUNT_KEY }} +# AZURE_ACCOUNT_NAME: {{ .Values.AZURE_ACCOUNT_NAME }} +# AZURE_STORAGE_CONTAINER: {{ .Values.AZURE_STORAGE_CONTAINER }} +# CLOUD_STORAGE: {{ .Values.CLOUD_STORAGE }} +# ELASTICSEARCH_COMMUNICATIONS_ON_OFF: {{ .Values.ELASTICSEARCH_COMMUNICATIONS_ON_OFF }} +# ELASTICSEARCH_ENTITIES_INDEX: {{ .Values.ELASTICSEARCH_ENTITIES_INDEX | quote}} +# ELASTICSEARCH_HOST_URL: {{ .Values.ELASTICSEARCH_HOST_URL | quote}} +# ENABLE_CONSOLE_LOGGING: {{ .Values.ENABLE_CONSOLE_LOGGING }} +# GOTENBERG_SERVICE_URL: {{ .Values.GOTENBERG_SERVICE_URL }} +# INTERNAL_ACCESS_TOKEN: {{ .Values.INTERNAL_ACCESS_TOKEN }} +# KEYCLOAK_PUBLIC_KEY_PATH: {{ .Values.KEYCLOAK_PUBLIC_KEY_PATH }} +# ML_PROJECT_SERVICE_URL: {{ .Values.ML_PROJECT_SERVICE_URL }} +# ML_SURVEY_SERVICE_URL: {{ .Values.ML_SURVEY_SERVICE_URL }} +# MONGODB_URL: {{ .Values.MONGODB_URL }} +# USER_SERVICE_URL: {{ .Values.USER_SERVICE_URL }} diff --git a/helm/ml-core-service/values.yaml b/helm/ml-core-service/values.yaml index 2b48e8ef..0d8a602e 100644 --- a/helm/ml-core-service/values.yaml +++ b/helm/ml-core-service/values.yaml @@ -26,13 +26,9 @@ USER_SERVICE_URL: http://learner-service:9000 replicaCount: 1 -image: - registry: sunbirded.azurecr.io - repository: sunbirded.azurecr.io/ml-core-service - tag: release-5.2.0 - pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. - +dockerhub: docker.io +repository: tsprasath91/ml-core-service +image_tag: release-5.2.0_1159b45_4 imagePullSecrets: [] nameOverride: "" From 1c0739e44d622ca516bfacaa750e9bb52c564c2d Mon Sep 17 00:00:00 2001 From: Prasath Sivasubramaniyan Date: Mon, 24 Apr 2023 18:56:15 +0530 Subject: [PATCH 2/2] Fixed the configmap --- helm/ml-core-service/templates/_helpers.tpl | 62 ------------------- helm/ml-core-service/templates/configmap.yaml | 52 +++++----------- .../templates/tests/test-connection.yaml | 15 ----- helm/ml-core-service/values.yaml | 40 ++++++------ 4 files changed, 32 insertions(+), 137 deletions(-) delete mode 100644 helm/ml-core-service/templates/_helpers.tpl delete mode 100644 helm/ml-core-service/templates/tests/test-connection.yaml diff --git a/helm/ml-core-service/templates/_helpers.tpl b/helm/ml-core-service/templates/_helpers.tpl deleted file mode 100644 index 159571ac..00000000 --- a/helm/ml-core-service/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "ml-core-servire.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "ml-core-servire.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "ml-core-servire.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "ml-core-servire.labels" -}} -helm.sh/chart: {{ include "ml-core-servire.chart" . }} -{{ include "ml-core-servire.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "ml-core-servire.selectorLabels" -}} -app.kubernetes.io/name: {{ include "ml-core-servire.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "ml-core-servire.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "ml-core-servire.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} diff --git a/helm/ml-core-service/templates/configmap.yaml b/helm/ml-core-service/templates/configmap.yaml index 22c5c1af..9320c81d 100644 --- a/helm/ml-core-service/templates/configmap.yaml +++ b/helm/ml-core-service/templates/configmap.yaml @@ -4,41 +4,17 @@ metadata: name: {{ .Chart.Name}}-config namespace: {{ .Release.Namespace }} data: - APP_PORTAL_BASE_URL: https://staging.sunbirded.org - APPLICATION_ENV: staging - APPLICATION_PORT: "3000" - AZURE_ACCOUNT_KEY: 7xfCipYY8YcaYRWZ+d0nQmTrjhjv5RC7MQJlbOQHG58+Bx2ZvYlWqtPTLwbVOkeL9f0NgA2frTxD1vnrTWpUxA== - AZURE_ACCOUNT_NAME: sunbirdstagingpublic - AZURE_STORAGE_CONTAINER: samiksha - CLOUD_STORAGE: AZURE - ELASTICSEARCH_COMMUNICATIONS_ON_OFF: "OFF" - ELASTICSEARCH_ENTITIES_INDEX: "" - ELASTICSEARCH_HOST_URL: "" - ENABLE_CONSOLE_LOGGING: "OFF" - GOTENBERG_SERVICE_URL: http://gotenberg-service:3000 - INTERNAL_ACCESS_TOKEN: e7220b7539363210ed15 - KEYCLOAK_PUBLIC_KEY_PATH: keycloak-public-keys - ML_PROJECT_SERVICE_URL: http://ml-projects-service:3000 - ML_SURVEY_SERVICE_URL: http://ml-survey-service:3000 - MONGODB_URL: mongodb://11.3.2.26:27017/ml-survey - USER_SERVICE_URL: http://learner-service:9000 - -# data: -# APP_PORTAL_BASE_URL: {{ .Values.APP_PORTAL_BASE_URL }} -# APPLICATION_ENV: {{ .Values.APPLICATION_ENV }} -# APPLICATION_PORT: {{ .Values.APPLICATION_PORT | quote}} -# AZURE_ACCOUNT_KEY: {{ .Values.AZURE_ACCOUNT_KEY }} -# AZURE_ACCOUNT_NAME: {{ .Values.AZURE_ACCOUNT_NAME }} -# AZURE_STORAGE_CONTAINER: {{ .Values.AZURE_STORAGE_CONTAINER }} -# CLOUD_STORAGE: {{ .Values.CLOUD_STORAGE }} -# ELASTICSEARCH_COMMUNICATIONS_ON_OFF: {{ .Values.ELASTICSEARCH_COMMUNICATIONS_ON_OFF }} -# ELASTICSEARCH_ENTITIES_INDEX: {{ .Values.ELASTICSEARCH_ENTITIES_INDEX | quote}} -# ELASTICSEARCH_HOST_URL: {{ .Values.ELASTICSEARCH_HOST_URL | quote}} -# ENABLE_CONSOLE_LOGGING: {{ .Values.ENABLE_CONSOLE_LOGGING }} -# GOTENBERG_SERVICE_URL: {{ .Values.GOTENBERG_SERVICE_URL }} -# INTERNAL_ACCESS_TOKEN: {{ .Values.INTERNAL_ACCESS_TOKEN }} -# KEYCLOAK_PUBLIC_KEY_PATH: {{ .Values.KEYCLOAK_PUBLIC_KEY_PATH }} -# ML_PROJECT_SERVICE_URL: {{ .Values.ML_PROJECT_SERVICE_URL }} -# ML_SURVEY_SERVICE_URL: {{ .Values.ML_SURVEY_SERVICE_URL }} -# MONGODB_URL: {{ .Values.MONGODB_URL }} -# USER_SERVICE_URL: {{ .Values.USER_SERVICE_URL }} + APPLICATION_ENV: "{{ .Values.application_env }}" + APPLICATION_PORT: "{{ .Values.application_port }}" + APP_PORTAL_BASE_URL: "{{ .Values.app_portal_base_url }}" + AZURE_ACCOUNT_KEY: "{{ .Values.azure_account_key }}" + AZURE_ACCOUNT_NAME: "{{ .Values.azure_account_name }}" + AZURE_STORAGE_CONTAINER: "{{ .Values.azure_storage_container }}" + CLOUD_STORAGE: "{{ .Values.cloud_storage }}" + GOTENBERG_SERVICE_URL: "{{ .Values.gotenberg_service_url }}" + INTERNAL_ACCESS_TOKEN: "{{ .Values.internal_access_token }}" + KEYCLOAK_PUBLIC_KEY_PATH: "{{ .Values.keycloak_public_key_path }}" + ML_PROJECT_SERVICE_URL: "{{ .Values.ml_project_service_url }}" + ML_SURVEY_SERVICE_URL: "{{ .Values.ml_survey_service_url }}" + MONGODB_URL: "{{ .Values.mongodb_url }}" + USER_SERVICE_URL: "{{ .Values.user_service_url }}" \ No newline at end of file diff --git a/helm/ml-core-service/templates/tests/test-connection.yaml b/helm/ml-core-service/templates/tests/test-connection.yaml deleted file mode 100644 index 14d679fa..00000000 --- a/helm/ml-core-service/templates/tests/test-connection.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ include "ml-core-servire.fullname" . }}-test-connection" - labels: - {{- include "ml-core-servire.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['{{ include "ml-core-servire.fullname" . }}:{{ .Values.service.port }}'] - restartPolicy: Never diff --git a/helm/ml-core-service/values.yaml b/helm/ml-core-service/values.yaml index 0d8a602e..71ad7715 100644 --- a/helm/ml-core-service/values.yaml +++ b/helm/ml-core-service/values.yaml @@ -2,37 +2,33 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. +app_portal_base_url: https://staging.sunbirded.org +application_env: staging +application_port: "3000" +azure_account_key: 7xfcipyy8ycayrwz+d0nqmtrjhjv5rc7mqjlboqhg58+bx2zvylwqtptlwbvokel9f0nga2frtxd1vnrtwpuxa== +azure_account_name: sunbirdstagingpublic +azure_storage_container: samiksha +cloud_storage: azure +elasticsearch_communications_on_off: "off" +elasticsearch_entities_index: "" +elasticsearch_host_url: "" +enable_console_logging: "off" +gotenberg_service_url: http://gotenberg-service:3000 +internal_access_token: e7220b7539363210ed15 +keycloak_public_key_path: keycloak-public-keys +ml_project_service_url: http://ml-projects-service:3000 +ml_survey_service_url: http://ml-survey-service:3000 +mongodb_url: mongodb://11.3.2.26:27017/ml-survey +user_service_url: http://learner-service:9000 -APP_PORTAL_BASE_URL: https://staging.sunbirded.org -APPLICATION_ENV: staging -APPLICATION_PORT: "3000" -AZURE_ACCOUNT_KEY: 7xfCipYY8YcaYRWZ+d0nQmTrjhjv5RC7MQJlbOQHG58+Bx2ZvYlWqtPTLwbVOkeL9f0NgA2frTxD1vnrTWpUxA== -AZURE_ACCOUNT_NAME: sunbirdstagingpublic -AZURE_STORAGE_CONTAINER: samiksha -CLOUD_STORAGE: AZURE -ELASTICSEARCH_COMMUNICATIONS_ON_OFF: "OFF" -ELASTICSEARCH_ENTITIES_INDEX: "" -ELASTICSEARCH_HOST_URL: "" -ENABLE_CONSOLE_LOGGING: "OFF" -GOTENBERG_SERVICE_URL: http://gotenberg-service:3000 -INTERNAL_ACCESS_TOKEN: e7220b7539363210ed15 -KEYCLOAK_PUBLIC_KEY_PATH: keycloak-public-keys -ML_PROJECT_SERVICE_URL: http://ml-projects-service:3000 -ML_SURVEY_SERVICE_URL: http://ml-survey-service:3000 -MONGODB_URL: mongodb://11.3.2.26:27017/ml-survey -USER_SERVICE_URL: http://learner-service:9000 - replicaCount: 1 - dockerhub: docker.io repository: tsprasath91/ml-core-service image_tag: release-5.2.0_1159b45_4 imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" serviceAccount: # Specifies whether a service account should be created