Site logo

K8s Node Development 02/14/23

command: ["node", "--inspect=0.0.0.0:9229", "index.js"]
ports:
- containerPort: 80
  name: http
  protocol: TCP
- containerPort: 9229
  name: debug
  protocol: TCP
pod=$(k get pods --selector app.kubernetes.io/name=$1 -o json | jq -r '.items[0].metadata.name')
k -n gval exec -it $pod -- /bin/bash
apt update && apt install -y rsync procps entr
find . -not -path '*node_modules*' -not -path '*.git*' -not -path '*test*' | entr -r node public-api.js 1>> /proc/1/fd/1 2>> /proc/1/fd/2 &
#!/bin/bash

if [ -z "$KRSYNC_STARTED" ]; then
    export KRSYNC_STARTED=true
    exec rsync --blocking-io --rsh "$0" $@
fi

# Running as --rsh
namespace=''
pod=$1
shift

# If use uses pod@namespace rsync passes as: {us} -l pod namespace ...
if [ "X$pod" = "X-l" ]; then
    pod=$1
    shift
    namespace="-n $1"
    shift
fi

exec kubectl $namespace exec -i $pod -- "$@"
find . -not -path '*node_modules*' -not -path '*.git*' -not -path '*test*' | entr krsync -av --progress --stats --exclude 'node_modules' --exclude '.git' --exclude 'config/env' . $pod:/opt/bigpanda/public-api