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

Add the Nutanix CSI driver #1733

Merged
merged 12 commits into from
Jan 14, 2022
Merged

Add the Nutanix CSI driver #1733

merged 12 commits into from
Jan 14, 2022

Conversation

xmudrii
Copy link
Member

@xmudrii xmudrii commented Jan 12, 2022

What this PR does / why we need it:

This PR:

  • Add the Nutanix CSI driver addon. The addon is deployed manually, on-demand, by enabling the csi-nutanix embedded addon
    • The reason for not using .cloudProvider.external (like for other providers) is that Nutanix doesn't have an external CCM, so enabling external renders the cluster useless (there's no CCM to initialize nodes, so nodes remain tainted)
  • Add the default StorageClass for the Nutanix CSI driver. The StorageClass can be deployed by enabling the default-storage-class embedded addon
    • Note: this StorageClass might get changed before the final release to support additional features
    • This addon can take the following parameters in order to customize the StorageClass: storageContainer (default is Default), fsType (default is xfs), isSegmentedIscsiNetwork (default is false)
  • Add new environment variables used to provide endpoint and credentials for Prism Element: NUTANIX_PE_ENDPOINT, NUTANIX_PE_USERNAME, NUTANIX_PE_PASSWORD. Prism Element access is required by the Nutanix CSI driver
  • Rename the NUTANIX_ALLOW_INSECURE environment variable to NUTANIX_INSECURE
  • Remove the allow_insecure variable from Terraform configs for Nutanix in favor of the NUTANIX_INSECURE environment variable
  • Forbid enabling .cloudProvider.external for Nutanix clusters because Nutanix doesn't have an external CCM that would initialize nodes
  • Install and enable iscsid and NFS on Nutanix machines (required by the CSI driver)
  • Update machine-controller to v1.42.0
  • Fix a bug with the addons applier applying all files when addons path is not provided
  • Fixes control plane tolerations in Azure CCM and CSI addons (node-role.kubernetes.io/master doesn't have a value)

However, this PR doesn't implement the snapshot controller and functionalities. This will be tackled in a follow-up. It's also yet to test this on newer Kubernetes versions.

The following KubeOneCluster manifest can be used on Nutanix clusters (params are optional and can be omitted if you want to use default values):

apiVersion: kubeone.k8c.io/v1beta2
kind: KubeOneCluster
versions:
  kubernetes: 1.21.8
cloudProvider:
  nutanix: {}
addons:
  enable: true
  addons:
  - name: "csi-nutanix"
  - name: "default-storage-class"
    params:
      storageContainer: "Default"
      fsType: "xfs"
      isSegmentedIscsiNetwork: "false"

The following manifest has been used for testing:

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-pvc-ntnx
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: ntnx-csi
---
apiVersion: v1
kind: Pod
metadata:
  name: nginx
spec:
  containers:
  - image: nginx
    imagePullPolicy: IfNotPresent
    name: nginx
    ports:
    - containerPort: 80
      protocol: TCP
    volumeMounts:
      - mountPath: /var/lib/www/html
        name: csi-data-ntnx
  volumes:
  - name: csi-data-ntnx
    persistentVolumeClaim:
      claimName: csi-pvc-ntnx
      readOnly: false

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
xref #1726

Does this PR introduce a user-facing change?:

* Add the Nutanix CSI driver addon. The addon is deployed manually, on-demand, by enabling the `csi-nutanix` embedded addon (see the PR description for more details and examples)
* Add the default StorageClass for the Nutanix CSI driver. The StorageClass can be deployed by enabling the `default-storage-class` embedded addon (see the PR description for more details and examples)
* Add new environment variables used to provide endpoint and credentials for Prism Element: `NUTANIX_PE_ENDPOINT`, `NUTANIX_PE_USERNAME`, `NUTANIX_PE_PASSWORD`. Prism Element access is required by the Nutanix CSI driver
* Rename the `NUTANIX_ALLOW_INSECURE` environment variable to `NUTANIX_INSECURE`
* Remove the `allow_insecure` variable from Terraform configs for Nutanix in favor of the `NUTANIX_INSECURE` environment variable
* Forbid enabling `.cloudProvider.external` for Nutanix clusters because Nutanix doesn't have an external CCM that would initialize nodes
* Install and enable iscsid and NFS on Nutanix machines (required by the CSI driver)
* Update machine-controller to v1.42.0
* Fix a bug with the addons applier applying all files when addons path is not provided
* Fixes control plane tolerations in Azure CCM and CSI addons (`node-role.kubernetes.io/master` doesn't have a value)

@kubermatic-bot kubermatic-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. labels Jan 12, 2022
@kubermatic-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xmudrii

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 12, 2022
@kubermatic-bot kubermatic-bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 14, 2022
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@xmudrii xmudrii marked this pull request as ready for review January 14, 2022 11:43
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 14, 2022
@xmudrii xmudrii requested review from kron4eg and embik January 14, 2022 11:43
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 14604f0ca71417e049c6b6f111dc3b7cac2567ad

@kubermatic-bot kubermatic-bot merged commit 7cd221b into master Jan 14, 2022
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.4 milestone Jan 14, 2022
@kubermatic-bot kubermatic-bot deleted the csi-nutanix branch January 14, 2022 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants