1. 概述
默认istio的limist是:
cpu: 2000m
memory: 1024Mi
request也是很大,部署用例一多,很浪费资源,所以就想修改istio的默认配置
2. 生成当前的manifest文件
istioctl manifest generate > generated-manifest.yaml
这个文件很大,有1w多行,我就不贴出来了,这个是istio的部署文件。
3. 修改manifest文件
这里8850行修改limits/request的cpu/memory:
"proxy": {
"autoInject": "enabled",
"clusterDomain": "cluster.local",
"componentLogLevel": "misc:error",
"enableCoreDump": false,
"excludeIPRanges": "",
"excludeInboundPorts": "",
"excludeOutboundPorts": "",
"holdApplicationUntilProxyStarts": false,
"image": "proxyv2",
"includeIPRanges": "*",
"includeInboundPorts": "*",
"includeOutboundPorts": "",
"logLevel": "warning",
"privileged": false,
"readinessFailureThreshold": 30,
"readinessInitialDelaySeconds": 1,
"readinessPeriodSeconds": 2,
"resources": {
"limits": {
"cpu": "100m",
"memory": "200Mi"
},
"requests": {
"cpu": "10m",
"memory": "50Mi"
}
},
"statusPort": 15020,
"tracer": "zipkin"
},
"proxy_init": {
"image": "proxyv2",
"resources": {
"limits": {
"cpu": "100m",
"memory": "200Mi"
},
"requests": {
"cpu": "10m",
"memory": "10Mi"
}
}
},
还有10287行这里修改limits/request的cpu/memory:
readinessProbe:
failureThreshold: 30
httpGet:
path: /healthz/ready
port: 15021
scheme: HTTP
initialDelaySeconds: 1
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 100m
memory: 200Mi
requests:
cpu: 10m
memory: 50Mi
4. 根据manifest文件重新安装istio
卸载:
istioctl uninstall —purge
如果没有装过istio,先要执行以下命令:
sudo kubectl create namespace istio-system
sudo istioctl manifest generate --set values.defaultRevision=default
通过kubectl安装istio:
kubectl apply -f generated-manifest.yaml
验证安装:
istioctl verify-install -f generated-manifest.yaml
修改以后看下其他pod是否limit正常:
sudo kubectl describe nodes
可以看到limitrange都正常了。
标签:kubectl,limits,istio,manifest,limit,memory,cpu From: https://www.cnblogs.com/zhanchenjin/p/17334268.html