-
Notifications
You must be signed in to change notification settings - Fork 84
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: support blobfuse-proxy on OpenShift #1045
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2019 The Kubernetes Authors. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -xe | ||
|
||
# install blobfuse/blobfuse2 | ||
echo "skip install blobfuse/blobfuse2 for mariner...." | ||
|
||
# install blobfuse-proxy | ||
updateBlobfuseProxy="true" | ||
if [ -f "/host/usr/bin/blobfuse-proxy" ];then | ||
old=$(sha256sum /host/usr/bin/blobfuse-proxy | awk '{print $1}') | ||
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}') | ||
if [ "$old" = "$new" ];then | ||
updateBlobfuseProxy="false" | ||
echo "no need to update blobfuse-proxy" | ||
fi | ||
fi | ||
if [ "$updateBlobfuseProxy" = "true" ];then | ||
echo "copy blobfuse-proxy...." | ||
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock | ||
rm -rf /host/usr/bin/blobfuse-proxy | ||
cp /blobfuse-proxy/blobfuse-proxy /host/usr/bin/blobfuse-proxy | ||
chmod 755 /host/usr/bin/blobfuse-proxy | ||
fi | ||
|
||
updateService="true" | ||
if [ -f "/host/usr/lib/systemd/system/blobfuse-proxy.service" ];then | ||
old=$(sha256sum /host/usr/lib/systemd/system/blobfuse-proxy.service | awk '{print $1}') | ||
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}') | ||
if [ "$old" = "$new" ];then | ||
updateService="false" | ||
echo "no need to update blobfuse-proxy.service" | ||
fi | ||
fi | ||
if [ "$updateService" = "true" ];then | ||
echo "copy blobfuse-proxy.service...." | ||
mkdir -p /host/usr/lib/systemd/system | ||
cp /blobfuse-proxy/blobfuse-proxy.service /host/usr/lib/systemd/system/blobfuse-proxy.service | ||
fi | ||
|
||
if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then | ||
if [ "$updateBlobfuseProxy" = "true" ] || [ "$updateService" = "true" ];then | ||
echo "start blobfuse-proxy...." | ||
$HOST_CMD systemctl daemon-reload | ||
$HOST_CMD systemctl enable blobfuse-proxy.service | ||
$HOST_CMD systemctl restart blobfuse-proxy.service | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
|
||
# Copyright 2019 The Kubernetes Authors. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: 2024 |
||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
set -xe | ||
|
||
# in coreos, we could just copy the blobfuse2 binary to /usr/local/bin/blobfuse2 | ||
if [ "${INSTALL_BLOBFUSE}" = "true" ] || [ "${INSTALL_BLOBFUSE2}" = "true" ] | ||
cvvz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
then | ||
echo "copy blobfuse2...." | ||
cp /usr/bin/blobfuse2 /host/usr/local/bin/blobfuse2 | ||
fi | ||
|
||
# install blobfuse-proxy | ||
updateBlobfuseProxy="true" | ||
if [ -f "/host/usr/local/bin/blobfuse-proxy" ];then | ||
old=$(sha256sum /host/usr/local/bin/blobfuse-proxy | awk '{print $1}') | ||
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy | awk '{print $1}') | ||
if [ "$old" = "$new" ];then | ||
updateBlobfuseProxy="false" | ||
echo "no need to update blobfuse-proxy" | ||
fi | ||
fi | ||
if [ "$updateBlobfuseProxy" = "true" ];then | ||
echo "copy blobfuse-proxy...." | ||
rm -rf /host/var/lib/kubelet/plugins/blob.csi.azure.com/blobfuse-proxy.sock | ||
rm -rf /host/usr/local/bin/blobfuse-proxy | ||
cp /blobfuse-proxy/blobfuse-proxy /host/usr/local/bin/blobfuse-proxy | ||
chmod 755 /host/usr/local/bin/blobfuse-proxy | ||
fi | ||
|
||
updateService="true" | ||
echo "change from /usr/bin/blobfuse-proxy to /usr/local/bin/blobfuse-proxy in blobfuse-proxy.service" | ||
sed -i 's/\/usr\/bin\/blobfuse-proxy/\/usr\/local\/bin\/blobfuse-proxy/g' /blobfuse-proxy/blobfuse-proxy.service | ||
if [ -f "/host/etc/systemd/system/blobfuse-proxy.service" ];then | ||
old=$(sha256sum /host/etc/systemd/system/blobfuse-proxy.service | awk '{print $1}') | ||
new=$(sha256sum /blobfuse-proxy/blobfuse-proxy.service | awk '{print $1}') | ||
if [ "$old" = "$new" ];then | ||
updateService="false" | ||
echo "no need to update blobfuse-proxy.service" | ||
fi | ||
fi | ||
if [ "$updateService" = "true" ];then | ||
echo "copy blobfuse-proxy.service...." | ||
mkdir -p /host/etc/systemd/system/ | ||
cp /blobfuse-proxy/blobfuse-proxy.service /host/etc/systemd/system/blobfuse-proxy.service | ||
fi | ||
|
||
if [ "${INSTALL_BLOBFUSE_PROXY}" = "true" ];then | ||
if [ "$updateBlobfuseProxy" = "true" ] || [ "$updateService" = "true" ];then | ||
echo "start blobfuse-proxy...." | ||
$HOST_CMD systemctl daemon-reload | ||
$HOST_CMD systemctl enable blobfuse-proxy.service | ||
$HOST_CMD systemctl restart blobfuse-proxy.service | ||
fi | ||
fi |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary if you have already
/host/usr
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for coreOS, /usr/ and /usr/local are different mount point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what @jsafrane mean is that since L102 is already mounting with
/usr
, why not resuse this mount pointThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Becase for coreOS, /usr/local is not a subpath of /usr, it's a different mount point, so we have to mount /usr/local and /usr seperately.