Skip to content

Commit

Permalink
Merge pull request #7 from gnufied/rebase-release-22-openshift
Browse files Browse the repository at this point in the history
Rebase against release 2.2 version
  • Loading branch information
openshift-merge-robot committed Apr 9, 2021
2 parents ac23b1d + 1b22769 commit dd5345e
Show file tree
Hide file tree
Showing 211 changed files with 9,061 additions and 6,795 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -13,6 +13,7 @@ Documentation for vSphere CSI Driver is available here:

## vSphere CSI Driver Releases

* [v2.1.1](docs/book/releases/v2.1.1.md)
* [v2.1.0](docs/book/releases/v2.1.0.md)
* [v2.0.1](docs/book/releases/v2.0.1.md)
* [v2.0.0](docs/book/releases/v2.0.0.md)
Expand Down
25 changes: 22 additions & 3 deletions cmd/syncer/main.go
Expand Up @@ -20,8 +20,13 @@ import (
"context"
"flag"
"fmt"
"net/http"
"os"

"github.com/prometheus/client_golang/prometheus/promhttp"
"sigs.k8s.io/vsphere-csi-driver/pkg/common/prometheus"
"sigs.k8s.io/vsphere-csi-driver/pkg/csi/service/common"

"github.com/kubernetes-csi/csi-lib-utils/leaderelection"
cnstypes "github.com/vmware/govmomi/cns/types"

Expand All @@ -34,7 +39,6 @@ import (
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/cnsoperator/manager"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/k8scloudoperator"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/storagepool"
"sigs.k8s.io/vsphere-csi-driver/pkg/syncer/types"
)

// OperationModeWebHookServer starts container for webhook server
Expand Down Expand Up @@ -84,7 +88,7 @@ func main() {
} else if *operationMode == operationModeMetaDataSync {
log.Infof("Starting container with operation mode: %v", operationModeMetaDataSync)
var err error
configInfo, err := types.InitConfigInfo(ctx)
configInfo, err := common.InitConfigInfo(ctx)
if err != nil {
log.Errorf("failed to initialize the configInfo. Err: %+v", err)
os.Exit(1)
Expand All @@ -103,6 +107,21 @@ func main() {
}
}()
}

// Go module to keep the metrics http server running all the time.
go func() {
prometheus.SyncerInfo.WithLabelValues(syncer.Version).Set(1)
for {
log.Info("Starting the http server to expose Prometheus metrics..")
http.Handle("/metrics", promhttp.Handler())
err = http.ListenAndServe(":2113", nil)
if err != nil {
log.Warnf("Http server that exposes the Prometheus exited with err: %+v", err)
}
log.Info("Restarting http server to expose Prometheus metrics..")
}
}()

// Initialize syncer components that are dependant on the outcome of leader election, if enabled.
run = initSyncerComponents(ctx, clusterFlavor, configInfo, &syncer.COInitParams)

Expand Down Expand Up @@ -132,7 +151,7 @@ func main() {
// initSyncerComponents initializes syncer components that are dependant on the leader election algorithm.
// This function is only called by the leader instance of vsphere-syncer, if enabled.
// TODO: Change name from initSyncerComponents to init<Name>Components where <Name> will be the name of this container
func initSyncerComponents(ctx context.Context, clusterFlavor cnstypes.CnsClusterFlavor, configInfo *types.ConfigInfo, coInitParams *interface{}) func(ctx context.Context) {
func initSyncerComponents(ctx context.Context, clusterFlavor cnstypes.CnsClusterFlavor, configInfo *config.ConfigurationInfo, coInitParams *interface{}) func(ctx context.Context) {
return func(ctx context.Context) {
log := logger.GetLogger(ctx)
// Initialize CNS Operator for Supervisor clusters
Expand Down
2 changes: 1 addition & 1 deletion docs/book/README.md
Expand Up @@ -25,4 +25,4 @@ CNS supports the following Kubernetes distributions:

- [Vanilla Kubernetes](https://github.com/kubernetes/kubernetes)
- [vSphere with Kubernetes](https://blogs.vmware.com/vsphere/2019/08/introducing-project-pacific.html) aka Supervisor Cluster. For more information, see [vSphere with Kubernetes Configuration and Management](https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-kubernetes/GUID-152BE7D2-E227-4DAA-B527-557B564D9718.html).
- [Tanzu Kubernetes Grid Service](https://blogs.vmware.com/vsphere/2020/03/vsphere-7-tanzu-kubernetes-clusters.html). For more information, see [Provisioning and Managing Tanzu Kubernetes Clusters Using the Tanzu Kubernetes Grid Service](https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-kubernetes/GUID-7E00E7C2-D1A1-4F7D-9110-620F30C02547.html).
- [Tanzu Kubernetes Grid Service](https://blogs.vmware.com/vsphere/2020/03/vsphere-7-tanzu-kubernetes-clusters.html). For more information, see [Provisioning and Managing Tanzu Kubernetes Clusters Using the Tanzu Kubernetes Grid Service](https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-2597788E-2FA4-420E-B9BA-9423F8F7FD9F.html).
1 change: 1 addition & 0 deletions docs/book/SUMMARY.md
Expand Up @@ -4,6 +4,7 @@
* [Overview](overview.md)
* Releases
* Native Kubernetes on vSphere
* [v2.1.1](releases/v2.1.1.md)
* [v2.1.0](releases/v2.1.0.md)
* [v2.0.1](releases/v2.0.1.md)
* [v2.0.0](releases/v2.0.0.md)
Expand Down
24 changes: 14 additions & 10 deletions docs/book/compatiblity_matrix.md
@@ -1,17 +1,21 @@
# Compatibility Matrix for vSphere CSI Driver

- vSphere CSI driver is released with specific version of CSI sidecar containers which has the minimum kubernetes version requirement.
- vSphere CSI driver is released with specific version of CSI sidecar containers which has the minimum and maximum kubernetes version requirement.

| vSphere CSI Driver | Minimum Kubernetes Version |
|--------------------|----------------------------|
| v1.0.2 | v1.14.0 |
| v1.0.3 | v1.14.0 |
| v2.0.0 | v1.16.0 |
| v2.0.1 | v1.17.0 |
| v2.1.0 | v1.17.0 |
Note:

- vSphere CSI driver is compatible with vSphere 67u3, vSphere 7.0 and 7.0u1.
- vSphere CSI Driver is backward and forward compatible to vSphere releases
- vmware supports the deprecated release of the driver until End Of Life date.

| vSphere CSI Driver | Minimum Kubernetes Release | Maximum Kubernetes Release | Deprecated | End of Life |
|--------------------|----------------------------|---------------------------------------| -----------|--------------|
| [v2.1.1](./releases/v2.1.1.md) | 1.17 | 1.19 | No | - |
| [v2.1.0](./releases/v2.1.0.md) | 1.17 | 1.19 | No | - |
| [v2.0.1](./releases/v2.0.1.md) | 1.17 | 1.19 | Yes | January 2022 |
| [v2.0.0](./releases/v2.0.0.md) | 1.16 | 1.18 | Yes | January 2022 |
| [v1.0.3](./releases/v1.0.3.md) | 1.14 | 1.16 | Yes | June 2021 |
| [v1.0.2](./releases/v1.0.2.md) | 1.14 | 1.16 | Yes | January 2021 |

- vSphere CSI driver is compatible with vSphere 67u3, vSphere 7.0 and 7.0u1. If you have a newer vCenter version but older ESXi hosts, new features added in the newer vCenter will not work until all the ESXi hosts are upgraded to the newer version.
- For bug fixes and performance improvements, user can deploy the latest vSphere CSI driver without upgrading vSphere.
- Features added in the newer vSphere releases does not work on the older vSphere CSI driver. Refer to [feature matrix](supported_features_matrix.md) to learn about what features added in each release of vSphere and CSI driver.

Expand Down
4 changes: 3 additions & 1 deletion docs/book/driver-deployment/installation.md
Expand Up @@ -86,6 +86,8 @@ Where the entries have the following meaning:
- `datacenters` - list of all comma separated datacenter paths where kubernetes node VMs are present. When datacenter is located at the root, the name of datacenter is enough but when datacenter is placed in the folder, path needs to be specified as `folder/datacenter-name`.
Please note since comma is used as a delimiter, the datacenter name itself must not contain a comma.

**Note:** To deploy CSI driver for block volume in VMC environment, in the vSphere configuration file, need to specifiy cloudadmin user in `user` field and cloudadmin password in `password` field.

### vSphere configuration file for file volumes <a id="vsphereconf_for_file"></a>

For file volumes, there are some extra parameters added to the config to help specify network permissions and placement of volumes. A sample config file for file volumes is shown below.
Expand Down Expand Up @@ -126,7 +128,7 @@ datacenters = "<datacenter1-path>, <datacenter2-path>, ..."
targetvSANFileShareDatastoreURLs = "ds:///vmfs/volumes/vsan:52635b9067079319-95a7473222c4c9cd/" # Optional
```

Some of the parameters have been explained in the previous section for block volumes.
Some of the parameters have been explained in the previous section for block volumes.

`targetvSANFileShareDatastoreURLs` and `NetPermissions` section are exclusive to file volumes and are optional.

Expand Down

0 comments on commit dd5345e

Please sign in to comment.