You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When mounting with kerberos security, ticket cache
is expected to be set up on the host, pointing to the
/var/lib/kubelet/kubernetes/krb5cc_${uid}.
Credential cache is then taken from the creds secret and
written to the file, that is available to the host for
using.
- Kerberos support should be set up and cifs-utils must be installed on every node.
44
+
- The directory /var/lib/kubelet/kerberos/ needs to exist, and it will hold kerberos credential cache files for various users.
45
+
- This directory is shared between the host and the smb container.
46
+
- The admin is responsible for cleaning up the directory on each node as they deem appropriate. It's important to note that unmounting doesn't delete the cache file.
47
+
- Each node should know to look up in that directory, here's example script for that, expected to be run on node provision:
returnfalse, status.Error(codes.Internal, fmt.Sprintf("Directory for kerberos caches must exist, it will not be created: %s: %v", krb5CacheDirectory, err))
return"", nil, status.Error(codes.InvalidArgument, fmt.Sprintf("Malformed kerberos cache in key %s, expected to be in base64 form: %v", krb5CcacheName, err))
desc: "[Success] Got correct filename and content",
794
+
credUID: 1000,
795
+
secrets: map[string]string{
796
+
krb5CcacheName: base64Ticket,
797
+
},
798
+
expectedFileName: goodFileName,
799
+
expectedContent: ticket,
800
+
expectedErr: nil,
801
+
},
802
+
{
803
+
desc: "[Error] Throw error if credUID mismatch",
804
+
credUID: 1001,
805
+
secrets: map[string]string{
806
+
krb5CcacheName: base64Ticket,
807
+
},
808
+
expectedFileName: "",
809
+
expectedContent: nil,
810
+
expectedErr: status.Error(codes.InvalidArgument, fmt.Sprintf("Empty kerberos cache in key %s", "krb5cc_1001")),
811
+
},
812
+
{
813
+
desc: "[Error] Throw error if ticket is empty in secret",
814
+
credUID: 1000,
815
+
secrets: map[string]string{
816
+
krb5CcacheName: "",
817
+
},
818
+
expectedFileName: "",
819
+
expectedContent: nil,
820
+
expectedErr: status.Error(codes.InvalidArgument, fmt.Sprintf("Empty kerberos cache in key %s", krb5CcacheName)),
821
+
},
822
+
{
823
+
desc: "[Error] Throw error if ticket is invalid base64",
824
+
credUID: 1000,
825
+
secrets: map[string]string{
826
+
krb5CcacheName: "123",
827
+
},
828
+
expectedFileName: "",
829
+
expectedContent: nil,
830
+
expectedErr: status.Error(codes.InvalidArgument, fmt.Sprintf("Malformed kerberos cache in key %s, expected to be in base64 form: %v", krb5CcacheName, base64DecError)),
0 commit comments