mirror of https://github.com/kubernetes/kops.git
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:
commit
ca3b53c00a
|
@ -428,6 +428,10 @@ spec:
|
|||
properties:
|
||||
bs-version:
|
||||
type: string
|
||||
clusterName:
|
||||
description: ClusterName sets the --cluster flag for the
|
||||
cinder-csi-plugin to the provided name
|
||||
type: string
|
||||
createStorageClass:
|
||||
description: CreateStorageClass provisions a default class
|
||||
for the Cinder plugin
|
||||
|
|
|
@ -790,6 +790,8 @@ type OpenstackBlockStorageConfig struct {
|
|||
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
|
||||
CSIPluginImage string `json:"csiPluginImage,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
|
||||
|
|
|
@ -796,6 +796,8 @@ type OpenstackBlockStorageConfig struct {
|
|||
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
|
||||
CSIPluginImage string `json:"csiPluginImage,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
|
||||
|
|
|
@ -6420,6 +6420,7 @@ func autoConvert_v1alpha2_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStor
|
|||
out.CreateStorageClass = in.CreateStorageClass
|
||||
out.CSIPluginImage = in.CSIPluginImage
|
||||
out.CSITopologySupport = in.CSITopologySupport
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -6436,6 +6437,7 @@ func autoConvert_kops_OpenstackBlockStorageConfig_To_v1alpha2_OpenstackBlockStor
|
|||
out.CreateStorageClass = in.CreateStorageClass
|
||||
out.CSIPluginImage = in.CSIPluginImage
|
||||
out.CSITopologySupport = in.CSITopologySupport
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -787,6 +787,8 @@ type OpenstackBlockStorageConfig struct {
|
|||
CreateStorageClass *bool `json:"createStorageClass,omitempty"`
|
||||
CSIPluginImage string `json:"csiPluginImage,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
|
||||
|
|
|
@ -6669,6 +6669,7 @@ func autoConvert_v1alpha3_OpenstackBlockStorageConfig_To_kops_OpenstackBlockStor
|
|||
out.CreateStorageClass = in.CreateStorageClass
|
||||
out.CSIPluginImage = in.CSIPluginImage
|
||||
out.CSITopologySupport = in.CSITopologySupport
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -6685,6 +6686,7 @@ func autoConvert_kops_OpenstackBlockStorageConfig_To_v1alpha3_OpenstackBlockStor
|
|||
out.CreateStorageClass = in.CreateStorageClass
|
||||
out.CSIPluginImage = in.CSIPluginImage
|
||||
out.CSITopologySupport = in.CSITopologySupport
|
||||
out.ClusterName = in.ClusterName
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ spec:
|
|||
openstack:
|
||||
blockStorage:
|
||||
bs-version: v3
|
||||
clusterName: minimal.k8s.local
|
||||
ignore-volume-az: false
|
||||
monitor:
|
||||
delay: 15s
|
||||
|
|
|
@ -14,6 +14,7 @@ spec:
|
|||
openstack:
|
||||
blockStorage:
|
||||
bs-version: v3
|
||||
clusterName: ha.example.com
|
||||
ignore-volume-az: false
|
||||
loadbalancer:
|
||||
floatingNetwork: vlan1
|
||||
|
|
|
@ -14,6 +14,7 @@ spec:
|
|||
openstack:
|
||||
blockStorage:
|
||||
bs-version: v3
|
||||
clusterName: minimal.k8s.local
|
||||
ignore-volume-az: false
|
||||
loadbalancer:
|
||||
floatingNetwork: vlan1
|
||||
|
|
|
@ -333,7 +333,7 @@ spec:
|
|||
- name: CLOUD_CONFIG
|
||||
value: /etc/kubernetes/cloud.config
|
||||
- name: CLUSTER_NAME
|
||||
value: kubernetes
|
||||
value: "{{- if .CloudProvider.Openstack.BlockStorage.ClusterName -}} {{ .CloudProvider.Openstack.BlockStorage.ClusterName }} {{- else -}} kubernetes {{- end -}}"
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
ports:
|
||||
- containerPort: 9808
|
||||
|
@ -465,11 +465,18 @@ spec:
|
|||
- /bin/cinder-csi-plugin
|
||||
- "--endpoint=$(CSI_ENDPOINT)"
|
||||
- "--cloud-config=$(CLOUD_CONFIG)"
|
||||
{{- if .CloudProvider.Openstack.BlockStorage.ClusterName }}
|
||||
- "--cluster=$(CLUSTER_NAME)"
|
||||
{{- end }}
|
||||
env:
|
||||
- name: CSI_ENDPOINT
|
||||
value: unix://csi/csi.sock
|
||||
- name: CLOUD_CONFIG
|
||||
value: /etc/kubernetes/cloud.config
|
||||
{{- if .CloudProvider.Openstack.BlockStorage.ClusterName }}
|
||||
- name: CLUSTER_NAME
|
||||
value: {{ .CloudProvider.Openstack.BlockStorage.ClusterName }}
|
||||
{{- end }}
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
ports:
|
||||
- containerPort: 9808
|
||||
|
|
|
@ -326,6 +326,7 @@ func NewCluster(opt *NewClusterOptions, clientset simple.Clientset) (*NewCluster
|
|||
BlockStorage: &api.OpenstackBlockStorageConfig{
|
||||
Version: fi.PtrTo("v3"),
|
||||
IgnoreAZ: fi.PtrTo(opt.OpenstackStorageIgnoreAZ),
|
||||
ClusterName: opt.ClusterName,
|
||||
},
|
||||
Monitor: &api.OpenstackMonitor{
|
||||
Delay: fi.PtrTo("15s"),
|
||||
|
|
Loading…
Reference in New Issue