Commit Graph

648 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
10988997f2 Merge pull request #102801 from CKchen0726/remove_storage_metrics_in_1.21_release
remove storageOperationErrorMetric and storageOperationStatusMetric in release 1.21
2021-10-27 01:21:26 -07:00
CKchen0726
f1c523cfa6 remove storageOperationErrorMetric and storageOperationStatusMetric in 1.21 release 2021-10-14 12:03:58 +08:00
Kubernetes Prow Robot
debd6c1e9e Merge pull request #104526 from jingxu97/aug/volumeattach
Fix issue in node status updating VolumeAttached list
2021-10-05 17:30:32 -07:00
Jing Xu
69b9f9b1f0 Fix issue in node status updating VolumeAttached list
During volume detach, the following might happen in reconciler

1. Pod is deleting
2. remove volume from reportedAsAttached, so node status updater will
update volumeAttached list
3. detach failed due to some issue
4. volume is added back in reportedAsAttached
5. reconciler loops again the volume, remove volume from
reportedAsAttached
6. detach will not be trigged because exponential back off, detach call
will fail with exponential backoff error
7. another pod is added which using the same volume on the same node
8. reconciler loops and it will NOT try to tigger detach anymore

At this point, volume is still attached and in actual state, but
volumeAttached list in node status does not has this volume anymore, and
will block volume mount from kubelet.

The fix in first round is to add volume back into the volume list that
need to reported as attached at step 6 when detach call failed with
error (exponentical backoff). However this might has some performance
issue if detach fail for a while. During this time, volume will be keep
removing/adding back to node status which will cause a surge of API
calls.

So we changed to logic to check first whether operation is safe to retry which
means no pending operation or it is not in exponentical backoff time
period before calling detach. This way we can avoid keep removing/adding
volume from node status.

Change-Id: I5d4e760c880d72937d34b9d3e904ecad125f802e
2021-10-05 09:44:35 -07:00
Patrick Ohly
07f6571a49 pkg/volume/util: remove out-dated OWNERS
There is no reason for having separate owners for this folder. The parent
folder has a much better OWNERS file with references to the SIG-Storage
aliases.
2021-09-30 17:54:46 +02:00
Kubernetes Prow Robot
1dc7de0366 Merge pull request #100185 from drigz/extra-log
Remove EXTRA from log messages
2021-09-05 04:02:28 -07:00
Stephen Augustus
481cf6fbe7 generated: Run hack/update-gofmt.sh
Signed-off-by: Stephen Augustus <foo@auggie.dev>
2021-08-24 15:47:49 -04:00
Kubernetes Prow Robot
3ca0145f20 Merge pull request #104253 from mauriciopoppe/subpath-additional-mount-flag
Pass additional flags to subpath mount to avoid flakes in certain conditions
2021-08-11 02:08:58 -07:00
Kubernetes Prow Robot
61b6233235 Merge pull request #104148 from markusthoemmes/structured-logging-2
Add the pod field to all volumeToMount info level logs
2021-08-10 03:19:18 -07:00
Mauricio Poppe
296b30f143 Pass additional flags to subpath mount to avoid flakes in certain conditions 2021-08-09 22:15:35 +00:00
Kubernetes Prow Robot
95d3360467 Merge pull request #97642 from claudiubelu/subatomic-symlinks
subatomic: Creates the symlinks to user-visible files later
2021-08-05 23:18:22 -07:00
Markus Thömmes
ff0e1f4fe9 Add the pod field to all volumeToMount info level logs 2021-08-05 12:29:56 +02:00
Rodrigo Queiro
363c0e3eb2 Remove EXTRA from log messages
This cleans up a log message that looks like:

I0312 14:36:50.280018   12866 operation_generator.go:869] UnmountDevice succeeded for volume "my-volume" %!(EXTRA string=UnmountDevice succeeded for volume "my-volume" (UniqueName: "kubernetes.io/csi/smb.csi.k8s.io^my-volume") on node "my-node")
2021-08-05 09:05:08 +02:00
Kubernetes Prow Robot
2da4d48e6d Merge pull request #100567 from jingxu97/mar/mark
Mark volume mount as uncertain in case of volume expansion fails
2021-07-13 22:20:26 -07:00
Kubernetes Prow Robot
dab6f6a43d Merge pull request #102344 from smarterclayton/keep_pod_worker
Prevent Kubelet from incorrectly interpreting "not yet started" pods as "ready to terminate pods" by unifying responsibility for pod lifecycle into pod worker
2021-07-08 16:48:53 -07:00
Jing Xu
0fa01c371c Mark volume mount as uncertain in case of volume expansion fails
should mark volume mount in actual state even if volume expansion fails so that
reconciler can tear down the volume when needed. To avoid pods start
using it, mark volume as uncertain instead of mounted.

Will add unit test after the logic is reviewed.

Change-Id: I5aebfa11ec93235a87af8f17bea7f7b1570b603d
2021-07-08 16:00:34 -07:00
Clayton Coleman
3eadd1a9ea Keep pod worker running until pod is truly complete
A number of race conditions exist when pods are terminated early in
their lifecycle because components in the kubelet need to know "no
running containers" or "containers can't be started from now on" but
were relying on outdated state.

Only the pod worker knows whether containers are being started for
a given pod, which is required to know when a pod is "terminated"
(no running containers, none coming). Move that responsibility and
podKiller function into the pod workers, and have everything that
was killing the pod go into the UpdatePod loop. Split syncPod into
three phases - setup, terminate containers, and cleanup pod - and
have transitions between those methods be visible to other
components. After this change, to kill a pod you tell the pod worker
to UpdatePod({UpdateType: SyncPodKill, Pod: pod}).

Several places in the kubelet were incorrect about whether they
were handling terminating (should stop running, might have
containers) or terminated (no running containers) pods. The pod worker
exposes methods that allow other loops to know when to set up or tear
down resources based on the state of the pod - these methods remove
the possibility of race conditions by ensuring a single component is
responsible for knowing each pod's allowed state and other components
simply delegate to checking whether they are in the window by UID.

Removing containers now no longer blocks final pod deletion in the
API server and are handled as background cleanup. Node shutdown
no longer marks pods as failed as they can be restarted in the
next step.

See https://docs.google.com/document/d/1Pic5TPntdJnYfIpBeZndDelM-AbS4FN9H2GTLFhoJ04/edit# for details
2021-07-06 15:55:22 -04:00
Cheng Xing
0e315355df Pass FsGroup to MountDevice 2021-07-03 16:29:42 -07:00
Chris Henzie
2b98f8edc7 Enforce ReadWriteOncePod access mode during mount 2021-06-28 21:25:37 -07:00
Chris Henzie
83e3ee780a Rename access mode contains helper method
So it is consistent with other methods performing the same check (one
for internal and external types)
2021-06-28 21:24:56 -07:00
Kubernetes Prow Robot
53bc4c13c1 Merge pull request #96115 from ncopa/disk-usage
Get inodes and disk usage via pure go
2021-06-18 20:30:50 -07:00
Jan Safranek
f4b41c0a17 Fix UnmountDevice error cases
When UnmountDevice fails, kubelet treat the volume mount as uncertain,
because it does not know at which stage UnmountDevice failed. It may be
already partially unmonted / destroyed.

As result, MountDevice will be performer when a new Pod is started on the
node after UnmountDevice faiure.
2021-06-16 18:39:04 +02:00
Jan Safranek
f9a04f3bc4 Move error reporting to volume plugins
Move reporting of GetReliableMountRefs error to the volume plugins that
have more context about severity of the error.
2021-05-27 18:30:17 +02:00
Jan Safranek
a95842095e Retry reading /proc/mounts indifinetly in FC and iSCSI volume reconstruction
iSCSI and FC volume plugins do not implement real 3rd party attach/detach.
If reconstruction fails with an error on a FC or iSCSI volume, it will not
be unmounted from the volume global dir and at the same time it will be
marked as unused, to be available to be mounted on another node.

The volume can then be mounted on several nodes, resulting in volume
corruption.

The other block based volume plugins implement attach/detach that either
makes the volume stuck (can't be detached) or will be force-detached from a
node before attaching it somewhere else.
2021-05-26 23:08:19 +02:00
刁浩 10284789
5908cd0d90 simplify returning boolean expression in /pkg/volume
Signed-off-by: 刁浩 10284789 <diao.hao@zte.com.cn>
2021-05-25 02:39:55 +00:00
Kubernetes Prow Robot
6768ac8115 Merge pull request #100894 from clickyotomy/sk/loop-dev-sysfs
Handle invalid `losetup' options
2021-05-12 05:05:39 -07:00
Kubernetes Prow Robot
c9bd08a3c4 Merge pull request #101046 from lojies/fixbrokenlink
fix broken link in some files
2021-05-07 13:31:34 -07:00
Kubernetes Prow Robot
c08526c7f7 Merge pull request #100216 from yangjunmyfm192085/run-test29
Fix misspelling of condition.
2021-05-07 00:21:02 -07:00
Kubernetes Prow Robot
4ad08fa5b6 Merge pull request #101115 from wangyx1992/capital-log
cleanup: fix log capitalization in volume package
2021-05-06 03:51:16 -07:00
Srinidhi Kaushik
be63462f93 Handle invalid "losetup" options
The non "util-linux" versions of "losetup" don't seem to have
options like "-j" ("--associated") which lists the loop devices
associated with the file, or "--show" which  displays the name
of the assigned loop device for a file.

For instance, when "-j" is used, "GetLoopDevice()" fails with:

    $ losetup -j /path/to/file
    losetup: unrecognized option: j
    BusyBox v1.32.1 () multi-call binary.

Add a fallback option to lookup the device from "sysfs" in cases
where "losetup" fails for an invalid option. This can be done by
reading the backing file from "/sys/block/loop*/loop/backing_file"
for each of the devices listed there.

Signed-off-by: Srinidhi Kaushik <shrinidhi.kaushik@gmail.com>
2021-05-02 20:02:51 +05:30
andyzhangx
e10d3948f5 fix: azure file namespace issue in csi translation
fix build failure

fix comments
2021-04-20 07:23:09 +00:00
wangyx1992
7fe934a72d cleanup: fix log capitalization in volume package
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-14 21:58:56 +08:00
卢振兴10069964
b29a5fb074 fix broken link in some files 2021-04-13 08:46:24 +08:00
Kubernetes Prow Robot
bb0906dcb2 Merge pull request #99929 from lala123912/lint_clean
Remove unused/dead code
2021-04-08 16:00:34 -07:00
Natanael Copa
d45ba645a8 Get inodes and disk usage via pure go
Fix inode usage calculation to use filepath.Walk instead of executing an
external find. Also calculate the disk usage while at it so we also get
rid of the external dependency of `nice` and `du`. (#95172)

This is similar to what cadvisor does since commit
046818d64c

This solves three problems:
- Counts number of inodes correct when there are hardlinks (#96114)
- Makes kubelet work without GNU findutils (#95186)
- Makes kubelet work without GNU coreutils (#95172)
2021-04-06 14:19:35 +02:00
JUN YANG
6c566f6dfa Fix misspelling of condition.
Signed-off-by: JUN YANG <yang.jun22@zte.com.cn>
2021-03-19 16:27:53 +08:00
Kubernetes Prow Robot
4b6e3e164f Merge pull request #99221 from jsturtevant/windows-host-stats-provider
Get filesystem stats for files on Windows
2021-03-10 11:09:23 -08:00
Kubernetes Prow Robot
5155865ae2 Merge pull request #99326 from sunpa93/fs_resize_fix
fix: use pv annotation to trigger filesystem resize when necessary
2021-03-09 11:05:18 -08:00
Sung Jun Park
5f69cf74d8 fix: when newly binding pvc to a pv, adjust pvc.status.capacity to pv's annotation that denotes the pre-resize capacity of the original pvc that pv was bound to if it has one
test: confirm that pvc's status capacity is adjusted if pv has a pre-resize capacity annotation
2021-03-09 07:55:10 +00:00
lala123912
127b675a15 Remove unused/dead code 2021-03-09 09:34:37 +08:00
James Sturtevant
c9eff4e906 Get filesystem stats for files on Windows 2021-03-08 12:50:23 -08:00
Shintaro Murakami
fe7a862c2d Unify determination of whether a volume is ephemeral 2021-03-05 14:49:09 +09:00
Benjamin Elder
56e092e382 hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
Kubernetes Prow Robot
c200a8f9b7 Merge pull request #98433 from damemi/remove-helper-from-volume-zone
Move GetPersistentVolumeClaimClass to component-helpers
2021-02-26 12:38:15 -08:00
Kubernetes Prow Robot
ccf8a2ef4f Merge pull request #99088 from gavinfish/storage-resize
Storage: move filesystem resize code to kubernetes/mount-utils
2021-02-22 17:24:02 -08:00
drfish
eb0b61912f Use utilexec.Interface instead of SafeFormatAndMount as filed of ResizeFs 2021-02-20 23:41:06 +08:00
Jiawei Wang
43bc6fa806 Add csi_operations_seconds metrics on kubelet 2021-02-17 13:38:27 -08:00
Kubernetes Prow Robot
aa28a3563b Merge pull request #99050 from Jiawei0227/storage_metrics
Add migrated field to storage_operation_duration_seconds metric
2021-02-16 18:21:06 -08:00
drfish
a04ab9debf Move filesystem resize code to kubernetes/mount-utils 2021-02-15 16:07:07 +08:00
Jiawei Wang
6a7222cf4e Add migrated field to storage_operation_duration_seconds metric 2021-02-12 17:35:01 -08:00