Merge pull request #15095 from infonova/use-clustername-in-cinder-csi-plugin

Pass actual cluster name to cinder-csi-plugin
This commit is contained in:
Kubernetes Prow Robot 2023-02-13 09:33:29 -08:00 committed by GitHub
commit ca3b53c00a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 28 additions and 3 deletions

View File

@ -428,6 +428,10 @@ spec:
properties: properties:
bs-version: bs-version:
type: string type: string
clusterName:
description: ClusterName sets the --cluster flag for the
cinder-csi-plugin to the provided name
type: string
createStorageClass: createStorageClass:
description: CreateStorageClass provisions a default class description: CreateStorageClass provisions a default class
for the Cinder plugin for the Cinder plugin

View File

@ -790,6 +790,8 @@ type OpenstackBlockStorageConfig struct {
CreateStorageClass *bool `json:"createStorageClass,omitempty"` CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"` CSIPluginImage string `json:"csiPluginImage,omitempty"`
CSITopologySupport *bool `json:"csiTopologySupport,omitempty"` CSITopologySupport *bool `json:"csiTopologySupport,omitempty"`
// ClusterName sets the --cluster flag for the cinder-csi-plugin to the provided name
ClusterName string `json:"clusterName,omitempty"`
} }
// OpenstackMonitor defines the config for a health monitor // OpenstackMonitor defines the config for a health monitor

View File

@ -796,6 +796,8 @@ type OpenstackBlockStorageConfig struct {
CreateStorageClass *bool `json:"createStorageClass,omitempty"` CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"` CSIPluginImage string `json:"csiPluginImage,omitempty"`
CSITopologySupport *bool `json:"csiTopologySupport,omitempty"` CSITopologySupport *bool `json:"csiTopologySupport,omitempty"`
// ClusterName sets the --cluster flag for the cinder-csi-plugin to the provided name
ClusterName string `json:"clusterName,omitempty"`
} }
// OpenstackMonitor defines the config for a health monitor // OpenstackMonitor defines the config for a health monitor

View File

@ -6420,6 +6420,7 @@ func autoConvert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStor
out.CreateStorageClass = in.CreateStorageClass out.CreateStorageClass = in.CreateStorageClass
out.CSIPluginImage = in.CSIPluginImage out.CSIPluginImage = in.CSIPluginImage
out.CSITopologySupport = in.CSITopologySupport out.CSITopologySupport = in.CSITopologySupport
out.ClusterName = in.ClusterName
return nil return nil
} }
@ -6436,6 +6437,7 @@ func autoConvert_kops_OpenstackBlockStorageConfig_To_v1alpha2_OpenstackBlockStor
out.CreateStorageClass = in.CreateStorageClass out.CreateStorageClass = in.CreateStorageClass
out.CSIPluginImage = in.CSIPluginImage out.CSIPluginImage = in.CSIPluginImage
out.CSITopologySupport = in.CSITopologySupport out.CSITopologySupport = in.CSITopologySupport
out.ClusterName = in.ClusterName
return nil return nil
} }

View File

@ -787,6 +787,8 @@ type OpenstackBlockStorageConfig struct {
CreateStorageClass *bool `json:"createStorageClass,omitempty"` CreateStorageClass *bool `json:"createStorageClass,omitempty"`
CSIPluginImage string `json:"csiPluginImage,omitempty"` CSIPluginImage string `json:"csiPluginImage,omitempty"`
CSITopologySupport *bool `json:"csiTopologySupport,omitempty"` CSITopologySupport *bool `json:"csiTopologySupport,omitempty"`
// ClusterName sets the --cluster flag for the cinder-csi-plugin to the provided name
ClusterName string `json:"clusterName,omitempty"`
} }
// OpenstackMonitor defines the config for a health monitor // OpenstackMonitor defines the config for a health monitor

View File

@ -6669,6 +6669,7 @@ func autoConvert_v1alpha3_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStor
out.CreateStorageClass = in.CreateStorageClass out.CreateStorageClass = in.CreateStorageClass
out.CSIPluginImage = in.CSIPluginImage out.CSIPluginImage = in.CSIPluginImage
out.CSITopologySupport = in.CSITopologySupport out.CSITopologySupport = in.CSITopologySupport
out.ClusterName = in.ClusterName
return nil return nil
} }
@ -6685,6 +6686,7 @@ func autoConvert_kops_OpenstackBlockStorageConfig_To_v1alpha3_OpenstackBlockStor
out.CreateStorageClass = in.CreateStorageClass out.CreateStorageClass = in.CreateStorageClass
out.CSIPluginImage = in.CSIPluginImage out.CSIPluginImage = in.CSIPluginImage
out.CSITopologySupport = in.CSITopologySupport out.CSITopologySupport = in.CSITopologySupport
out.ClusterName = in.ClusterName
return nil return nil
} }

View File

@ -14,6 +14,7 @@ spec:
openstack: openstack:
blockStorage: blockStorage:
bs-version: v3 bs-version: v3
clusterName: minimal.k8s.local
ignore-volume-az: false ignore-volume-az: false
monitor: monitor:
delay: 15s delay: 15s

View File

@ -14,6 +14,7 @@ spec:
openstack: openstack:
blockStorage: blockStorage:
bs-version: v3 bs-version: v3
clusterName: ha.example.com
ignore-volume-az: false ignore-volume-az: false
loadbalancer: loadbalancer:
floatingNetwork: vlan1 floatingNetwork: vlan1

View File

@ -14,6 +14,7 @@ spec:
openstack: openstack:
blockStorage: blockStorage:
bs-version: v3 bs-version: v3
clusterName: minimal.k8s.local
ignore-volume-az: false ignore-volume-az: false
loadbalancer: loadbalancer:
floatingNetwork: vlan1 floatingNetwork: vlan1

View File

@ -333,7 +333,7 @@ spec:
- name: CLOUD_CONFIG - name: CLOUD_CONFIG
value: /etc/kubernetes/cloud.config value: /etc/kubernetes/cloud.config
- name: CLUSTER_NAME - name: CLUSTER_NAME
value: kubernetes value: "{{- if .CloudProvider.Openstack.BlockStorage.ClusterName -}} {{ .CloudProvider.Openstack.BlockStorage.ClusterName }} {{- else -}} kubernetes {{- end -}}"
imagePullPolicy: "IfNotPresent" imagePullPolicy: "IfNotPresent"
ports: ports:
- containerPort: 9808 - containerPort: 9808
@ -465,11 +465,18 @@ spec:
- /bin/cinder-csi-plugin - /bin/cinder-csi-plugin
- "--endpoint=$(CSI_ENDPOINT)" - "--endpoint=$(CSI_ENDPOINT)"
- "--cloud-config=$(CLOUD_CONFIG)" - "--cloud-config=$(CLOUD_CONFIG)"
{{- if .CloudProvider.Openstack.BlockStorage.ClusterName }}
- "--cluster=$(CLUSTER_NAME)"
{{- end }}
env: env:
- name: CSI_ENDPOINT - name: CSI_ENDPOINT
value: unix://csi/csi.sock value: unix://csi/csi.sock
- name: CLOUD_CONFIG - name: CLOUD_CONFIG
value: /etc/kubernetes/cloud.config value: /etc/kubernetes/cloud.config
{{- if .CloudProvider.Openstack.BlockStorage.ClusterName }}
- name: CLUSTER_NAME
value: {{ .CloudProvider.Openstack.BlockStorage.ClusterName }}
{{- end }}
imagePullPolicy: "IfNotPresent" imagePullPolicy: "IfNotPresent"
ports: ports:
- containerPort: 9808 - containerPort: 9808

View File

@ -324,8 +324,9 @@ func NewCluster(opt *NewClusterOptions, clientset simple.Clientset) (*NewCluster
ExternalNetwork: fi.PtrTo(opt.OpenstackExternalNet), ExternalNetwork: fi.PtrTo(opt.OpenstackExternalNet),
}, },
BlockStorage: &api.OpenstackBlockStorageConfig{ BlockStorage: &api.OpenstackBlockStorageConfig{
Version: fi.PtrTo("v3"), Version: fi.PtrTo("v3"),
IgnoreAZ: fi.PtrTo(opt.OpenstackStorageIgnoreAZ), IgnoreAZ: fi.PtrTo(opt.OpenstackStorageIgnoreAZ),
ClusterName: opt.ClusterName,
}, },
Monitor: &api.OpenstackMonitor{ Monitor: &api.OpenstackMonitor{
Delay: fi.PtrTo("15s"), Delay: fi.PtrTo("15s"),