Skip to content

Commit

Permalink
Merge tag 'v1.28.3' into feature/csiTimeout1.28
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelEischer committed Nov 13, 2024
2 parents 019e53a + 078818a commit 0a97de4
Show file tree
Hide file tree
Showing 53 changed files with 781 additions and 230 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release-cpo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest

permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -21,6 +23,6 @@ jobs:
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.1.0
uses: helm/chart-releaser-action@v1.6.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
run:
concurrency: 2
timeout: 10m0s
linters:
enable:
- gofmt
output:
format: line-number
formats:
 - format: line-number
 path: stdout
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $(BUILD_CMDS): $(SOURCES)
test: unit functional

check: work
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.56.0 run ./...
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run ./...

unit: work
go test -tags=unit $(shell go list ./... | sed -e '/sanity/ { N; d; }' | sed -e '/tests/ {N; d;}') $(TESTARGS)
Expand Down
4 changes: 2 additions & 2 deletions charts/cinder-csi-plugin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: v1.28.2
appVersion: v1.28.3
description: Cinder CSI Chart for OpenStack
name: openstack-cinder-csi
version: 2.28.2
version: 2.28.3
home: https://github.com/kubernetes/cloud-provider-openstack
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions charts/manila-csi-plugin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
appVersion: v1.28.2
appVersion: v1.28.3
description: Manila CSI Chart for OpenStack
name: openstack-manila-csi
version: 2.28.2
version: 2.28.3
home: http://github.com/kubernetes/cloud-provider-openstack
icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions charts/openstack-cloud-controller-manager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
apiVersion: v1
appVersion: v1.28.2
appVersion: v1.28.3
description: Openstack Cloud Controller Manager Helm Chart
icon: https://object-storage-ca-ymq-1.vexxhost.net/swift/v1/6e4619c416ff4bd19e1c087f27a43eea/www-images-prod/openstack-logo/OpenStack-Logo-Vertical.png
home: https://github.com/kubernetes/cloud-provider-openstack
name: openstack-cloud-controller-manager
version: 2.28.4
version: 2.28.5
maintainers:
- name: eumel8
email: f.kloeker@telekom.de
Expand Down
56 changes: 40 additions & 16 deletions cmd/cinder-csi-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ import (
)

var (
endpoint string
nodeID string
cloudConfig []string
cluster string
httpEndpoint string
endpoint string
nodeID string
cloudConfig []string
cluster string
httpEndpoint string
provideControllerService bool
provideNodeService bool
noClient bool
)

func main() {
Expand Down Expand Up @@ -64,7 +67,12 @@ func main() {
}

cmd.PersistentFlags().StringVar(&cluster, "cluster", "", "The identifier of the cluster that the plugin is running in.")
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")
cmd.PersistentFlags().StringVar(&httpEndpoint, "http-endpoint", "", "The TCP network address where the HTTP server for providing metrics for diagnostics, will listen (example: `:8080`). The default is empty string, which means the server is disabled.")

cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")
cmd.PersistentFlags().BoolVar(&noClient, "node-service-no-os-client", false, "If set to true then the CSI driver node service will not use the OpenStack client (default: false)")

openstack.AddExtraFlags(pflag.CommandLine)

code := cli.Run(cmd)
Expand All @@ -73,19 +81,35 @@ func main() {

func handle() {
// Initialize cloud
d := cinder.NewDriver(endpoint, cluster)
d := cinder.NewDriver(&cinder.DriverOpts{Endpoint: endpoint, ClusterID: cluster})

openstack.InitOpenStackProvider(cloudConfig, httpEndpoint)
cloud, err := openstack.GetOpenStackProvider()
if err != nil {
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
return

if provideControllerService {
cloud, err := openstack.GetOpenStackProvider(false)
if err != nil {
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
return
}

d.SetupControllerService(cloud)
}
//Initialize mount
mount := mount.GetMountProvider()

//Initialize Metadata
metadata := metadata.GetMetadataProvider(cloud.GetMetadataOpts().SearchOrder)
if provideNodeService {
cloud, err := openstack.GetOpenStackProvider(noClient)
if err != nil {
klog.Warningf("Failed to GetOpenStackProvider: %v", err)
return
}

//Initialize mount
mount := mount.GetMountProvider()

//Initialize Metadata
metadata := metadata.GetMetadataProvider(cloud.GetMetadataOpts().SearchOrder)

d.SetupNodeService(cloud, mount, metadata)
}

d.SetupDriver(cloud, mount, metadata)
d.Run()
}
64 changes: 41 additions & 23 deletions cmd/manila-csi-plugin/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ var (
clusterID string

// Runtime options
endpoint string
runtimeConfigFile string
userAgentData []string
endpoint string
runtimeConfigFile string
userAgentData []string
provideControllerService bool
provideNodeService bool
)

func validateShareProtocolSelector(v string) error {
Expand All @@ -69,29 +71,45 @@ func main() {
Short: "CSI Manila driver",
Run: func(cmd *cobra.Command, args []string) {
if err := validateShareProtocolSelector(protoSelector); err != nil {
klog.Fatalf(err.Error())
klog.Fatal(err.Error())
}

manilaClientBuilder := &manilaclient.ClientBuilder{UserAgent: "manila-csi-plugin", ExtraUserAgentData: userAgentData}
csiClientBuilder := &csiclient.ClientBuilder{}

d, err := manila.NewDriver(
&manila.DriverOpts{
DriverName: driverName,
NodeID: nodeID,
NodeAZ: nodeAZ,
WithTopology: withTopology,
ShareProto: protoSelector,
ServerCSIEndpoint: endpoint,
FwdCSIEndpoint: fwdEndpoint,
ManilaClientBuilder: manilaClientBuilder,
CSIClientBuilder: csiClientBuilder,
ClusterID: clusterID,
},
)
opts := &manila.DriverOpts{
DriverName: driverName,
WithTopology: withTopology,
ShareProto: protoSelector,
ServerCSIEndpoint: endpoint,
FwdCSIEndpoint: fwdEndpoint,
ManilaClientBuilder: manilaClientBuilder,
CSIClientBuilder: csiClientBuilder,
ClusterID: clusterID,
}

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

d, err := manila.NewDriver(opts)
if err != nil {
klog.Fatalf("driver initialization failed: %v", err)
klog.Fatalf("Driver initialization failed: %v", err)
}

if provideControllerService {
err = d.SetupControllerService()
if err != nil {
klog.Fatalf("Driver controller service initialization failed: %v", err)
}
}

if provideNodeService {
err = d.SetupNodeService()
if err != nil {
klog.Fatalf("Driver node service initialization failed: %v", err)
}
}

runtimeconfig.RuntimeConfigFilename = runtimeConfigFile
Expand All @@ -105,10 +123,7 @@ func main() {

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

cmd.PersistentFlags().StringVar(&nodeID, "nodeid", "", "this node's ID")
if err := cmd.MarkPersistentFlagRequired("nodeid"); err != nil {
klog.Fatalf("Unable to mark flag nodeid to be required: %v", err)
}
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(&nodeAZ, "nodeaz", "", "this node's availability zone")

Expand All @@ -132,6 +147,9 @@ func main() {

cmd.PersistentFlags().StringVar(&clusterID, "cluster-id", "", "The identifier of the cluster that the plugin is running in.")

cmd.PersistentFlags().BoolVar(&provideControllerService, "provide-controller-service", true, "If set to true then the CSI driver does provide the controller service (default: true)")
cmd.PersistentFlags().BoolVar(&provideNodeService, "provide-node-service", true, "If set to true then the CSI driver does provide the node service (default: true)")

code := cli.Run(cmd)
os.Exit(code)
}
46 changes: 38 additions & 8 deletions docs/cinder-csi-plugin/using-cinder-csi-plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,36 @@ In addition to the standard set of klog flags, `cinder-csi-plugin` accepts the f

This will be added as metadata to every Cinder volume created by this plugin.
</dd>

<dt>--http-endpoint &lt;HTTP server&gt;</dt>
<dd>
This argument is optional.

The TCP network address where the HTTP server for providing metrics for diagnostics, will listen (example: `:8080`).

The default is empty string, which means the server is disabled.
</dd>

<dt>--provide-controller-service &lt;enabled&gt;</dt>
<dd>
If set to true then the CSI driver does provide the controller service.

The default is to provide the controller service.
</dd>

<dt>--provide-node-service &lt;enabled&gt;</dt>
<dd>
If set to true then the CSI driver does provide the node service.

The default is to provide the node service.
</dd>

<dt>--node-service-no-os-client &lt;disabled&gt;</dt>
<dd>
If set to true then the CSI driver does not provide the OpenStack client in the node service.

The default is to provide the OpenStack client in the node service.
</dd>
</dl>

## Driver Config
Expand All @@ -104,7 +134,7 @@ Implementation of `cinder-csi-plugin` relies on following OpenStack services.
For Driver configuration, parameters must be passed via configuration file specified in `$CLOUD_CONFIG` environment variable.
The following sections are supported in configuration file.

### Global
### Global
For Cinder CSI Plugin to authenticate with OpenStack Keystone, required parameters needs to be passed in `[Global]` section of the file. For all supported parameters, please refer [Global](../openstack-cloud-controller-manager/using-openstack-cloud-controller-manager.md#global) section.

### Block Storage
Expand Down Expand Up @@ -186,7 +216,7 @@ cinder.csi.openstack.org true true false <
mountPath: /etc/cacert
readOnly: true
volumes:
volumes:
....
- name: cacert
hostPath:
Expand Down Expand Up @@ -244,7 +274,7 @@ helm install --namespace kube-system --name cinder-csi ./charts/cinder-csi-plugi
| StorageClass `parameters` | `availability` | `nova` | String. Volume Availability Zone |
| StorageClass `parameters` | `type` | Empty String | String. Name/ID of Volume type. Corresponding volume type should exist in cinder |
| VolumeSnapshotClass `parameters` | `force-create` | `false` | Enable to support creating snapshot for a volume in in-use status |
| Inline Volume `volumeAttributes` | `capacity` | `1Gi` | volume size for creating inline volumes|
| Inline Volume `volumeAttributes` | `capacity` | `1Gi` | volume size for creating inline volumes|
| Inline Volume `VolumeAttributes` | `type` | Empty String | Name/ID of Volume type. Corresponding volume type should exist in cinder |

## Local Development
Expand All @@ -256,14 +286,14 @@ To build the plugin, run
```
$ export ARCH=amd64 # Defaults to amd64
$ make build-cmd-cinder-csi-plugin
```
```

To build cinder-csi-plugin image

```
$ export ARCH=amd64 # Defaults to amd64
$ make image-cinder-csi-plugin
```
$ make build-local-image-cinder-csi-plugin
```

### Testing

Expand All @@ -274,7 +304,7 @@ To run all unit tests:
$ make test
```
#### Sanity Tests
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)
Sanity tests ensures the CSI spec conformance of the driver. For more info, refer [Sanity check](https://github.com/kubernetes-csi/csi-test/tree/master/pkg/sanity)

Run sanity tests for cinder CSI driver using:

Expand All @@ -288,5 +318,5 @@ Optionally, to test the driver csc tool could be used. please refer, [usage guid

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.

* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
* The CSI Migration feature for Cinder, when enabled, shims all plugin operations from the existing in-tree plugin to the `cinder.csi.openstack.org` CSI Driver.
* For more info, please refer [Migrate to CCM with CSI Migration](../openstack-cloud-controller-manager/migrate-to-ccm-with-csimigration.md#migrate-from-in-tree-cloud-provider-to-openstack-cloud-controller-manager-and-enable-csimigration) guide
4 changes: 2 additions & 2 deletions docs/developers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ In cloud-provider-openstack repo directory, run:
```
REGISTRY=<your-dockerhub-account> \
VERSION=<image-tag> \
make image-openstack-cloud-controller-manager
make build-local-image-openstack-cloud-controller-manager
```

The above command builds a container image locally with the name:
Expand All @@ -121,7 +121,7 @@ You may notice there is a suffix `-amd64` because cloud-provider-openstack suppo
ARCH=amd64 \
REGISTRY=<your-dockerhub-account> \
VERSION=<image-tag> \
make image-openstack-cloud-controller-manager
make build-local-image-openstack-cloud-controller-manager
```

If the kubernetes cluster can't access the image locally, you need to upload the image to container registry first by running `docker push`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ it as a service. There are several things we need to notice in the
deployment manifest:

- We are using image
`registry.k8s.io/provider-os/k8s-keystone-auth:v1.28.2`
`registry.k8s.io/provider-os/k8s-keystone-auth:v1.28.3`
- We use `k8s-auth-policy` configmap created above.
- The pod uses service account `keystone-auth` created above.
- We use `keystone-auth-certs` secret created above to inject the
Expand Down
2 changes: 1 addition & 1 deletion docs/magnum-auto-healer/using-magnum-auto-healer.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ user_id=ceb61464a3d341ebabdf97d1d4b97099
user_project_id=b23a5e41d1af4c20974bf58b4dff8e5a
password=password
region=RegionOne
image=registry.k8s.io/provider-os/magnum-auto-healer:v1.28.2
image=registry.k8s.io/provider-os/magnum-auto-healer:v1.28.3

cat <<EOF | kubectl apply -f -
---
Expand Down
Loading

0 comments on commit 0a97de4

Please sign in to comment.