Skip to content

Commit

Permalink
Revert "Merge pull request #7 from MapColonies/supproting-helm"
Browse files Browse the repository at this point in the history
This reverts commit f69a861, reversing
changes made to 418c449.
  • Loading branch information
almog8k committed Sep 17, 2024
1 parent f69a861 commit b6ac542
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 351 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ lerna-debug.log*
# Development tools
.idea
local.json
local.yaml

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
4 changes: 2 additions & 2 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: overseer
name: ts-server-boilerplate
description: A boilerplate github repo for a REST API service in NodeJS for MapColonies
annotations:
github.com/project-slug: MapColonies/overseer
github.com/project-slug: MapColonies/ts-server-boilerplate
tags:
- nodejs
- typescript
Expand Down
57 changes: 1 addition & 56 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
"metrics": {
"enabled": "TELEMETRY_METRICS_ENABLED",
"url": "TELEMETRY_METRICS_URL",
"interval": "TELEMETRY_METRICS_INTERVAL",
"buckets": {
"__name": "TELEMETRY_METRICS_BUCKETS",
"__format": "json"
}
"interval": "TELEMETRY_METRICS_INTERVAL"
}
},
"server": {
Expand All @@ -38,57 +34,6 @@
"__format": "boolean"
}
}
},
"httpRetry": {
"attempts": "HTTP_RETRY_ATTEMPTS",
"delay": "HTTP_RETRY_DELAY",
"shouldResetTimeout": {
"__name": "HTTP_RETRY_RESET_TIMEOUT",
"__format": "boolean"
},
"disableHttpClientLogs": {
"__name": "HTTP_RETRY_DISABLE_LOGS",
"__format": "boolean"
}
}
},
"mapServerCacheType": "MAP_SERVER_CACHE_TYPE",
"jobManagement": {
"config": {
"jobManagerBaseUrl": "JOB_MANAGER_BASE_URL",
"heartbeat": {
"baseUrl": "HEARTBEAT_BASE_URL",
"intervalMs": "HEARTBEAT_INTERVAL_MS"
},
"dequeueIntervalMs": "DEQUEUE_INTERVAL_MS"
},
"ingestion": {
"pollingTasks": {
"init": "INGESTION_POLLING_INIT_TASK",
"finalize": "INGESTION_POLLING_FINALIZE_TASK"
},
"jobs": {
"new": {
"type": "INGESTION_NEW_JOB_TYPE"
},
"update": {
"type": "INGESTION_UPDATE_JOB_TYPE"
},
"swapUpdate": {
"type": "INGESTION_SWAP_UPDATE_JOB_TYPE"
}
},
"task": {
"tilesMerging": {
"type": "TILES_MERGING_TASK_TYPE",
"tileBatchSize": "TILES_MERGING_TILE_BATCH_SIZE",
"taskBatchSize": "TILES_MERGING_TASK_BATCH_SIZE",
"useNewTargetFlagInUpdate": {
"__name": "TILES_MERGING_USE_NEW_TARGET_FLAG",
"__format": "boolean"
}
}
}
}
}
}
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: overseer
description: A Helm chart for overseer service
name: ts-server-boilerplate
description: A Helm chart for ts-server-boilerplate service
type: application
version: 1.0.0
appVersion: 1.0.0
Expand Down
84 changes: 28 additions & 56 deletions helm/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "overseer.name" -}}
{{- default .Chart.Name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "overseer.labels" -}}
helm.sh/chart: {{ include "overseer.chart" . }}
{{ include "overseer.selectorLabels" . }}
{{- define "ts-server-boilerplate.labels" -}}
helm.sh/chart: {{ include "ts-server-boilerplate.chart" . }}
{{ include "ts-server-boilerplate.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -20,22 +13,22 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Returns the tag of the chart.
*/}}
{{- define "overseer.tag" -}}
{{- define "ts-server-boilerplate.tag" -}}
{{- default (printf "v%s" .Chart.AppVersion) .Values.image.tag }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "overseer.selectorLabels" -}}
app.kubernetes.io/name: {{ include "overseer.name" . }}
{{- define "ts-server-boilerplate.selectorLabels" -}}
app.kubernetes.io/name: {{ include "ts-server-boilerplate.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Returns the environment from global if exists or from the chart's values, defaults to development
*/}}
{{- define "overseer.environment" -}}
{{- define "ts-server-boilerplate.environment" -}}
{{- if .Values.global.environment }}
{{- .Values.global.environment -}}
{{- else -}}
Expand All @@ -46,93 +39,72 @@ Returns the environment from global if exists or from the chart's values, defaul
{{/*
Returns the tracing url from global if exists or from the chart's values
*/}}
{{- define "overseer.tracingUrl" -}}
{{- define "ts-server-boilerplate.tracingUrl" -}}
{{- if .Values.global.tracing.url }}
{{- .Values.global.tracing.url -}}
{{- else if .Values.tracing.url -}}
{{- .Values.tracing.url -}}
{{- else if .Values.env.tracing.url -}}
{{- .Values.env.tracing.url -}}
{{- end -}}
{{- end -}}

{{/*
Returns the tracing url from global if exists or from the chart's values
*/}}
{{- define "overseer.metricsUrl" -}}
{{- define "ts-server-boilerplate.metricsUrl" -}}
{{- if .Values.global.metrics.url }}
{{- .Values.global.metrics.url -}}
{{- else -}}
{{- .Values.metrics.url -}}
{{- end -}}
{{- end -}}
{{/*
Returns the cloud provider image pull secret name from global if exists or from the chart's values
*/}}
{{- define "overseer.cloudProviderImagePullSecretName" -}}
{{- if .Values.global.cloudProvider.imagePullSecretName }}
{{- .Values.global.cloudProvider.imagePullSecretName -}}
{{- else if .Values.cloudProvider.imagePullSecretName -}}
{{- .Values.cloudProvider.imagePullSecretName -}}
{{- end -}}
{{- end -}}

{{/*
Returns the cloud provider docker registry url from global if exists or from the chart's values
*/}}
{{- define "overseer.cloudProviderDockerRegistryUrl" -}}
{{- if .Values.global.cloudProvider.dockerRegistryUrl }}
{{- printf "%s/" .Values.global.cloudProvider.dockerRegistryUrl -}}
{{- else if .Values.cloudProvider.dockerRegistryUrl -}}
{{- printf "%s/" .Values.cloudProvider.dockerRegistryUrl -}}
{{- else -}}
{{- .Values.env.metrics.url -}}
{{- end -}}
{{- end -}}
{{/*
Return the proper image name
*/}}
{{- define "overseer.image" -}}
{{- define "ts-server-boilerplate.image" -}}
{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}
{{/*
Return the proper Docker Image Registry Secret Names
*/}}
{{- define "overseer.imagePullSecrets" -}}
{{- define "ts-server-boilerplate.imagePullSecrets" -}}
{{ include "common.images.renderPullSecrets" (dict "images" (list .Values.image) "context" $) }}
{{- end -}}
{{/*
Return the proper image pullPolicy
*/}}
{{- define "overseer.pullPolicy" -}}
{{- define "ts-server-boilerplate.pullPolicy" -}}
{{ include "common.images.pullPolicy" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}
{{/*
Returns the cloud provider name from global if exists or from the chart's values, defaults to minikube
Return the proper image deploymentFlavor
*/}}
{{- define "overseer.cloudProviderFlavor" -}}
{{- if .Values.global.cloudProvider.flavor }}
{{- .Values.global.cloudProvider.flavor -}}
{{- else if .Values.cloudProvider -}}
{{- .Values.cloudProvider.flavor | default "minikube" -}}
{{- else -}}
{{ "minikube" }}
{{- define "ts-server-boilerplate.deploymentFlavor" -}}
{{ include "common.images.deploymentFlavor" (dict "imageRoot" .Values.image "global" .Values.global) }}
{{- end -}}
{{- end -}}
{{/*
Return the proper fully qualified app name
*/}}
{{- define "overseer.fullname" -}}
{{- define "ts-server-boilerplate.fullname" -}}
{{ include "common.names.fullname" . }}
{{- end -}}
{{/*
Return the proper chart name
*/}}
{{- define "overseer.chart" -}}
{{- define "ts-server-boilerplate.name" -}}
{{ include "common.names.name" . }}
{{- end -}}
{{/*
Return the proper chart name
*/}}
{{- define "ts-server-boilerplate.chart" -}}
{{ include "common.names.chart" . }}
{{- end -}}
20 changes: 0 additions & 20 deletions helm/templates/_resources.tpl

This file was deleted.

59 changes: 0 additions & 59 deletions helm/templates/_tplValues.tpl

This file was deleted.

37 changes: 7 additions & 30 deletions helm/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,22 @@
{{- $configmapName := include "configmap.fullname" . }}
{{- $tracing := (include "common.tracing.merged" .) | fromYaml }}
{{- $metrics := (include "common.metrics.merged" .) | fromYaml }}
{{- $serviceUrls := (include "common.serviceUrls.merged" .) | fromYaml }}

{{- $tracingUrl := include "ts-server-boilerplate.tracingUrl" . -}}
{{- $metricsUrl := include "ts-server-boilerplate.metricsUrl" . -}}
{{- if .Values.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ $configmapName }}
name: {{ printf "%s-configmap" (include "ts-server-boilerplate.fullname" .) }}
data:
REQUEST_PAYLOAD_LIMIT: {{ .Values.env.requestPayloadLimit | quote }}
RESPONSE_COMPRESSION_ENABLED: {{ .Values.env.responseCompressionEnabled | quote }}
LOG_LEVEL: {{ .Values.env.logLevel | quote }}
LOG_PRETTY_PRINT_ENABLED: {{ .Values.env.logPrettyPrintEnabled | quote }}
{{ if $tracing.enabled }}
{{ if .Values.env.tracing.enabled }}
TELEMETRY_TRACING_ENABLED: 'true'
TELEMETRY_TRACING_URL: {{ $tracing.url }}
TELEMETRY_TRACING_URL: {{ $tracingUrl }}
{{ end }}
{{ if $metrics.enabled }}
{{ if .Values.env.metrics.enabled }}
TELEMETRY_METRICS_ENABLED: 'true'
TELEMETRY_METRICS_URL: {{ $metrics.url }}

TELEMETRY_METRICS_URL: {{ $metricsUrl }}
{{ end }}
npm_config_cache: /tmp/

HTTP_RETRY_ATTEMPTS: {{ .Values.env.httpRetry.attempts | quote }}
HTTP_RETRY_DELAY: {{ .Values.env.httpRetry.delay | quote }}
HTTP_RETRY_RESET_TIMEOUT: {{ .Values.env.httpRetry.resetTimeout | quote }}
DISABLE_HTTP_CLIENT_LOGS: {{ .Values.env.disableHttpClientLogs | quote }}
JOB_MANAGER_BASE_URL: {{ $serviceUrls.jobManager | quote}}
HEARTBEAT_BASE_URL: {{ $serviceUrls.heartbeatManager | quote}}
HEARTBEAT_INTERVAL_MS: {{ .Values.env.jobManagement.config.heartBeat.intervalMs | quote }}
DEQUEUE_INTERVAL_MS: {{ .Values.env.jobManagement.config.dequeueIntervalMs | quote }}
MAP_SERVER_CACHE_TYPE: {{ .Values.env.mapServerCacheType | quote }}
INGESTION_POLLING_INIT_TASK: {{ .Values.env.jobManagement.ingestion.pollingTasks.init | quote }}
INGESTION_POLLING_FINALIZE_TASK: {{ .Values.env.jobManagement.ingestion.pollingTasks.finalize | quote }}
INGESTION_JOB_NEW_TYPE: {{ .Values.env.jobManagement.ingestion.jobs.new.type | quote }}
INGESTION_JOB_UPDATE_TYPE: {{ .Values.env.jobManagement.ingestion.jobs.update.type | quote }}
INGESTION_JOB_SWAP_UPDATE_TYPE: {{ .Values.env.jobManagement.ingestion.jobs.swapUpdate.type | quote }}
TILES_MERGING_TASK_TYPE: {{ .Values.env.jobManagement.ingestion.tasks.tilesMerging.type | quote }}
TILES_MERGING_TILE_BATCH_SIZE: {{ .Values.env.jobManagement.ingestion.tasks.tilesMerging.tileBatchSize | quote }}
TILES_MERGING_TASK_BATCH_SIZE: {{ .Values.env.jobManagement.ingestion.tasks.tilesMerging.taskBatchSize | quote }}
TILES_MERGING_USE_NEW_TARGET_FLAG_IN_UPDATE: {{ .Values.env.jobManagement.ingestion.tasks.tilesMerging.useNewTargetFlagInUpdate | quote }}
{{- end }}
Loading

0 comments on commit b6ac542

Please sign in to comment.