Skip to content

Commit 6d25d7a

Browse files
committed
add a hostNetwork setting to the Driver and ControllerPlugin Specs
This bool setting can be added to the controllerPlugin section of the Driver Spec. It will be propagated to all controller plugin pods. This implements the following design: https://github.com/ceph/ceph-csi-operator/blob/main/docs/design/hostNetwork.md Signed-off-by: Michael Adam <obnox@samba.org>
1 parent f3cbbd2 commit 6d25d7a

File tree

9 files changed

+40
-0
lines changed

9 files changed

+40
-0
lines changed

api/v1alpha1/driver_types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ type ControllerPluginResourcesSpec struct {
210210
}
211211

212212
type ControllerPluginSpec struct {
213+
// hostNetwork setting to be propagated to CSI controller plugin pods
214+
HostNetwork *bool `json:"hostNetwork,omitempty"`
213215
// Embedded common pods spec
214216
PodCommonSpec `json:",inline"`
215217

api/v1alpha1/zz_generated.deepcopy.go

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

config/crd/bases/csi.ceph.io_drivers.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,10 @@ spec:
10511051
Default is RollingUpdate.
10521052
type: string
10531053
type: object
1054+
hostNetwork:
1055+
description: hostNetwork setting to be propagated to CSI controller
1056+
plugin pods
1057+
type: boolean
10541058
imagePullPolicy:
10551059
description: To indicate the image pull policy to be applied to
10561060
all the containers in the csi driver pods.

config/crd/bases/csi.ceph.io_operatorconfigs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,10 @@ spec:
10601060
"RollingUpdate". Default is RollingUpdate.
10611061
type: string
10621062
type: object
1063+
hostNetwork:
1064+
description: hostNetwork setting to be propagated to CSI controller
1065+
plugin pods
1066+
type: boolean
10631067
imagePullPolicy:
10641068
description: To indicate the image pull policy to be applied
10651069
to all the containers in the csi driver pods.

deploy/all-in-one/install.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,6 +1301,10 @@ spec:
13011301
Default is RollingUpdate.
13021302
type: string
13031303
type: object
1304+
hostNetwork:
1305+
description: hostNetwork setting to be propagated to CSI controller
1306+
plugin pods
1307+
type: boolean
13041308
imagePullPolicy:
13051309
description: To indicate the image pull policy to be applied to
13061310
all the containers in the csi driver pods.
@@ -8161,6 +8165,10 @@ spec:
81618165
"RollingUpdate". Default is RollingUpdate.
81628166
type: string
81638167
type: object
8168+
hostNetwork:
8169+
description: hostNetwork setting to be propagated to CSI controller
8170+
plugin pods
8171+
type: boolean
81648172
imagePullPolicy:
81658173
description: To indicate the image pull policy to be applied
81668174
to all the containers in the csi driver pods.

deploy/multifile/crd.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,10 @@ spec:
12921292
Default is RollingUpdate.
12931293
type: string
12941294
type: object
1295+
hostNetwork:
1296+
description: hostNetwork setting to be propagated to CSI controller
1297+
plugin pods
1298+
type: boolean
12951299
imagePullPolicy:
12961300
description: To indicate the image pull policy to be applied to
12971301
all the containers in the csi driver pods.
@@ -8152,6 +8156,10 @@ spec:
81528156
"RollingUpdate". Default is RollingUpdate.
81538157
type: string
81548158
type: object
8159+
hostNetwork:
8160+
description: hostNetwork setting to be propagated to CSI controller
8161+
plugin pods
8162+
type: boolean
81558163
imagePullPolicy:
81568164
description: To indicate the image pull policy to be applied
81578165
to all the containers in the csi driver pods.

internal/controller/driver_controller.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ func (r *driverReconcile) reconcileControllerPluginDeployment() error {
575575
Spec: corev1.PodSpec{
576576
ServiceAccountName: serviceAccountName,
577577
PriorityClassName: ptr.Deref(pluginSpec.PrioritylClassName, ""),
578+
HostNetwork: ptr.Deref(pluginSpec.HostNetwork, false),
578579
Affinity: getControllerPluginPodAffinity(pluginSpec, &appSelector),
579580
Tolerations: pluginSpec.Tolerations,
580581
Containers: utils.Call(func() []corev1.Container {

vendor/github.com/ceph/ceph-csi-operator/api/v1alpha1/driver_types.go

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

vendor/github.com/ceph/ceph-csi-operator/api/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)