Skip to content

Commit

Permalink
release(nes-node-web): 0.1.5 liveness + readiness probes
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch2344 committed Feb 15, 2024
1 parent ad2f6a0 commit cd0a402
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 5 deletions.
27 changes: 27 additions & 0 deletions DEVELOPERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Developing on this repo


How I was testing last:
```
helm upgrade --install --dry-run \
-n nes-dev \
-f /Users/welch/Code/herodevs/nes/packages/api1/k8s/dev.yaml \
api1 \
/Users/welch/Code/herodevs/helm-charts/charts/nes-node-web \
--version 0.1.5 \
--set version=0.0.8 \
--set host=api.dev.nes.herodevs.com \
--set imagePullSecret=ghcr-login-secret \
--set release=nes-dev
```

Debugging a container image locally (with compose running0):
```
DOCKER_BUILDKIT=1 docker run -it --rm --privileged \
--network nes_default \
-v $(pwd)/.env.docker:/home/node/app/.env \
-v $(pwd):/dockerhost \
-p '127.0.0.1:3000:3000' \
"ghcr.io/neverendingsupport/api1:0.0.8" \
/bin/bash
```
2 changes: 1 addition & 1 deletion charts/nes-node-web/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ name: nes-node-web
description: A Helm chart for NES Node apps on Kubernetes

type: application
version: 0.1.4
version: 0.1.5
27 changes: 24 additions & 3 deletions charts/nes-node-web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ spec:
progressDeadlineSeconds: 600
replicas: {{ default 1 .Values.replicaCount }}
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
{{ toYaml .Values.deployment.strategy | indent 4 }}
selector:
matchLabels:
app: {{ include "nes-node-web.fullname" . }}
Expand All @@ -32,6 +30,28 @@ spec:
limits:
memory: '300Mi'
cpu: 100m
{{- if .Values.liveness.enabled }}
livenessProbe:
httpGet:
path: {{ required "A valid .Values.liveness.path!" .Values.liveness.path }}
port: {{ required "A valid .Values.port entry is required!" .Values.port }}
scheme: HTTP
failureThreshold: {{ required "A valid .Values.liveness.thresholds.failure!" .Values.liveness.thresholds.failure }}
initialDelaySeconds: {{ required "A valid .Values.liveness.initialDelay!" .Values.liveness.initialDelay }}
periodSeconds: {{ required "A valid .Values.liveness.period!" .Values.liveness.period }}
successThreshold: {{ required "A valid .Values.liveness.thresholds.success!" .Values.liveness.thresholds.success }}
timeoutSeconds: {{ required "A valid .Values.liveness.timeout!" .Values.liveness.timeout }}
readinessProbe:
httpGet:
path: {{ required "A valid .Values.liveness.path!" .Values.liveness.path }}
port: {{ required "A valid .Values.port entry is required!" .Values.port }}
scheme: HTTP
failureThreshold: {{ required "A valid .Values.liveness.thresholds.failure!" .Values.liveness.thresholds.failure }}
initialDelaySeconds: {{ required "A valid .Values.liveness.initialDelay!" .Values.liveness.initialDelay }}
periodSeconds: {{ required "A valid .Values.liveness.period!" .Values.liveness.period }}
successThreshold: {{ required "A valid .Values.liveness.thresholds.success!" .Values.liveness.thresholds.success }}
timeoutSeconds: {{ required "A valid .Values.liveness.timeout!" .Values.liveness.timeout }}
{{- end }}
ports:
- containerPort: {{ required "A valid .Values.port entry is required!" .Values.port }}
name: http
Expand All @@ -43,3 +63,4 @@ spec:
{{- range $key, $value := .Values.env }}
- {{ $value | toYaml | indent 12 | trim }}
{{ end }}

18 changes: 17 additions & 1 deletion charts/nes-node-web/values.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
replicaCount: 1
replicaCount: 2

image:
pullPolicy: Always
Expand All @@ -11,6 +11,22 @@ urlPrefix: ""

release: "deployed"

liveness:
path: "/"
enabled: true
initialDelay: 7
period: 5
timeout: 1
thresholds:
success: 1
failure: 10

deployment:
strategy:
rollingUpdate:
maxSurge: 50%
maxUnavailable: 1

# env:
# - name: SOME_SVC_SECRET
# valueFrom:
Expand Down

0 comments on commit cd0a402

Please sign in to comment.