本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
为 Windows Pod 和容器配置 gMSA
什么是 gMSA 账户
Windows-based .NET 应用程序等应用程序通常使用 Active Directory 作为身份提供商, authorization/authentication 使用 NTLM 或 Kerberos 协议提供。
与 Active Directory 交换 Kerberos 票证的应用程序服务器需要加入域。Windows 容器不支持域加入,也没有多大意义,因为容器是临时资源,会给 Active Directory RID 池带来负担。
但是,管理员可以利用 gmSA Active Directory
Windows 容器和 gMSA 用例
利用 Windows 身份验证并作为 Windows 容器运行的应用程序可以从 gmSA 中受益,因为 Windows 节点用于代表容器交换 Kerberos 票证。有两个选项可用于设置 Windows 工作节点以支持 GMSA 集成:
1- Domain-joined Windows 工作节点
在此设置中,Windows 工作节点在 Active Directory 域中加入域,并使用 Windows 工作节点的 AD 计算机帐户对 Active Directory 进行身份验证并检索用于容器的 gMSA 身份。
在加入域的方法中,您可以使用现有的Active Directory GPO轻松管理和强化Windows工作节点;但是,在Windows工作节点加入Kubernetes集群期间,它会产生额外的运营开销和延迟,因为在节点启动期间需要额外重启,并在Kubernetes集群终止节点后清理Active Directory车库。
在以下博客文章中,您将找到有关如何实现 Domain-joined Windows 工作节点方法的详细分步说明:
亚马逊 EKS Windows Pod 上的 Windows 身份验证
2-无域 Windows 工作节点
在此设置中,Windows 工作节点未加入 Active Directory 域,并使用 “便携式” 身份 (user/password) 对 Active Directory 进行身份验证并检索用于容器的 gMSA 身份。
便携身份是 Active Directory 用户;身份 (user/password) 存储在 AWS Secrets Manager 或 AWS 系统管理器参数存储中,名为 ccg_pl AWS-developed ugin 的插件将用于从 AWS Secrets Manager 或 AWS 系统管理器参数存储中检索此身份,并将其传递给 containerd 以检索 gmSA 身份并将其提供给 pod。
在这种无域方法中,使用 gmSA 时,在 Windows 工作节点启动期间不进行任何 Active Directory 交互,并减少 Active Directory 管理员的操作开销,可以从中受益。
在以下博客文章中,您将详细了解如何实现无域 Windows 工作节点方法:
亚马逊 EKS Windows Pod 的无域 Windows 身份验证
重要提示
尽管 pod 能够使用 gMSA 帐户,但还必须相应地设置应用程序或服务以支持 Windows 身份验证,例如,为了设置微软 IIS 以支持 Windows 身份验证,你应该通过 dockerfile 进行准备:
RUN Install-WindowsFeature -Name Web-Windows-Auth -IncludeAllSubFeature RUN Import-Module WebAdministration; Set-ItemProperty 'IIS:\AppPools\SiteName' -name processModel.identityType -value 2 RUN Import-Module WebAdministration; Set-WebConfigurationProperty -Filter '/system.webServer/security/authentication/anonymousAuthentication' -Name Enabled -Value False -PSPath 'IIS:\' -Location 'SiteName' RUN Import-Module WebAdministration; Set-WebConfigurationProperty -Filter '/system.webServer/security/authentication/windowsAuthentication' -Name Enabled -Value True -PSPath 'IIS:\' -Location 'SiteName'