securityContext: windowsOptions: gmsaCredentialSpecName: "<gmsa-credential-spec-name>"
Note: gMSA credential spec can be get after login VKS cluster with 'kubectl get gmsacredentialspecs.windows.k8s.io'
kubectl describe pod -n <namespace> <pod-name> State: Waiting Reason: CrashLoopBackOff Last State: Terminated Reason: StartError Message: failed to create containerd task: failed to create shim task: failed to generate container credential guard instance: hcs::ModifyServiceSettings: winapi error #3489661115[Event Detail: Failed to setup the external credentials for Container '<container-id>': The request is not supported. (0xC00000BB). Provider: <provider-id> EventID: 11507] Exit Code: 128vSphere Kubernetes Service
The hostAccountConfig in windows-gmsa-webhook-data-values.yaml is not needed which will cause the Host Compute Service (HCS) unable to handle the injection of gmsa credential.
To resolve the issue:
windows-gmsa-webhook-data-values.yaml when installed gMSA webhook.kubectl get gmsacredentialspecs.windows.k8s.io -o yaml > gmsacredentialspecs.yamlkubectl delete gmsacredentialspecs.windows.k8s.io <gmsa-credential-spec-name>
apiVersion: windows.k8s.io/v1
kind: GMSACredentialSpec
metadata:
name: myservice
credspec:
CmsPlugins:
- ActiveDirectory
DomainJoinConfig:
Sid: <SID>
MachineAccountName: MyService
Guid: <AD-GUID>
DnsTreeName: sample.com
DnsName: sample.com
NetBiosName: SAMPLE # the domain need be upper case
ActiveDirectoryConfig:
GroupManagedServiceAccounts:
- Name: MyService
Scope: sddc.com
- Name: MyService
Scope: SAMPLE # the domain need be upper case
securityContext: windowsOptions: gmsaCredentialSpecName: "<gmsa-credential-spec-name>"