設置鏡像緩存
更新時間 2025-10-16 18:11:21
最近更新時間: 2025-10-16 18:11:21
分享文章
本文介紹如何設置鏡像緩存。
可以使用鏡像緩存來實現加速創建Pod,通過指定鏡像緩存ID的方式:
使用方式 | 配置項 | 示例值 | 說明 |
|---|---|---|---|
指定鏡像緩存 | k8s.daliqc.cn/eci-imc-id | imc-dfaexxxxx | 明確指定使用某個鏡像緩存創建Pod |
配置參考如下:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 1
selector:
matchLabels:
app: nginx
template:
metadata:
annotations:
k8s.daliqc.cn/eci-imc-id: imc-dfaexxxxx # 指定鏡像緩存
labels:
app: nginx
spec:
containers:
- name: nginx
image: registry-huadong1.crs-internal.daliqc.cn/open-source/nginx:1.25-alpine
ports:
- containerPort: 80
nodeName: vnd-u53cymkxxxx-cn-huadong1-jsnj1a-public-ctcloud