File tree 5 files changed +60
-2
lines changed
5 files changed +60
-2
lines changed Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ kubectl (Kubernetes CLI) plugin to syncronize local files to _Pod_ and executing
5
5
This can be used for example to build and run your local project in Kubernetes while using your prefed editor locally.
6
6
7
7
## Install
8
- ## MacOS with Brew
8
+ ### MacOS with Brew
9
9
``` shell
10
10
brew install ernoaapa/kubectl-plugins/warp
11
11
```
12
- ## Linux / MacOS without Brew
12
+ ### Linux / MacOS without Brew
13
13
1 . Download binary from [ releases] ( https://github.com/ernoaapa/kubectl-warp/releases )
14
14
2 . Add it to your ` PATH `
15
15
@@ -19,6 +19,9 @@ When the plugin binary is found from `PATH` you can just execute it through `kub
19
19
kubectl warp --help
20
20
```
21
21
22
+ ### Examples
23
+ There's some examples with different languages in [ examples directory] ( examples/ )
24
+
22
25
## Development
23
26
### Prerequisites
24
27
- Golang v1.11
Original file line number Diff line number Diff line change
1
+ node_modules
Original file line number Diff line number Diff line change
1
+ # kubectl warp NodeJS example
2
+ This is an example of using ` kubectl warp ` for developing NodeJS app "real-time" in Kubernetes cluster.
3
+
4
+ ` kubectl warp ` start temporary _ Pod_ and keep your local files insync so that you can make changes to files locally, but run the actual code in the Kubernetes cluster.
5
+
6
+ ## Prerequisites
7
+ - Install [ kubectl] ( https://kubernetes.io/docs/tasks/tools/install-kubectl/ )
8
+ - Install [ kubectl warp] ( https://github.com/ernoaapa/kubectl-warp#install )
9
+
10
+ Here we
11
+ 1 . start official ` node ` Docker image in Kubernetes
12
+ 2 . sync current directory to the container
13
+ 3 . run ` npm install `
14
+ 4 . start watching changes with ` npm run watch ` command
15
+
16
+ ``` shell
17
+ kubectl warp -i -t --image node nodejs-example -- npm install && npm run watch
18
+ ```
Original file line number Diff line number Diff line change
1
+
2
+ var startTime = new Date ( ) ;
3
+
4
+ setInterval ( function ( ) {
5
+ console . log ( 'Hello world! (started at ' + startTime . toISOString ( ) + ')' )
6
+ } , 1000 ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " kubectl-warp-example" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " Example NodeJS project for demostrating kubectl warp command" ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "start" : " node index.js" ,
8
+ "watch" : " nodemon index.js" ,
9
+ "test" : " echo \" Error: no test specified\" && exit 1"
10
+ },
11
+ "repository" : {
12
+ "type" : " git" ,
13
+ "url" : " git+https://github.com/ernoaapa/kubectl-warp.git"
14
+ },
15
+ "keywords" : [
16
+ " kubernetes" ,
17
+ " kubectl" ,
18
+ " warp" ,
19
+ " rsync"
20
+ ],
21
+ "author" :
" Erno Aapa <[email protected] >" ,
22
+ "license" : " MIT" ,
23
+ "bugs" : {
24
+ "url" : " https://github.com/ernoaapa/kubectl-warp/issues"
25
+ },
26
+ "homepage" : " https://github.com/ernoaapa/kubectl-warp#readme" ,
27
+ "dependencies" : {
28
+ "nodemon" : " ^1.18.9"
29
+ }
30
+ }
You can’t perform that action at this time.
0 commit comments