Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manila-csi-plugin: Auto-configure --nodeid, --nodeaz parameters #2734

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ RUN apk add --no-cache ca-certificates
# builder itself is always amd64
FROM --platform=${BUILDPLATFORM} ${GOLANG_IMAGE} AS builder

ARG GOPROXY=https://goproxy.io,direct
ARG TARGETOS
ARG TARGETARCH
ARG VERSION
Expand Down
2 changes: 1 addition & 1 deletion charts/manila-csi-plugin/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: v1.31.2
description: Manila CSI Chart for OpenStack
name: openstack-manila-csi
version: 2.31.2
version: 2.31.3
home: http://github.com/kubernetes/cloud-provider-openstack
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
maintainers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ spec:
command: ["/bin/sh", "-c",
'/bin/manila-csi-plugin
-v={{ $.Values.logVerbosityLevel }}
--nodeid=$(NODE_ID)
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
--with-topology
--nodeaz={{ $.Values.csimanila.nodeAZ }}
{{- end }}
{{- if $.Values.csimanila.runtimeConfig.enabled }}
--runtime-config-file=/runtimeconfig/runtimeconfig.json
Expand All @@ -109,10 +107,6 @@ spec:
env:
- name: DRIVER_NAME
value: {{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi-controllerplugin.sock"
- name: FWD_CSI_ENDPOINT
Expand Down
6 changes: 0 additions & 6 deletions charts/manila-csi-plugin/templates/nodeplugin-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,11 @@ spec:
command: ["/bin/sh", "-c",
'/bin/manila-csi-plugin
-v={{ $.Values.logVerbosityLevel }}
--nodeid=$(NODE_ID)
{{- if $.Values.csimanila.runtimeConfig.enabled }}
--runtime-config-file=/runtimeconfig/runtimeconfig.json
{{- end }}
{{- if $.Values.csimanila.topologyAwarenessEnabled }}
--with-topology
--nodeaz={{ $.Values.csimanila.nodeAZ }}
{{- end }}
--endpoint=$(CSI_ENDPOINT)
--drivername=$(DRIVER_NAME)
Expand All @@ -67,10 +65,6 @@ spec:
env:
- name: DRIVER_NAME
value: {{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}
- name: NODE_ID
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: CSI_ENDPOINT
value: "unix:///var/lib/kubelet/plugins/{{ printf "%s.%s" .protocolSelector $.Values.driverName | lower }}/csi.sock"
- name: FWD_CSI_ENDPOINT
Expand Down
4 changes: 0 additions & 4 deletions charts/manila-csi-plugin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ csimanila:
}
}

# Availability zone for each node. topologyAwarenessEnabled must be set to true for this option to have any effect.
# If your Kubernetes cluster runs atop of Nova and want to use Nova AZs as AZs for the nodes of the cluster, uncomment the line below:
# nodeAZ: "$(curl http://169.254.169.254/openstack/latest/meta_data.json | jq -r .availability_zone)"

# You may set ID of the cluster where manila-csi is deployed. This value will be appended
# to share metadata in newly provisioned shares as `manila.csi.openstack.org/cluster=<cluster ID>`.
clusterID: ""
Expand Down
6 changes: 3 additions & 3 deletions cmd/cinder-csi-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func main() {
csi.AddPVCFlags(cmd)

cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "node id")
if err := cmd.PersistentFlags().MarkDeprecated("nodeid", "This flag would be removed in future. Currently, the value is ignored by the driver"); err != nil {
if err := cmd.PersistentFlags().MarkDeprecated("nodeid", "This option is now ignored by the driver. It will be removed in a future release."); err != nil {
klog.Fatalf("Unable to mark flag nodeid to be deprecated: %v", err)
}

Expand Down Expand Up @@ -129,7 +129,7 @@ func handle() {
}

if provideNodeService {
//Initialize mount
// Initialize mount
mount := mount.GetMountProvider()

cfg, err := openstack.GetConfigFromFiles(cloudConfig)
Expand All @@ -138,7 +138,7 @@ func handle() {
return
}

//Initialize Metadata
// Initialize Metadata
metadata := metadata.GetMetadataProvider(cfg.Metadata.SearchOrder)

d.SetupNodeService(mount, metadata, cfg.BlockStorage, additionalTopologies)
Expand Down
19 changes: 12 additions & 7 deletions cmd/manila-csi-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"k8s.io/cloud-provider-openstack/pkg/csi/manila/csiclient"
"k8s.io/cloud-provider-openstack/pkg/csi/manila/manilaclient"
"k8s.io/cloud-provider-openstack/pkg/csi/manila/runtimeconfig"
"k8s.io/cloud-provider-openstack/pkg/util/metadata"
"k8s.io/cloud-provider-openstack/pkg/version"
"k8s.io/component-base/cli"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -90,11 +91,6 @@ func main() {
PVCLister: csi.GetPVCLister(),
}

if provideNodeService {
opts.NodeID = nodeID
opts.NodeAZ = nodeAZ
}

d, err := manila.NewDriver(opts)
if err != nil {
klog.Fatalf("Driver initialization failed: %v", err)
Expand All @@ -108,7 +104,10 @@ func main() {
}

if provideNodeService {
err = d.SetupNodeService()
// Initialize metadata
metadata := metadata.GetMetadataProvider("")

err = d.SetupNodeService(metadata)
if err != nil {
klog.Fatalf("Driver node service initialization failed: %v", err)
}
Expand All @@ -127,9 +126,15 @@ func main() {

cmd.PersistentFlags().StringVar(&driverName, "drivername", "manila.csi.openstack.org", "name of the driver")

cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID. This value is required if the node service is provided by this CSI driver instance.")
cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID")
if err := cmd.PersistentFlags().MarkDeprecated("nodeid", "This option is now ignored by the driver. It will be removed in a future release."); err != nil {
klog.Fatalf("Unable to mark flag nodeid to be deprecated: %v", err)
}

cmd.PersistentFlags().StringVar(&nodeAZ, "nodeaz", "", "this node's availability zone")
if err := cmd.PersistentFlags().MarkDeprecated("nodeaz", "This option is now ignored by the driver. It will be removed in a future release."); err != nil {
klog.Fatalf("Unable to mark flag nodeaz to be deprecated: %v", err)
}

cmd.PersistentFlags().StringVar(&runtimeConfigFile, "runtime-config-file", "", "path to the runtime configuration file")

Expand Down
198 changes: 0 additions & 198 deletions docs/cinder-csi-plugin/csc-tool.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/cinder-csi-plugin/using-cinder-csi-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ In addition to the standard set of klog flags, `cinder-csi-plugin` accepts the f
<dl>
<dt>--nodeid &lt;node id&gt;</dt>
<dd>
This argument is deprecated, will be removed in future.
This argument is deprecated. It will be removed in future.

An identifier for the current node which will be used in OpenStack API calls. This can be either the UUID or name of the OpenStack server, but note that if using name it must be unique.
</dd>
Expand Down Expand Up @@ -335,8 +335,6 @@ Run sanity tests for cinder CSI driver using:
$ make test-cinder-csi-sanity
```

Optionally, to test the driver csc tool could be used. please refer, [usage guide](./csc-tool.md) for more info.

## In-tree Cinder provisioner to cinder CSI Migration

Starting from Kubernetes 1.21, OpenStack Cinder CSI migration is supported as beta feature and is `ON` by default. Cinder CSI driver must be installed on clusters on OpenStack for Cinder volumes to work. If you have persistence volumes that are created with in-tree `kubernetes.io/cinder` plugin, you could migrate to use `cinder.csi.openstack.org` Container Storage Interface (CSI) Driver.
Expand Down
Loading
Loading