Kubernetes 工作队列、ConfigMaps 与 Secrets 实战指南
1. 工作队列操作
在 Kubernetes 中,我们可以将一系列工作项放入队列。为了简化操作,使用 curl 工具来驱动工作队列服务器的 API,插入多个工作项。 curl 通过之前设置的 kubectl port-forward 与工作队列进行通信。
以下是具体操作步骤:
1. 创建工作队列 :
# Create a work queue called 'keygen'
curl -X PUT localhost:8080/memq/server/queues/keygen
- 创建 100 个工作项并加载到队列 :
# Create 100 work items and load up the queue.
for i in work-item-{0..99}; do
curl -X POST localhost:8080/memq/server/queues/keygen/enqueue \
-d "$i"
done
运行上述命令后,终端会输出 100 个 JSON 对象,每个工作项都有一个唯一的消息标识符。可以通过查看 UI 中的 “MemQ Serv
超级会员免费看
订阅专栏 解锁全文
1671

被折叠的 条评论
为什么被折叠?



