File tree 5 files changed +45
-51
lines changed
5 files changed +45
-51
lines changed Original file line number Diff line number Diff line change 1
1
{ {/* Specify resource requests and limits for workloads */} }
2
2
{ {- define " linkerd.resources" -} }
3
3
resources:
4
- { {- if or .CPU.Request .Memory.Request } }
5
- requests :
6
- { {- with .CPU.Request } }
4
+ { {- if or .CPU.Limit .Memory.Limit } }
5
+ limits :
6
+ { {- with .CPU.Limit } }
7
7
cpu: { {.} }
8
8
{ {- end } }
9
- { {- with .Memory.Request } }
9
+ { {- with .Memory.Limit } }
10
10
memory: { {.} }
11
11
{ {- end } }
12
12
{ {- end } }
13
- { {- if or .CPU.Limit .Memory.Limit } }
14
- limits :
15
- { {- with .CPU.Limit } }
13
+ { {- if or .CPU.Request .Memory.Request } }
14
+ requests :
15
+ { {- with .CPU.Request } }
16
16
cpu: { {.} }
17
17
{ {- end } }
18
- { {- with .Memory.Limit } }
18
+ { {- with .Memory.Request } }
19
19
memory: { {.} }
20
20
{ {- end } }
21
21
{ {- end } }
Original file line number Diff line number Diff line change @@ -60,13 +60,13 @@ Proxy:
60
60
UID : &proxy_uid 2102
61
61
62
62
# use this to override the default resource requirements in HA mode
63
- # ResourceRequirements:
64
- # limits :
65
- # cpu : "1"
66
- # memory: 250Mi
67
- # requests :
68
- # cpu: 100m
69
- # memory : 20Mi
63
+ ResourceRequirements :
64
+ CPU :
65
+ Limit : " 1"
66
+ Request : 100m
67
+ Memory :
68
+ Limit : 250Mi
69
+ Request : 20Mi
70
70
71
71
# proxy-init configuration
72
72
ProxyInit :
@@ -82,13 +82,13 @@ ProxyInit:
82
82
UID : *proxy_uid
83
83
84
84
# use this to override the default resource requirements in HA mode
85
- # ResourceRequirements:
86
- # limits :
87
- # cpu: " 100m"
88
- # memory: 50Mi
89
- # requests :
90
- # cpu: 10m
91
- # memory : 10Mi
85
+ ResourceRequirements :
86
+ CPU :
87
+ Limit : 100m
88
+ Request : 10m
89
+ Memory :
90
+ Limit : 50Mi
91
+ Request : 10Mi
92
92
93
93
# annotations
94
94
CreatedByAnnotation : linkerd.io/created-by
Original file line number Diff line number Diff line change 13
13
image: { {.Image.Name} }:{ {.Image.Version} }
14
14
imagePullPolicy: { {.Image.PullPolicy} }
15
15
name: linkerd-init
16
- resources:
17
- { {- if .ResourceRequirements -} }
18
- { {- toYaml .ResourceRequirements | trim | nindent 4 -} }
19
- { {- else -} }
20
- { {- include " partials.proxy-init.resource" .Proxy | nindent 4 -} }
21
- { {- end } }
16
+ { {- include " partials.resource" .ResourceRequirements | nindent 2 } }
22
17
securityContext:
23
18
allowPrivilegeEscalation: false
24
19
capabilities:
Original file line number Diff line number Diff line change 71
71
port: { {.Port.Admin} }
72
72
initialDelaySeconds: 2
73
73
{ {- if eq .HighAvailability true -} }
74
- resources:
75
- { {- if .ResourceRequirements -} }
76
- { {- toYaml .ResourceRequirements | trim | nindent 4 -} }
77
- { {- else -} }
78
- { {- include " partials.proxy.resource" .Proxy | nindent 4 -} }
79
- { {- end } }
74
+ { {- include " partials.resource" .ResourceRequirements | nindent 2 -} }
80
75
{ {- end } }
81
76
securityContext:
82
77
allowPrivilegeEscalation: false
Original file line number Diff line number Diff line change 1
- { {- define " partials.proxy.resource" -} }
2
- limits:
3
- cpu: "1"
4
- memory: 250Mi
5
- requests:
6
- cpu: 100m
7
- memory: 20Mi
8
- { {- end -} }
9
-
10
- { {- define " partials.proxy-init.resource" -} }
11
- limits:
12
- cpu: 100m
13
- memory: 50Mi
14
- requests:
15
- cpu: 10m
16
- memory: 10Mi
17
- { {- end -} }
1
+ { {- define " partials.resource" -} }
2
+ resources:
3
+ { {- if or .CPU.Limit .Memory.Limit } }
4
+ limits:
5
+ { {- with .CPU.Limit } }
6
+ cpu: { {.} }
7
+ { {- end } }
8
+ { {- with .Memory.Limit } }
9
+ memory: { {.} }
10
+ { {- end } }
11
+ { {- end } }
12
+ { {- if or .CPU.Request .Memory.Request } }
13
+ requests:
14
+ { {- with .CPU.Request } }
15
+ cpu: { {.} }
16
+ { {- end } }
17
+ { {- with .Memory.Request } }
18
+ memory: { {.} }
19
+ { {- end } }
20
+ { {- end } }
21
+ { {- end } }
You can’t perform that action at this time.
0 commit comments