Skip to content

Commit 3ae9f5a

Browse files
Merge pull request #12 from IBM/bha-transport-endpt
Fix transport endpoint issue for rclone mounter
2 parents 9febc5d + cd489b2 commit 3ae9f5a

File tree

9 files changed

+272
-27
lines changed

9 files changed

+272
-27
lines changed

api/v1alpha1/ibmobjectcsi_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ type IBMObjectCSISpec struct {
3838
HealthPort uint16 `json:"healthPort,omitempty"`
3939
}
4040

41+
type ResourcesSpec struct {
42+
Limits ReqLimits `json:"limits"`
43+
Requests ReqLimits `json:"requests"`
44+
}
45+
46+
type ReqLimits struct {
47+
Cpu string `json:"cpu"`
48+
Memory string `json:"memory"`
49+
}
50+
4151
// IBMObjectCSINodeSpec defines the desired state of IBMObjectCSINode
4252
type IBMObjectCSINodeSpec struct {
4353
// ObjectCSIComponent `json:"objectCSIComponent"`
@@ -53,6 +63,8 @@ type IBMObjectCSINodeSpec struct {
5363

5464
// +kubebuilder:validation:Optional
5565
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
66+
67+
Resources ResourcesSpec `json:"resources,omitempty"`
5668
}
5769

5870
// IBMObjectCSIControllerSpec defines the desired state of IBMObjectCSIController
@@ -70,6 +82,8 @@ type IBMObjectCSIControllerSpec struct {
7082

7183
// +kubebuilder:validation:Optional
7284
Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
85+
86+
Resources ResourcesSpec `json:"resources,omitempty"`
7387
}
7488

7589
// IBMObjectCSIStatus defines the observed state of IBMObjectCSI
@@ -117,6 +131,8 @@ type CSISidecar struct {
117131
// The pullPolicy of the csi sidecar image
118132
// +kubebuilder:validation:Optional
119133
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy"`
134+
135+
Resources ResourcesSpec `json:"resources,omitempty"`
120136
}
121137

122138
func init() {

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/objectdriver.csi.ibm.com_ibmobjectcsis.yaml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,32 @@ spec:
942942
type: string
943943
repository:
944944
type: string
945+
resources:
946+
properties:
947+
limits:
948+
properties:
949+
cpu:
950+
type: string
951+
memory:
952+
type: string
953+
required:
954+
- cpu
955+
- memory
956+
type: object
957+
requests:
958+
properties:
959+
cpu:
960+
type: string
961+
memory:
962+
type: string
963+
required:
964+
- cpu
965+
- memory
966+
type: object
967+
required:
968+
- limits
969+
- requests
970+
type: object
945971
tag:
946972
type: string
947973
tolerations:
@@ -1894,6 +1920,32 @@ spec:
18941920
type: string
18951921
repository:
18961922
type: string
1923+
resources:
1924+
properties:
1925+
limits:
1926+
properties:
1927+
cpu:
1928+
type: string
1929+
memory:
1930+
type: string
1931+
required:
1932+
- cpu
1933+
- memory
1934+
type: object
1935+
requests:
1936+
properties:
1937+
cpu:
1938+
type: string
1939+
memory:
1940+
type: string
1941+
required:
1942+
- cpu
1943+
- memory
1944+
type: object
1945+
required:
1946+
- limits
1947+
- requests
1948+
type: object
18971949
tag:
18981950
type: string
18991951
tolerations:
@@ -1950,6 +2002,32 @@ spec:
19502002
repository:
19512003
description: The repository of the csi sidecar image
19522004
type: string
2005+
resources:
2006+
properties:
2007+
limits:
2008+
properties:
2009+
cpu:
2010+
type: string
2011+
memory:
2012+
type: string
2013+
required:
2014+
- cpu
2015+
- memory
2016+
type: object
2017+
requests:
2018+
properties:
2019+
cpu:
2020+
type: string
2021+
memory:
2022+
type: string
2023+
required:
2024+
- cpu
2025+
- memory
2026+
type: object
2027+
required:
2028+
- limits
2029+
- requests
2030+
type: object
19532031
tag:
19542032
description: The tag of the csi sidecar image
19552033
type: string

config/manager/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
44
kind: Kustomization
55
images:
66
- name: controller
7-
newName: ashimagarg/csi
8-
newTag: "48"
7+
newName: bhagyak1/ibm-object-csi-driver-operator
8+
newTag: apr1801

config/samples/csi_v1alpha1_ibmobjectcsi.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,15 @@ spec:
1313
# and csi-provisioner, csi-attacher, csi-snapshotter and livenessprobe sidecars.
1414
controller:
1515
repository: icr.io/ibm/ibm-object-csi-driver
16-
tag: "v1.0.1-alpha"
16+
tag: "v1.0.2-alpha"
1717
imagePullPolicy: IfNotPresent
18+
resources:
19+
limits:
20+
cpu: 800m
21+
memory: 400Mi
22+
requests:
23+
cpu: 40m
24+
memory: 40Mi
1825
affinity:
1926
nodeAffinity:
2027
requiredDuringSchedulingIgnoredDuringExecution:
@@ -29,8 +36,15 @@ spec:
2936
# and csi-node-driver-registrar and livenessprobe sidecars.
3037
node:
3138
repository: icr.io/ibm/ibm-object-csi-driver
32-
tag: "v1.0.1-alpha"
39+
tag: "v1.0.2-alpha"
3340
imagePullPolicy: Always
41+
resources:
42+
limits:
43+
cpu: "4"
44+
memory: 800Mi
45+
requests:
46+
cpu: 40m
47+
memory: 40Mi
3448
affinity:
3549
nodeAffinity:
3650
requiredDuringSchedulingIgnoredDuringExecution:
@@ -49,14 +63,35 @@ spec:
4963
repository: k8s.gcr.io/sig-storage/csi-node-driver-registrar
5064
tag: "v2.6.3"
5165
imagePullPolicy: IfNotPresent
66+
resources:
67+
limits:
68+
cpu: 40m
69+
memory: 80Mi
70+
requests:
71+
cpu: 10m
72+
memory: 20Mi
5273
- name: csi-provisioner
5374
repository: k8s.gcr.io/sig-storage/csi-provisioner
5475
tag: "v3.4.1"
5576
imagePullPolicy: IfNotPresent
77+
resources:
78+
limits:
79+
cpu: 80m
80+
memory: 160Mi
81+
requests:
82+
cpu: 20m
83+
memory: 40Mi
5684
- name: livenessprobe
5785
repository: k8s.gcr.io/sig-storage/livenessprobe
5886
tag: "v2.9.0"
5987
imagePullPolicy: IfNotPresent
88+
resources:
89+
limits:
90+
cpu: 20m
91+
memory: 40Mi
92+
requests:
93+
cpu: 10m
94+
memory: 10Mi
6095

6196
# healthPort: 9808
6297
# imagePullSecrets:

controllers/ibmobjectcsi_controller_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,17 @@ var (
6161
},
6262
}
6363

64+
resources = v1alpha1.ResourcesSpec{
65+
Limits: v1alpha1.ReqLimits{
66+
Cpu: "40Mi",
67+
Memory: "200Mi",
68+
},
69+
Requests: v1alpha1.ReqLimits{
70+
Cpu: "40m",
71+
Memory: "40Mi",
72+
},
73+
}
74+
6475
ibmObjectCSICR = &v1alpha1.IBMObjectCSI{
6576
ObjectMeta: metav1.ObjectMeta{
6677
Name: ibmObjectCSICRName,
@@ -72,6 +83,7 @@ var (
7283
Tag: "v1.0.2-alpha",
7384
ImagePullPolicy: corev1.PullIfNotPresent,
7485
Affinity: affinity,
86+
Resources: resources,
7587
},
7688
Node: v1alpha1.IBMObjectCSINodeSpec{
7789
Repository: "icr.io/ibm/ibm-object-csi-driver",
@@ -83,25 +95,29 @@ var (
8395
Operator: corev1.TolerationOpExists,
8496
},
8597
},
98+
Resources: resources,
8699
},
87100
Sidecars: []v1alpha1.CSISidecar{
88101
{
89102
Name: "csi-node-driver-registrar",
90103
Repository: "k8s.gcr.io/sig-storage/csi-node-driver-registrar",
91104
Tag: "v2.6.3",
92105
ImagePullPolicy: corev1.PullIfNotPresent,
106+
Resources: resources,
93107
},
94108
{
95109
Name: "csi-provisioner",
96110
Repository: "k8s.gcr.io/sig-storage/csi-provisioner",
97111
Tag: "v3.4.1",
98112
ImagePullPolicy: corev1.PullIfNotPresent,
113+
Resources: resources,
99114
},
100115
{
101116
Name: "livenessprobe",
102117
Repository: "k8s.gcr.io/sig-storage/livenessprobe",
103118
Tag: "v2.9.0",
104119
ImagePullPolicy: corev1.PullIfNotPresent,
120+
Resources: resources,
105121
},
106122
},
107123
ImagePullSecrets: []string{"secretName"},

controllers/internal/crutils/ibmobjectcsi.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,21 @@ func (c *IBMObjectCSI) GetCSIControllerImage() string {
9797
}
9898
return c.Spec.Controller.Repository + ":" + c.Spec.Controller.Tag
9999
}
100+
101+
func (c *IBMObjectCSI) GetCSIControllerResourceRequests() *objectdriverv1alpha1.ResourcesSpec {
102+
resources := objectdriverv1alpha1.ResourcesSpec{}
103+
104+
if &c.Spec.Controller.Resources != nil {
105+
resources = c.Spec.Controller.Resources
106+
}
107+
return &resources
108+
}
109+
110+
func (c *IBMObjectCSI) GetCSINodeResourceRequests() *objectdriverv1alpha1.ResourcesSpec {
111+
resources := objectdriverv1alpha1.ResourcesSpec{}
112+
113+
if &c.Spec.Node.Resources != nil {
114+
resources = c.Spec.Node.Resources
115+
}
116+
return &resources
117+
}

0 commit comments

Comments
 (0)