5
5
6
6
7
7
8
- > 该项目基于Youki(https://github.com/youki-dev/youki ) 实现CRI接口的相应功能,目前可以创建Pod,启动Pod,删除Pod,查看容器状态。
8
+ > 该项目基于Youki(https://github.com/youki-dev/youki)实现CRI接口的相应功能,目前可以创建Pod,启动Pod,删除Pod,查看容器状态。
9
9
10
10
11
11
@@ -91,6 +91,15 @@ example: ./rkl run task.yaml
91
91
example: ./rkl delete pod1
92
92
93
93
```
94
+ ✅进入Pod中的容器
95
+
96
+ ./rkl exec [ OPTIONS] <POD_NAME> <CONTAINER_ID> [ COMMAND] ...
97
+
98
+ ```
99
+
100
+ example: ./rkl exec pod1 container1 -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/sh
101
+
102
+ ```
94
103
95
104
96
105
@@ -126,31 +135,38 @@ docker export $(docker create busybox) | tar -C rootfs -xvf -
126
135
127
136
支持扩充业务容器的数量
128
137
129
- 支持对容器 cpu 和内存资源限制
130
-
131
138
``` yaml
132
139
apiVersion : v1
140
+
133
141
kind : Pod
142
+
134
143
metadata :
135
- name : simple-container-task
136
- labels :
137
- app : my-app
138
- bundle : /home/Qiaoqia/Projects/rk8s/project/rkl/test/bundles/pause # bundle path of pause container
144
+
145
+ name : simple-container-task
146
+
147
+ labels :
148
+
149
+ app : my-app
150
+
151
+ bundle : /home/ich/rk8s/project/rkl/test/bundle-file/pause # bundle path of pause container
152
+
139
153
spec :
140
- containers :
141
- - name : main-container1
142
- image : /home/Qiaoqia/Projects/rk8s/project/rkl/test/bundles/busybox # bundle path
143
- args : # the arguments of config.json file
144
- - " dd"
145
- - " if=/dev/zero"
146
- - " of=/dev/null"
147
- ports :
148
- - containerPort : 80
149
- resources : # resource limit
150
- limits :
151
- cpu : " 500m"
152
- memory : " 512Mi"
153
154
155
+ containers :
156
+
157
+ - name : main-container1
158
+
159
+ image : /home/ich/rk8s/project/rkl/test/bundle-file/busybox # bundle path
160
+
161
+ args : # the arguments of config.json file
162
+
163
+ - " sleep"
164
+
165
+ - " 10000"
166
+
167
+ ports :
168
+
169
+ - containerPort : 80
154
170
155
171
` ` `
156
172
@@ -304,6 +320,15 @@ PodSandbox ID: simple-container-task
304
320
Pod simple-container-task created and started successfully
305
321
306
322
```
323
+ exec:
324
+ ```
325
+
326
+ ./rkl exec simple-container-task simple-container-task-main-container1 -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/sh
327
+
328
+ / # ls
329
+ bin dev etc home lib lib64 proc root sys tmp usr var
330
+ ```
331
+
307
332
308
333
309
334
@@ -388,7 +413,15 @@ Pod simple-container-task created and started successfully
388
413
389
414
` example: ./rkl delete pod1 `
390
415
391
-
416
+ ✅ execute Pod
417
+
418
+ ./rkl exec [ OPTIONS] <POD_NAME> <CONTAINER_ID> [ COMMAND] ...
419
+
420
+ ```
421
+
422
+ example: ./rkl exec pod1 container1 -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/sh
423
+
424
+ ```
392
425
393
426
----------
394
427
@@ -422,32 +455,39 @@ Currently, only the following YAML format is supported.
422
455
423
456
The number of business containers can be increased as needed.
424
457
425
- Supports CPU and memory resource limitations for containers.
426
-
427
458
``` yaml
428
459
429
460
apiVersion : v1
461
+
430
462
kind : Pod
463
+
431
464
metadata :
432
- name : simple-container-task
433
- labels :
434
- app : my-app
435
- bundle : /home/Qiaoqia/Projects/rk8s/project/rkl/test/bundles/pause # bundle path of pause container
465
+
466
+ name : simple-container-task
467
+
468
+ labels :
469
+
470
+ app : my-app
471
+
472
+ bundle : /home/ich/rk8s/project/rkl/test/bundle-file/pause # bundle path of pause container
473
+
436
474
spec :
437
- containers :
438
- - name : main-container1
439
- image : /home/Qiaoqia/Projects/rk8s/project/rkl/test/bundles/busybox # bundle path
440
- args : # the arguments of config.json file
441
- - " dd"
442
- - " if=/dev/zero"
443
- - " of=/dev/null"
444
- ports :
445
- - containerPort : 80
446
- resources : # resource limit
447
- limits :
448
- cpu : " 500m"
449
- memory : " 512Mi"
450
475
476
+ containers :
477
+
478
+ - name : main-container1
479
+
480
+ image : /home/ich/rk8s/project/rkl/test/bundle-file/busybox # bundle path
481
+
482
+ args : # the arguments of config.json file
483
+
484
+ - " sleep"
485
+
486
+ - " 10000"
487
+
488
+ ports :
489
+
490
+ - containerPort : 80
451
491
452
492
` ` `
453
493
@@ -600,3 +640,12 @@ PodSandbox ID: simple-container-task
600
640
Pod simple-container-task created and started successfully
601
641
602
642
```
643
+
644
+ exec:
645
+ ```
646
+
647
+ ./rkl exec simple-container-task simple-container-task-main-container1 -e PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin /bin/sh
648
+
649
+ / # ls
650
+ bin dev etc home lib lib64 proc root sys tmp usr var
651
+ ```
0 commit comments