-
Notifications
You must be signed in to change notification settings - Fork 136
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
microk8s + kerberos integration issues #705
Comments
@fabioscaccabarozzi current kerberos path is anyway, let me make it configurable first. |
@andyzhangx I do not have an expected path - I followed the guides and bits found for microk8s and for kerberos, and I finally realized that the two cannot work together at the moment. I guess that either providing a configurable path indipendent of
should work. |
so if I set |
yes, that's my expectation -> if the CSI driver and the host kerberos/cifs-utils can use the same cache folder with the proper symlinks, everything should work |
#709 could fix this issue |
The PR looks good to me, I believe it's the right approach. One minor nitpick: as it is now, if I believe we need to add an additional volume here in case users specify something like:
How can I test the PR? Is there some I should be able to start testing it tomorrow. Thank you! |
@fabioscaccabarozzi can you move kerberos to |
wait, I don't think this PR would work since
|
Ah, you're right, I didn't even see that part, sorry. Yes, agree that part also needs to be changed. Perhaps it could be mounted via a configmap via the helm chart? |
#711 should fix this issue, so you don't need to change any setting, as long as kerberos path is |
#711 will not fix everything -> kerberos utils will create cache files in |
#714 could fix this issue, this PR adds a mount path for krb5CacheDirectory if it's not empty |
This fixes the mount+symlinks, the only outstanding part now is the /etc/krb5.conf This can be done by via the helm chart, using a ConfigMap to mount the file with the custom config. This way the container image contains the default, and gets overridden if required. |
@fabioscaccabarozzi what about this fix: #715 ? |
What happened: when trying to setup PV+PVC with Kerberos under microk8s, nodes cannot mount the share, and pods stay in "ContainerCreating" state, until they fail and are restarted.
What you expected to happen: share is mounted fine, pods can correctly start
How to reproduce it:
Steps to reproduce
Assuming we're on a host where Kerberos is configured, and
cifs-utils
andkeyutils
are installed.Install microk8s via snap:
snap install microk8s --classic
Install CSI driver with values supplied below.
Use the driver-parameters docs for the kerberos part (kinit, secret, ...)
Create the resources below. PV and PVC will show "Bound".
Attempt to create a deployment that uses the PVC (see example below).
Whichever node attempts to run the pod will fail with the following error:
microk8s.daemon-kubelite[1422]: E1212 11:06:34.115973 1422 csi_attacher.go:364] kubernetes.io/csi: attacher.MountDevice failed: rpc error: code = Internal desc = Error writing kerberos cache: rpc error: code = Internal desc = Directory for kerberos caches must exist, it will not be created: /var/lib/kubelet/kerberos/: stat /var/lib/kubelet/kerberos/: no such file or directory
Investigation & Explanation
In microk8s, by default
/var/lib/kubelet
is a symlink pointing to/var/snap/microk8s/common/var/lib/kubelet
.Kerberos was configured according to the driver-parameter docs linked above, so we have:
The first problem is that if we supply
linux.kubelet
at chart installation, that folder will be mounted by the chart in thecsi-smb-node
pod verbatim via hostPath (host: /path/A -> pod: /path/A).The second problem is we can't seem to find a way to alter the Kerberos cache path. This means that if we move the kubelet path via
linux.kubelet
, the/var/lib/kubelet
path won't exist in thecsi-smb-node
pods, making it impossible to create and save kerberos tickets from the pod to the host system, which ultimately is the one performing the mounts viacifs-utils
.Further, currently in the Kerberos cache folder absolute symlinks are used from
krb5cc_UID
files to the actual token files (e.g:/var/lib/kubelet/kerberos/krb5cc_1000
->/var/lib/kubelet/kerberos/aW1nLXNoYXJlLWRldm1xcw==
), so the source path from the host must be exactly the same also in the pod, otherwise the absolute symlinks won't work forcifs-utils
.As it stands now,
csi-smb-node
expects the the kerberos cache to be at/var/lib/kubelet/kerberos
and nowhere else, making it impossible the use of Kerberos with a differentlinux.kubelet
.Fixing attempt
I have tried to modify the helm chart template for
csi-smb-node
to mount the Kerberos cache folder as an additional volume, or the same volume with subPath, but it doesn't work ->touch /var/lib/..../kerberos/test
would yieldno such file or directory
, I guess because I cannot mount the same path twice for the same pod. Anyway that would clash with the hard-coded path in the file referenced above.Proposed solution
The better solution would be to make the Kerberos cache path configurable as the
linux.kubelet
path is, and ideally discourage the use of/var/lib/kubelet/kerberos
, as in microk8s that path is a symlink to the snap folder.Objects used
The helm chart values, as per docs for microk8s:
These are the credentials, PV and PVC I'm trying to use:
An example deployment:
Anything else we need to know?:
Environment:
kubectl version
): 1.27.8 (snap)uname -a
): 5.4.0-169-genericThe text was updated successfully, but these errors were encountered: