Skip to content

Commit

Permalink
Merge pull request #180 from amplication/task/hpa-version-changes-and…
Browse files Browse the repository at this point in the history
…-configmap-fix

feat: hpa version changes and configmap fix
  • Loading branch information
levivannoort authored Oct 2, 2023
2 parents 4eb3487 + 03ec92e commit bcd1e01
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 28 deletions.
40 changes: 20 additions & 20 deletions plugins/deployment-helm-chart/.amplicationrc.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"settings":{
"root_level" : false,
"directory_name" : "helm",
"server" : {
"chart_version" : "0.0.1",
"application_version" : "0.0.1",
"repository" : "ghcr.io/NAMESPACE/IMAGE_NAME",
"tag" : "latest",
"host" : "server.example.com",
"port" : "3000"
},
"admin_ui" : {
"enabled" : false,
"chart_version" : "0.0.1",
"application_version" : "0.0.1",
"repository" : "ghcr.io/NAMESPACE/IMAGE_NAME",
"tag" : "latest",
"host" : "admin.example.com",
"port" : "8080"
"settings" : {
"root_level" : false,
"directory_name" : "helm",
"server" : {
"chart_version" : "0.0.1",
"application_version" : "0.0.1",
"repository" : "ghcr.io/NAMESPACE/IMAGE_NAME",
"tag" : "latest",
"host" : "server.example.com",
"port" : "3000"
},
"admin_ui" : {
"enabled" : false,
"chart_version" : "0.0.1",
"application_version" : "0.0.1",
"repository" : "ghcr.io/NAMESPACE/IMAGE_NAME",
"tag" : "latest",
"host" : "admin.example.com",
"port" : "8080"
}
}
}
}
4 changes: 2 additions & 2 deletions plugins/deployment-helm-chart/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/deployment-helm-chart/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@amplication/plugin-deployment-helm-chart",
"version": "1.0.1",
"version": "1.0.2",
"description": "Add helm chart for deployment of the service",
"main": "dist/index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions plugins/deployment-helm-chart/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type {
CreateServerDotEnvParams,
DsgContext,
Events,
Module,
ModuleMap,
} from "@amplication/code-gen-types";
import {
Expand Down Expand Up @@ -65,7 +64,7 @@ class HelmChartPlugin implements AmplicationPlugin {

variables.forEach((variable) => {
const [name, value] = Object.entries(variable)[0];
configmap = `${configmap}\n${configmapIndentation}${name}: ${value}`;
configmap = `${configmap}\n${configmapIndentation}${name}: "${value}"`;
});

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "${{ SERVICE_NAME }}.fullname" . }}
Expand All @@ -17,12 +17,16 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}

0 comments on commit bcd1e01

Please sign in to comment.