欢迎关注我的公众号:

k8s资源之LimitRange_redis

 目前刚开始写一个月,一共写了18篇原创文章,文章目录如下:

​istio多集群探秘,部署了50次多集群后我得出的结论​

​istio多集群链路追踪,附实操视频​

​istio防故障利器,你知道几个,istio新手不要读,太难!​

​istio业务权限控制,原来可以这么玩​

​istio实现非侵入压缩,微服务之间如何实现压缩​

​不懂envoyfilter也敢说精通istio系列-http-rbac-不要只会用AuthorizationPolicy配置权限​

​不懂envoyfilter也敢说精通istio系列-02-http-corsFilter-不要只会vs​

​不懂envoyfilter也敢说精通istio系列-03-http-csrf filter-再也不用再代码里写csrf逻辑了​

​不懂envoyfilter也敢说精通istio系列http-jwt_authn-不要只会RequestAuthorization​

​不懂envoyfilter也敢说精通istio系列-05-fault-filter-故障注入不止是vs​

​不懂envoyfilter也敢说精通istio系列-06-http-match-配置路由不只是vs​

​不懂envoyfilter也敢说精通istio系列-07-负载均衡配置不止是dr​

​不懂envoyfilter也敢说精通istio系列-08-连接池和断路器​

​不懂envoyfilter也敢说精通istio系列-09-http-route filter​

​不懂envoyfilter也敢说精通istio系列-network filter-redis proxy​

​不懂envoyfilter也敢说精通istio系列-network filter-HttpConnectionManager​

​不懂envoyfilter也敢说精通istio系列-ratelimit-istio ratelimit完全手册​

 

————————————————

limitrange:

•LimitRange从字面意义上来看就是对范围进行限制,实际上是对cpu和内存资源使用范围的限制

•前面我们讲到过资源配额,资源配额是对整个名称空间的资源的总限制,是从整体上来限制的,而LimitRange则是对pod和container级别来做限制的

示例:

[root@master01 limitrange]# cat default-memory-contianer/default-memory-contianer.yaml 
apiVersion: v1
kind: LimitRange
metadata:
name: default-range
spec:
limits:
- default:
memory: 512Mi
defaultRequest:
memory: 256Mi
type: Container
[root@master01 limitrange]# cat container-set/container-set.yaml 
apiVersion: v1
kind: LimitRange
metadata:
name: mem-limit-range
spec:
limits:
- default:
memory: 512Mi
cpu: 0.4
defaultRequest:
memory: 256Mi
cpu: 0.1
max:
memory: 800Mi
cpu: 0.5
min:
memory: 100Mi
cpu: 0.1
maxLimitRequestRatio:
memory: 2
cpu: 2
type: Container
[root@master01 limitrange]# cat pod/pod.yaml 
apiVersion: v1
kind: LimitRange
metadata:
namespace: default
name: lykops-limitrange
labels:
project: lykops
app: limitrange
version: v1
spec:
limits:
- max:
cpu: 0.4
memory: 412Mi
min:
cpu: 0.05
memory: 64Mi
type: Pod
[root@master01 limitrange]# cat pod-container/pod-container.yaml 
apiVersion: v1
kind: LimitRange
metadata:
namespace: default
name: lykops-limitrange
labels:
project: lykops
app: limitrange
version: v1
spec:
limits:
- max:
cpu: 0.4
memory: 412Mi
min:
cpu: 0.05
memory: 64Mi
type: Pod
- default:
cpu: 0.2
memory: 200Mi
defaultRequest:
cpu: 0.1
memory: 40Mi
max:
cpu: 0.25
memory: 256Mi
min:
cpu: 0.005
memory: 8Mi
type: Container