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 support for hostPath #15648

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

amarflybot
Copy link
Contributor

@amarflybot amarflybot commented Dec 9, 2024

Fixes #15546

Description

This feature introduces support for the hostPath volume type in Knative Serving, enabling users to mount directories from the host node’s filesystem into their service containers. This allows direct access to node-specific data or preloaded resources like certificates, enhancing flexibility while retaining Knative’s serverless capabilities.

Proposed Changes

  • Add support for the hostPath volume type in Knative Serving.
  • Enable users to mount directories from the host node's filesystem into their Knative service containers.
  • Update relevant documentation and examples to include usage of hostPath volumes.

Release Note


Adding support for the "hostPath" volume type. The feature allows users to mount directories from the host node's filesystem into their Knative service containers. It enables access to local storage on the node, facilitating use cases such as accessing node-specific data or utilizing local caches. The feature is behind the flag `kubernetes.podspec-volumes-hostpath`.

Copy link

linux-foundation-easycla bot commented Dec 9, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

@knative-prow knative-prow bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 9, 2024
Copy link

knative-prow bot commented Dec 9, 2024

Hi @amarflybot. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 86.95652% with 6 lines in your changes missing coverage. Please review.

Project coverage is 83.48%. Comparing base (2d5a1e9) to head (5cd7605).

Files with missing lines Patch % Lines
pkg/apis/serving/k8s_validation.go 85.36% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15648      +/-   ##
==========================================
- Coverage   83.51%   83.48%   -0.03%     
==========================================
  Files         219      219              
  Lines       17427    17473      +46     
==========================================
+ Hits        14554    14588      +34     
- Misses       2502     2508       +6     
- Partials      371      377       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amarflybot amarflybot force-pushed the feature/add_hostPath branch from a821b44 to e1c0c42 Compare December 9, 2024 14:06
@skonto
Copy link
Contributor

skonto commented Dec 9, 2024

--- a/config/core/300-resources/configuration.yaml +++ b/config/core/300-resources/configuration.yaml @@ -1582,4 +1582,4 @@ spec: ObservedGeneration is the 'Generation' of the Service that was last processed by the controller. type: integer - format: int64 \ No newline at end of file + format: int64

This needs fix.

@skonto
Copy link
Contributor

skonto commented Dec 9, 2024

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 9, 2024
# Part of a feature flag - so we want to omit the schema and preserve unknown fields
- kubebuilder:validation:DropProperties
- kubebuilder:pruning:PreserveUnknownFields
# Part of a feature flag - so we want to omit the schema and preserve unknown fields
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove additional space?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@amarflybot
Copy link
Contributor Author

--- a/config/core/300-resources/configuration.yaml +++ b/config/core/300-resources/configuration.yaml @@ -1582,4 +1582,4 @@ spec: ObservedGeneration is the 'Generation' of the Service that was last processed by the controller. type: integer - format: int64 \ No newline at end of file + format: int64

This needs fix.

Fixed

kind: Revision
plural: revisions
singular: revision
kind: Service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the revision file this should not be changed.

@@ -1728,4 +1732,4 @@ spec:
description: |-
URL holds the url that will distribute traffic over the provided traffic targets.
It generally has the form http[s]://{route-name}.{route-namespace}.{cluster-level-suffix}
type: string
type: string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new line is missing.

@knative-prow knative-prow bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Dec 9, 2024
@amarflybot
Copy link
Contributor Author

/retest

@skonto
Copy link
Contributor

skonto commented Dec 10, 2024

@amarflybot could you update the description and add release notes. Also we need a follow up PR at the knative/docs repo to document this addition.

@amarflybot
Copy link
Contributor Author

@amarflybot could you update the description and add release notes.

I have added. Will that do ?

@skonto
Copy link
Contributor

skonto commented Dec 10, 2024

/lgtm
/approve

/hold for @dprotaso for any additional comments.

@knative-prow knative-prow bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 10, 2024
@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2024
@skonto
Copy link
Contributor

skonto commented Dec 10, 2024

I have added. Will that do ?

I would add also that this is behind a flag as it is not the default mode.

@skonto skonto changed the title 15546: Add support for hostPath Add support for hostPath Dec 10, 2024
@knative-prow knative-prow bot removed the lgtm Indicates that a PR is ready to be merged. label Dec 10, 2024
@amarflybot
Copy link
Contributor Author

/retest

1 similar comment
@amarflybot
Copy link
Contributor Author

/retest

@skonto
Copy link
Contributor

skonto commented Dec 13, 2024

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 13, 2024
Copy link

knative-prow bot commented Dec 13, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: amarflybot, skonto
Once this PR has been reviewed and has the lgtm label, please assign dprotaso for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@skonto
Copy link
Contributor

skonto commented Dec 13, 2024

/unhold

@knative-prow knative-prow bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2024
@skonto
Copy link
Contributor

skonto commented Dec 16, 2024

@dprotaso hi, gentle ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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.

Support volume type "hostPath" for volume mounting
2 participants