sheldonjuncker / node-kubycat Goto Github PK
View Code? Open in Web Editor NEWA Node.js library for automated Kubernetes file syncing.
Home Page: https://www.kubycat.info
License: MIT License
A Node.js library for automated Kubernetes file syncing.
Home Page: https://www.kubycat.info
License: MIT License
if many files change the same time it seems that kubycat is sequentially pushing the changes one after the other
that is very slow. It would be great if this could be parallelized
Hello,
I don't know what is going on but want to share this special case which seems not to work as expected
# config.yaml
kubycat:
namespace: my-app-namespace
sync:
- name: my-app
base: /home/myhome/MyApp
from:
- src
- frontend-dist
- Project.toml
to: /home/myhome/MyApp
pod-label: app.kubernetes.io/name=my-app
shell: /bin/sh
# Allows Kubycat to send desktop notifications on errors
notify: true
# Whether to show the logs for the sync
show-logs: true
# Sync files on startup
sync-on-start: true
# Build file caches on startup to prevent unintentional syncing
# build-cache-on-start: true
- name: MyApp.toml
base: /home/myhome/MyApp/dev
from:
- MyApp.toml
to: /home/myhome
pod-label: app.kubernetes.io/name=my-app
shell: /bin/sh
# Allows Kubycat to send desktop notifications on errors
notify: true
# Whether to show the logs for the sync
show-logs: true
# Sync files on startup
sync-on-start: true
# Build file caches on startup to prevent unintentional syncing
# build-cache-on-start: true
If I set build-cache-on-start: true
to true for both, the second part is not synced on start. If I change the MyApp.toml file it will then get synced, but the initial sync does not happen. If I uncomment the build-cache-on-start option as above, everythings works correctly. (Hence this is also my workaround for now).
It would be great if build-cache-on-start works together with sync-on-start.
I hope this information can help
It would be great to have a flexible option to set config.yaml properties via the commandline.
Something like
kubycat path/to/baseconfig.yaml --set kubycat.sync[0].pod-label="mylabel1=myvalue1"
Node 20 is current LTS, it only makes sense to support it
Hello,
I don't know what is going on but want to share this special case which seems not to work as expected
# config.yaml
kubycat:
namespace: my-app-namespace
sync:
- name: my-app
base: /home/myhome/MyApp
from:
- src
- frontend-dist
- Project.toml
to: /home/myhome/MyApp
pod-label: app.kubernetes.io/name=my-app
shell: /bin/sh
# Allows Kubycat to send desktop notifications on errors
notify: true
# Whether to show the logs for the sync
show-logs: true
# Sync files on startup
sync-on-start: true
# Build file caches on startup to prevent unintentional syncing
# build-cache-on-start: true
- name: MyApp.toml
base: /home/myhome/MyApp/dev
from:
- MyApp.toml
to: /home/myhome
pod-label: app.kubernetes.io/name=my-app
shell: /bin/sh
# Allows Kubycat to send desktop notifications on errors
notify: true
# Whether to show the logs for the sync
show-logs: true
# Sync files on startup
sync-on-start: true
# Build file caches on startup to prevent unintentional syncing
# build-cache-on-start: true
If I set build-cache-on-start: true
to true for both, the second part is not synced on start. If I change the MyApp.toml file it will then get synced, but the initial sync does not happen. If I uncomment the build-cache-on-start option as above, everythings works correctly. (Hence this is also my workaround for now).
It would be great if build-cache-on-start works together with sync-on-start.
I hope this information can help
Every time kubycat tries to syncronize a single file called saving and loading.jl
it fails with
- error:
---------------------------------------
- error: source and destination are required
---------------------------------------
- exiting with code 1...
I guess it is because of whitespace issues.
I am using parcel to build javascript into a frontend-dist
directory.
The routine will first delete the folder and then recreate it with all new files.
Somehow kubycat is not able to correctly syncronize the files respectively (this frontend-dist
directory is listed under the yaml key from:
)
When restarting kubycat (sync-on-start is activated), everything is correct.
I hope this information can help finding the bug/missing feature
Node 20 is current LTS, it only makes sense to support it
I am trying to restart puma after updating files. Setting post-remote: pumactl -p 1 restart
does not work. Setting post-remote: kubectl exec -n namespace $POD -- /bin/sh -c "pumactl -p 1 restart"
does work. It seems like the post-remote command needs something like https://github.com/sheldonjuncker/node-kubycat/blob/main/src/Kubycat.ts#L247
I am trying to sync multiple pods with the following configuration:
kubycat:
namespace: default
sync:
- name: multi-sync
base: /my/base/directory
from:
- foo
- bar
- manage.py
to: /code
pod-label: code.watcher=true
shell: /bin/sh
When kubycat sees any file changes it shows the following output:
sync /my/base/directory/manage.py
- sync=multi-sync
- status=Modified
- kubectl --namespace default get pods -l code.watcher=true -o custom-columns=NAME:metadata.name --no-headers
- running on all 1 pods
- kubectl --namespace default cp /my/base/directory/manage.py default/pod1-0 pod2-0:/code/manage.py
- error:
---------------------------------------
- error: one of src or dest must be a remote file specification
- /bin/sh: line 1: django-st3-celery-worker-0:/code/manage.py: No such file or directory
---------------------------------------
- exiting with code 127...
Note that it claims to have only found one pod but kubectl --namespace default get pods -l code.watcher=true -o custom-columns=NAME:metadata.name --no-headers
gives me:
pod1-0
pod2-0
(All names have been changed to protect the innocent)
Node 20 is current LTS, it only makes sense to support it
I getting error trying kubycat on my linux machine
TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
at new NodeError (node:internal/errors:405:5)
at Object.watch (node:fs:2416:11)
at Kubycat.watchFiles (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:56:46)
at Kubycat.<anonymous> (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:90:18)
at Generator.next (<anonymous>)
at /home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:8:71
at new Promise (<anonymous>)
at __awaiter (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:4:12)
at Kubycat.start (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/Kubycat.js:89:16)
at KubycatCli.main (/home/myhome/.npm-packages/lib/node_modules/kubycat/dist/cjs/KubycatCli.js:39:17) {
code: 'ERR_FEATURE_UNAVAILABLE_ON_PLATFORM'
}
Node.js v18.17.1
the error brought me to this stackoverflow which says that the recursive option seems unsupported on linux.
What to do? Is this just not working linux?
My app creates namespaces on the fly. While I can easily identify pods via labels, I need would need something like kubectl --all-namespaces
for it to work.
How to search pods by label across namespaces?
Pods may have multiple labels like environment
, application
, etc. which combination makes it a unique match.
Currently it seems only a single pod-label is allowed.
cannot reach the official website
This site can’t be reached
www.kubycat.info’s DNS address could not be found. Diagnosing the problem.
DNS_PROBE_POSSIBLE
Just tried it out and it doesn't seem to do so. Thanks
Thank you for this great tool. Have you considered syncing both ways?
To me that would be very usefull, as the changes made in the pod would come back on my local machine, and I would be able to manage my versionning locally.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.