Skip to content

Commit bc25f56

Browse files
authored
fix(sync): separate resource for manager and worker pods (#94)
* fix(sync): separate resource for manager and worker pods Signed-off-by: Xuhui zhang <[email protected]> * ci skip: update comment Signed-off-by: Xuhui zhang <[email protected]> * add grafana plugins Signed-off-by: Xuhui zhang <[email protected]> --------- Signed-off-by: Xuhui zhang <[email protected]>
1 parent 776fc33 commit bc25f56

File tree

9 files changed

+1395
-4
lines changed

9 files changed

+1395
-4
lines changed

PROJECT

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
domain: juicefs.io
66
layout:
77
- go.kubebuilder.io/v4
8+
plugins:
9+
grafana.kubebuilder.io/v1-alpha: {}
810
projectName: juicefs-operator
911
repo: github.com/juicedata/juicefs-operator
1012
resources:

api/v1/sync_types.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,18 @@ type SyncSpec struct {
160160
Labels map[string]string `json:"labels,omitempty"`
161161
Annotations map[string]string `json:"annotations,omitempty"`
162162

163-
// Resources
163+
// Resources is the resources for both manager and worker pods.
164+
// Deprecated: Use ManagerResources and WorkerResources instead.
164165
Resources *corev1.ResourceRequirements `json:"resources,omitempty"`
165166

167+
// ManagerResources is the resources for the sync manager pod.
168+
// If not specified, Resources will be used. If Resources is also not specified, an empty ResourceRequirements will be used.
169+
ManagerResources *corev1.ResourceRequirements `json:"managerResources,omitempty"`
170+
171+
// WorkerResources is the resources for the sync worker pods.
172+
// If not specified, Resources will be used. If Resources is also not specified, an empty ResourceRequirements will be used.
173+
WorkerResources *corev1.ResourceRequirements `json:"workerResources,omitempty"`
174+
166175
// Sync Options
167176
// ref: https://juicefs.com/docs/cloud/reference/command_reference/#sync
168177
Options []string `json:"options,omitempty"`

api/v1/zz_generated.deepcopy.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/juicefs.io_cronsyncs.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,39 @@ spec:
11451145
additionalProperties:
11461146
type: string
11471147
type: object
1148+
managerResources:
1149+
properties:
1150+
claims:
1151+
items:
1152+
properties:
1153+
name:
1154+
type: string
1155+
request:
1156+
type: string
1157+
required:
1158+
- name
1159+
type: object
1160+
type: array
1161+
x-kubernetes-list-map-keys:
1162+
- name
1163+
x-kubernetes-list-type: map
1164+
limits:
1165+
additionalProperties:
1166+
anyOf:
1167+
- type: integer
1168+
- type: string
1169+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1170+
x-kubernetes-int-or-string: true
1171+
type: object
1172+
requests:
1173+
additionalProperties:
1174+
anyOf:
1175+
- type: integer
1176+
- type: string
1177+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1178+
x-kubernetes-int-or-string: true
1179+
type: object
1180+
type: object
11481181
nodeSelector:
11491182
additionalProperties:
11501183
type: string
@@ -1812,6 +1845,39 @@ spec:
18121845
ttlSecondsAfterFinished:
18131846
format: int32
18141847
type: integer
1848+
workerResources:
1849+
properties:
1850+
claims:
1851+
items:
1852+
properties:
1853+
name:
1854+
type: string
1855+
request:
1856+
type: string
1857+
required:
1858+
- name
1859+
type: object
1860+
type: array
1861+
x-kubernetes-list-map-keys:
1862+
- name
1863+
x-kubernetes-list-type: map
1864+
limits:
1865+
additionalProperties:
1866+
anyOf:
1867+
- type: integer
1868+
- type: string
1869+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1870+
x-kubernetes-int-or-string: true
1871+
type: object
1872+
requests:
1873+
additionalProperties:
1874+
anyOf:
1875+
- type: integer
1876+
- type: string
1877+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1878+
x-kubernetes-int-or-string: true
1879+
type: object
1880+
type: object
18151881
required:
18161882
- from
18171883
- image

config/crd/bases/juicefs.io_syncs.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,39 @@ spec:
11041104
additionalProperties:
11051105
type: string
11061106
type: object
1107+
managerResources:
1108+
properties:
1109+
claims:
1110+
items:
1111+
properties:
1112+
name:
1113+
type: string
1114+
request:
1115+
type: string
1116+
required:
1117+
- name
1118+
type: object
1119+
type: array
1120+
x-kubernetes-list-map-keys:
1121+
- name
1122+
x-kubernetes-list-type: map
1123+
limits:
1124+
additionalProperties:
1125+
anyOf:
1126+
- type: integer
1127+
- type: string
1128+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1129+
x-kubernetes-int-or-string: true
1130+
type: object
1131+
requests:
1132+
additionalProperties:
1133+
anyOf:
1134+
- type: integer
1135+
- type: string
1136+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1137+
x-kubernetes-int-or-string: true
1138+
type: object
1139+
type: object
11071140
nodeSelector:
11081141
additionalProperties:
11091142
type: string
@@ -1771,6 +1804,39 @@ spec:
17711804
ttlSecondsAfterFinished:
17721805
format: int32
17731806
type: integer
1807+
workerResources:
1808+
properties:
1809+
claims:
1810+
items:
1811+
properties:
1812+
name:
1813+
type: string
1814+
request:
1815+
type: string
1816+
required:
1817+
- name
1818+
type: object
1819+
type: array
1820+
x-kubernetes-list-map-keys:
1821+
- name
1822+
x-kubernetes-list-type: map
1823+
limits:
1824+
additionalProperties:
1825+
anyOf:
1826+
- type: integer
1827+
- type: string
1828+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1829+
x-kubernetes-int-or-string: true
1830+
type: object
1831+
requests:
1832+
additionalProperties:
1833+
anyOf:
1834+
- type: integer
1835+
- type: string
1836+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
1837+
x-kubernetes-int-or-string: true
1838+
type: object
1839+
type: object
17741840
required:
17751841
- from
17761842
- image

0 commit comments

Comments
 (0)