我的意思是,我有一个已经被docker化的应用程序,我可以提供一个cloudformation模板以将其部署到客户端的EKS集群上吗?
答案 0 :(得分:0)
我使用Cloudformation已有一段时间了,但是我从未将它用于部署Kubernetes工件(到目前为止,我从未听说过其他任何人)。我认为有办法(请参阅AWS Blog),但即使此解决方案似乎也基于Helm。
我绝对建议您在用例中使用Helm图表。 Helm图表简单明了且易于使用,尤其是如果您已经知道要部署的Kubernetes对象。
答案 1 :(得分:0)
使用Modular and Scalable Amazon EKS Architecture Quick Start部署Amazon EKS集群。部署Amazon EKS集群后,在“输出”选项卡上,记下以下输出。
下面的模板安装WordPress Helm chart的方式与登录Kubernetes集群并运行以下命令的方式相同。
帮助安装稳定版/ wordpress
模板的以下部分显示了如何使用Helm部署WordPress。它还会创建一个负载平衡器主机名,以便您可以访问WordPress网站。
Resources:
HelmExample:
Type: "Custom::Helm"
Version: '1.0'
Description: 'This deploys the Helm Chart to deploy wordpress in to the EKS Cluster.'
Properties:
ServiceToken: !Ref HelmLambdaArn
KubeConfigPath: !Ref KubeConfigPath
KubeConfigKmsContext: !Ref KubeConfigKmsContext
KubeClusterName: !Ref KubeClusterName
Namespace: !Ref Namespace
Chart: stable/wordpress
Name: !Ref Name
Values:
wordpressUsername: !Ref wordpressUsername
wordpressPassword: !Ref wordpressPassword
WPElbHostName:
DependsOn: HelmExample
Type: "Custom::KubeGet"
Version: '1.0'
Properties:
ServiceToken: !Ref KubeGetLambdaArn
KubeConfigPath: !Ref KubeConfigPath
KubeConfigKmsContext: !Ref KubeConfigKmsContext
Namespace: !Ref Namespace
Name: !Sub 'service/${Name}-wordpress'
JsonPath: '{.status.loadBalancer.ingress[0].hostname}'
修改头盔图以适合您的应用程序,并使用先前从输出中获得的值来修改cloudformation模板。 这些是部署cloudformation模板时必须填写的参数:
答案 2 :(得分:0)
您可以使用cdk8s.io。以下是一些示例:https://github.com/awslabs/cdk8s/tree/master/examples