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

feat: add inline volume support #266

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

andyzhangx
Copy link
Member

@andyzhangx andyzhangx commented Jan 6, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
feat: add inline volume support
uesr could still set --set feature.enableInlineVolume=false to disable inline volume support in chart install.

Which issue(s) this PR fixes:

Fixes #148

Special notes for your reviewer:
feat: add inline volume support

kind: Pod
apiVersion: v1
metadata:
  name: nginx-pod-inline-volume
spec:
  nodeSelector:
    "kubernetes.io/os": linux
  containers:
    - image: mcr.microsoft.com/oss/nginx/nginx:1.19.5
      name: nginx-nfs
      command:
        - "/bin/bash"
        - "-c"
        - set -euo pipefail; while true; do echo $(date) >> /mnt/nfs/outfile; sleep 1; done
      volumeMounts:
        - name: persistent-storage
          mountPath: "/mnt/nfs"
  volumes:
    - name: persistent-storage
      csi:
        driver: nfs.csi.k8s.io
        volumeAttributes:
          server: nfs-server.default.svc.cluster.local  # required
          share: /  # required
          mountOptions: "nfsvers=4.1,sec=sys"  # optional

Does this PR introduce a user-facing change?:

feat: add inline volume support

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 6, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 6, 2022
@coveralls
Copy link

coveralls commented Jan 6, 2022

Pull Request Test Coverage Report for Build 1682798475

  • 6 of 10 (60.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.4%) to 77.716%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/nfs/nodeserver.go 6 10 60.0%
Totals Coverage Status
Change from base Build 1670104364: -0.4%
Covered Lines: 558
Relevant Lines: 718

💛 - Coveralls

@andyzhangx andyzhangx force-pushed the inline-volume branch 2 times, most recently from be5068e to 16473fb Compare January 6, 2022 11:00
fix yaml

refine tests

fix example

fix test
@kfox1111
Copy link

Looks pretty good to me. Two possible tweaks:

  1. It may be good to default this feature to off rather then on. This would better align with the PodSecurity design. You'd need to enable the feature and add additional k8s policy to enable it safely. Consciously having to enable gives the opportunity to remind the user about the policy need.
  2. support for mount options. For example: nfsvers=4.2

@andyzhangx
Copy link
Member Author

Looks pretty good to me. Two possible tweaks:

  1. It may be good to default this feature to off rather then on. This would better align with the PodSecurity design. You'd need to enable the feature and add additional k8s policy to enable it safely. Consciously having to enable gives the opportunity to remind the user about the policy need.
  2. support for mount options. For example: nfsvers=4.2

@kfox1111 it's done, PTAL, thanks. added a new parameter as csi.volumeAttributes.mountOptions

  volumes:
    - name: persistent-storage
      csi:
        driver: nfs.csi.k8s.io
        volumeAttributes:
          server: nfs-server.default.svc.cluster.local  # required
          share: /  # required
          mountOptions: "nfsvers=4.1,sec=sys"  # optional

@kfox1111
Copy link

Looks good to me. Thanks! :)

@andyzhangx andyzhangx merged commit fb28204 into kubernetes-csi:master Jan 13, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

implement Ephemeral Inline Volumes support
4 participants