File tree Expand file tree Collapse file tree 5 files changed +28
-6
lines changed
helmfile/charts/kconmon/templates Expand file tree Collapse file tree 5 files changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ RUN ./node_modules/.bin/grunt test
1010RUN ./node_modules/.bin/grunt build
1111
1212FROM mhart/alpine-node:${NODEJS_VERSION} as deploy
13+ COPY entrypoint.sh /usr/local/bin/entrypoint.sh
14+ ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
15+
1316WORKDIR /app
1417RUN addgroup nonroot && \
1518 adduser -D nonroot -G nonroot && \
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ services:
66 context : ' .'
77 args :
88 NODEJS_VERSION : 14.4.0
9- command : ' node lib/apps/ controller/index.js '
9+ command : ' controller'
1010 environment :
1111 PORT : ' 80' # Run on port 80 locally in docker-compose to replicate kubernetes service object port magenting
1212 hostname : ' controller'
@@ -25,7 +25,7 @@ services:
2525
2626 agent :
2727 image : stono/kconmon:${VERSION:-latest}
28- command : ' node lib/apps/ agent/index.js '
28+ command : ' agent'
2929 environment :
3030 PORT : ' 80' # Run on port 80 locally in docker-compose to replicate kubernetes service object port magenting
3131 hostname : ' agent'
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+
4+ if [ ! -z " $CONTAINER_RESOURCE_REQUEST_MEMORY " ]; then
5+ export MAX_OLD_SPACE=$( /usr/bin/original_node -pe ' Math.round(process.env.CONTAINER_RESOURCE_REQUEST_MEMORY / 1024 / 1024 / 100 * 75)' )
6+ ADDITIONAL_ARGS=" --max_old_space_size=$MAX_OLD_SPACE "
7+ fi
8+
9+ if [ " $1 " = " agent" ]; then
10+ TARGET_APP=" /app/lib/apps/agent/index.js"
11+ elif [ " $1 " = " controller" ]; then
12+ TARGET_APP=" /app/lib/apps/controller/index.js"
13+ else
14+ echo " Unknown command: $1 "
15+ exit 1
16+ fi
17+
18+ # Pass through to the original node script
19+ exec /usr/bin/node $ADDITIONAL_ARGS $TARGET_APP
Original file line number Diff line number Diff line change 7474 image : " {{ required " Please specify the docker image" .Values.docker.image }}:{{ .Values.docker.tag | default .Chart.Version }}"
7575 imagePullPolicy : IfNotPresent
7676 args :
77- - node
78- - lib/apps/ agent/index.js
77+ - /usr/local/bin/entrypoint.sh
78+ - agent
7979 env :
8080 - name : CONTAINER_RESOURCE_REQUEST_MEMORY
8181 valueFrom :
Original file line number Diff line number Diff line change 3939 image : " {{ required " Please specify the docker image" .Values.docker.image }}:{{ .Values.docker.tag | default .Chart.Version }}"
4040 imagePullPolicy : IfNotPresent
4141 args :
42- - node
43- - lib/apps/ controller/index.js
42+ - /usr/local/bin/entrypoint.sh
43+ - controller
4444 env :
4545 - name : CONTAINER_RESOURCE_REQUEST_MEMORY
4646 valueFrom :
You can’t perform that action at this time.
0 commit comments