Skip to content

Commit

Permalink
✨ Add ability to configure probes (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
bryopsida authored Jan 15, 2024
1 parent 14a5bb7 commit f9ebe64
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/node-app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apiVersion: v2
name: node-app
description: A generic helm chart for a node app, load code into pod with `kubectl cp <app code foder> <pod name>:/app`. will automatically load new changes
type: application
version: 0.4.0
version: 0.5.0
maintainers:
- name: bryopsida
4 changes: 3 additions & 1 deletion charts/node-app/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# node-app

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

A generic helm chart for a node app, load code into pod with `kubectl cp <app code foder> <pod name>:/app`. will automatically load new changes

Expand Down Expand Up @@ -35,6 +35,7 @@ A generic helm chart for a node app, load code into pod with `kubectl cp <app co
| image.tag | string | `"lts"` | |
| imagePullSecrets | list | `[]` | |
| initContainers[0] | object | `{"command":["node","/seed/seed.mjs"],"image":"node:lts","name":"seed-container","securityContext":{"runAsUser":1000},"volumeMounts":[{"mountPath":"/seed","name":"seed"},{"mountPath":"/app","name":"app-code","subPath":"app-code"},{"mountPath":"/home/node/.npm","name":"npm-cache","subPath":"npm-cache"}]}` | seed container, this copies in the pacßkage.json, package-lock.json, and index.js to kick start server that passes health checks the intent is this can be changed live and persisted in the app-code pvc as you make changes through the dev side car, when you finish making changes for a cycle you can disable the dev side car. If the ability to rollback is important to you, use a storage system with snapshotting and rollback. |
| livenessProbe | object | `{"httpGet":{"path":"/","port":"http"}}` | Control Liveness probe settings |
| managedStorage | object | `{"app-code":{"size":"1Gi"},"dropbear":{"size":"256Mi"},"home":{"size":"10Gi"},"node-modules":{"size":"5Gi"},"npm-cache":{"size":"5Gi"}}` | Map of storage volumes managed by the helm release |
| managedStorage.app-code | object | `{"size":"1Gi"}` | PVC to hold application specific code |
| managedStorage.dropbear | object | `{"size":"256Mi"}` | PVC to persist dropbear config such as public keys |
Expand All @@ -48,6 +49,7 @@ A generic helm chart for a node app, load code into pod with `kubectl cp <app co
| podLabels | object | `{}` | |
| podSecurityContext.fsGroup | int | `1000` | |
| probesEnabled | bool | `true` | Toggle use of probes, if you plan on pausing/break pointing app server, you'll want to disable probes |
| readinessProbe | object | `{"httpGet":{"path":"/","port":"http"}}` | Control Readiness probe settings |
| replicaCount | int | `1` | |
| resources | object | `{}` | Set resource allocations for the service/app container |
| securityContext | object | `{"runAsNonRoot":true,"runAsUser":1000}` | Set security context settings for the service/app container |
Expand Down
12 changes: 12 additions & 0 deletions charts/node-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ podSecurityContext:
# -- Toggle use of probes, if you plan on pausing/break pointing app server, you'll want to disable probes
probesEnabled: true

# -- Control Readiness probe settings
readinessProbe:
httpGet:
path: /
port: http

# -- Control Liveness probe settings
livenessProbe:
httpGet:
path: /
port: http

# -- Set security context settings for the service/app container
securityContext:
runAsUser: 1000
Expand Down

0 comments on commit f9ebe64

Please sign in to comment.