Need advice on my dev flow
I used to have different dockerfile for different environment when using v5. Currently having couple annoying issues after migrating to v6. I have couple pods running on local kubernetes for development purpose. Each pods are replaced by devspace but it stuck in still waiting mode after kubernetes restart because of startContainer config. I need to start sync on each pod in order to use pods.
For initial pod init, i need to install pnpm after replacing pod with offical node image. There is no config for that so I put under sync section. However, waitInitialSync config has no effect so only way to wait sync is startContainer config. I'm not sure if its correct approach. I can build official node image with pnpm but i need to manage another dockerfile which seems defeating purpose of pod replacement. Below config is one of my deployment which works fine for initial dev start but failed after kubernetes restarts. After restart, pods stuck because waiting sync trigger, so i need to start sync on every pod.
I have noticed that command that marked once is triggered every sync. also package.json change event triggers after initial sync starts. Maybe i can persist package.json file to prevent onchange trigger.
Any advice and suggestion?. thanks
dev:
api-service:
imageSelector: api-service
devImage: node:18.8-alpine
workingDir: /usr/app
command: ["pnpm", "dev"]
logs: {}
persistPaths:
- path: /root/.local/share/pnpm/store/v3
persistenceOptions:
size: 5Gi
storageClassName: local-storage
accessModes:
- ReadWriteMany
name: pnpm-pvc
ports:
- port: 9091:9091
sync:
- path: ./
disableDownload: true
startContainer: true
// waitInitialSync: true or false ----------- no effect
printLogs: true
onUpload:
exec:
- command: "npm i -g pnpm"
once: true
- command: "pnpm install"
onChange: ["./package.json"]