Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ML related helm charts #60

Open
wants to merge 1 commit into
base: release-7.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions helmcharts/edbb/charts/gotenberg/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: gotenberg
version: 0.1.0
44 changes: 44 additions & 0 deletions helmcharts/edbb/charts/gotenberg/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "common.names.fullname" . }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "common.names.name" . }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "common.names.name" . }}
spec:
containers:
- name: {{ .Chart.Name }}
image: thecodingmachine/gotenberg:7
imagePullPolicy: Always
ports:
- name: gotenberg
containerPort: 3000

---
apiVersion: v1
kind: Service
metadata:
name: {{ include "common.names.fullname" . }}
labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- name: gotenberg
port: 3000
targetPort: 3000
selector:
app.kubernetes.io/name: {{ include "common.names.name" . }}
31 changes: 31 additions & 0 deletions helmcharts/edbb/charts/gotenberg/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ .Chart.Name }}
namespace: {{ .Values.namespace }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ .Chart.Name }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
40 changes: 40 additions & 0 deletions helmcharts/edbb/charts/gotenberg/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
nameOverride: "gotenberg-service"
fullnameOverride: "gotenberg-service"

replicaCount: 1

resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 500Mi

service:
type: ClusterIP
ports:
- name: gotenberg-service
port: 3000
targetPort: 3000

commonAnnotations:
reloader.stakater.com/auto: "true"

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 100
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
5 changes: 5 additions & 0 deletions helmcharts/edbb/charts/ml-core-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: ml-core-service
version: 0.1.0
90 changes: 90 additions & 0 deletions helmcharts/edbb/charts/ml-core-service/configs/env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# ML core Service Config
#
# Port on which the service will listen to
APPLICATION_PORT: "3000"

#Application ENV example local/dev/production
APPLICATION_ENV: "{{ .Values.global.env | default "dev" }}"

# Setting to turn on/off console logs
ENABLE_CONSOLE_LOGGING: "{{ .Values.ml_core_enable_debug_logging | default "OFF" }}"

# Mongo DB Configuration
MONGODB_URL: "{{ .Values.ml_mongodb_url | default "mongodb://edbb-mongodb:27017/ml-survey"}}"

# Secure token access Admin related API's
# The value of internal access token can be generated by command - "openssl rand -hex 10
INTERNAL_ACCESS_TOKEN: "{{ .Values.ml_core_internal_access_token | default "a1f428959d68d5239e03"}}"

#Gotenberg configuration
GOTENBERG_SERVICE_URL: "http://gotenberg-service:3000"


# CLOUD STORAGE
CLOUD_STORAGE_PROVIDER: "{{.Values.global.cloud_service_provider | default "azure"}}"
CLOUD_STORAGE_ACCOUNTNAME: "{{.Values.global.azure_storage_account_name }}"
CLOUD_STORAGE_SECRET: "{{ .Values.global.azure_storage_account_key }}"
CLOUD_STORAGE_BUCKETNAME: "{{ .Values.ml_container | default "ml_contents"}}"
CLOUD_STORAGE_REGION: "{{ .Values.global.cloud_private_storage_region | default "" }}"
CLOUD_STORAGE_PROJECT: "{{ .Values.global.cloud_private_storage_project | default "" }}"
CLOUD_ENDPOINT: "{{ .Values.global.cloud_public_storage_endpoint | default "" }}"


# OFFLINE TOKEN VALIDATION
# Offline token validation public key paths
KEYCLOAK_PUBLIC_KEY_PATH: "{{ .Values.ml_core_keycloak_public_key_path | default "keycloak-public-keys" }}"

# ML Survey Service
ML_SURVEY_SERVICE_URL: "http://ml-survey-service:3000"

# ML Project Service Service
ML_PROJECT_SERVICE_URL: "http://ml-projects-service:3000"

# Elastic search configurations
# Elastic search enable/disable flag E.g. ON/OFF
ELASTICSEARCH_COMMUNICATIONS_ON_OFF: "{{ .Values.ml_core_elasticsearch_communications_on_off | default "OFF" }}"

# Elastic search host url
ELASTICSEARCH_HOST_URL: "{{ .Values.ml_core_elasticsearch_host_url | default "http://elasticsearch:9200" }}"

# Elastic search index name for entities
ELASTICSEARCH_ENTITIES_INDEX: "{{ .Values.ml_core_elasticsearch_user_extension_index_type | default "ml-user"}}"

# Base url of the sunbird enviornment
USER_SERVICE_URL: "http://userorg-service:9000"

## portal url of env
APP_PORTAL_BASE_URL: "https://{{ .Values.global.domain }}"

# Kafka enable or disable communication flag
KAFKA_COMMUNICATIONS_ON_OFF: "{{ .Values.ml_core_kafka_communications_on_off | default "ON" }}"

# IP address of kafka server with port without HTTP
KAFKA_URL: "kafka:9092"

# Kafka consumer group for ML Core Service
KAFKA_GROUP_ID: "ml-core-service"

#Kafka topic name for pushing programUsers
PROGRAM_USERS_JOINED_TOPIC: "{{ .Values.global.env }}.programuser.info"

#TimeOffset with respect to UTC
TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC: "+05:30"

#Validate Entities enable/Disable
VALIDATE_ENTITIES: "{{ .Values.ml_service_validate_entities | default "ON" }}"

#User Delete on and off flow
USER_DELETE_ON_OFF: "{{ .Values.manage_learn_user_delete_on_off | default "ON" }}"

#Topic name for user delete event consumer Topic Name
USER_DELETE_TOPIC: "{{ .Values.global.env }}.delete.user"

#ml core service id
ID: "{{ .Values.global.env }}.{{.Values.global.sunbird_instance | default "sunbird"}}.ml.core.service"

#Telemetry enable/disbale service
TELEMETRY_ON_OFF: "{{ .Values.manage_learn_telemetry_on_off | default "ON" }}"

#Topic name for telemetry
TELEMETRY_TOPIC: "{{ .Values.global.env }}.telemetry.raw"
90 changes: 90 additions & 0 deletions helmcharts/edbb/charts/ml-core-service/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{{- if .Values.configmap.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}
labels:
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{ include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
data:
{{- $currentScope := .}}
{{- range $path, $_ := .Files.Glob "configs/*" }} # Take only root level files (configs/*) for configmaps
{{- if ne $path "configs/env.yaml" }} # Skip env.yaml as configmap, as it's env file
{{ base $path | nindent 2 }}: |-
{{- with $currentScope }}
{{- $var := .Files.Get $path }}
{{- include "common.tplvalues.render" (dict "value" $var "context" $) | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-env
labels:
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{ include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
data:
{{- $var := .Files.Get "configs/env.yaml" }}
{{- include "common.tplvalues.render" (dict "value" $var "context" $) | nindent 2 }}

{{- if .Values.opa_enabled }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-opa
labels:
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{ include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
data:
{{- $currentScope := .}}
{{- range $path, $_ := .Files.Glob "configs/opa/**" }}
{{ base $path | nindent 2 }}: |-
{{- with $currentScope }}
{{- $var := .Files.Get $path }}
{{- include "common.tplvalues.render" (dict "value" $var "context" $) | nindent 6 }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-envoy
labels:
{{ include "common.labels.standard" (dict "customLabels" .Values.commonLabels "context" $) | nindent 4 }}
{{- if .Values.commonAnnotations }}
annotations:
{{ include "common.tplvalues.render" (dict "value" .Values.commonAnnotations "context" $) | nindent 4 }}
{{- end }}
data:
{{- $currentScope := .}}
{{- range $path, $_ := .Files.Glob "configs/envoy/**" }}
{{ base $path | nindent 2 }}: |-
{{- with $currentScope }}
{{- $var := .Files.Get $path }}
{{- include "common.tplvalues.render" (dict "value" $var "context" $) | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-access-keys
data:
{{- range $key, $value := .Values.global.access_v1_public_keys }}
{{ $key }}: |-
{{- $value | trim | nindent 4 }}
{{- end }}
Loading