简体   繁体   English

备份 AWS EKS 集群配置

[英]Backup AWS EKS cluster configuration

A year ago I've configured an AWS EKS cluster for our client.一年前,我为我们的客户配置了一个 AWS EKS 集群。 I've created it with help of lots of manuals.我在很多手册的帮助下创建了它。 There are cluster configuration files present (I've applied all changes to the cluster only using those files), but I'm not 100% sure, that there was no direct command line changes applied to the cluster.存在集群配置文件(我仅使用这些文件将所有更改应用到集群),但我不能 100% 确定没有直接命令行更改应用于集群。

Currently I have a request from the client to stop entire cluster to not being charged.目前,我收到客户的请求,要求停止整个集群以免收费。 The only way is to delete it with all related resources.唯一的方法是将其与所有相关资源一起删除。

But the thing is that client would want to restore it at some point in the future.但问题是客户希望在将来的某个时候恢复它。

So overall task sounds like this:所以总体任务听起来像这样:

  • backup all configurations of all related resources for the currently running AWS EKS cluster to be possible to restore it in the future with some reasonably small effort.为当前运行的 AWS EKS 集群备份所有相关资源的所有配置,以便将来可以通过一些相当小的努力来恢复它。 There is no need to save any information (volumes, data etc).无需保存任何信息(卷、数据等)。

I'm talking about backup and restore all sort of AWS entities related to the cluster:我说的是备份和恢复与集群相关的各种 AWS 实体:

  • VPC,.networks, su.nets, security groups, EKS, ECR and so on as much as possible. VPC、.networks、su.nets、security groups、EKS、ECR等尽可能多。

Can anyone point me to the direction for the investigation or to some tool/service, that can help with this task?任何人都可以指出调查的方向或可以帮助完成此任务的某些工具/服务吗?

You could import your resources in a Terraform template using terraform import .您可以使用terraform import在 Terraform 模板中导入您的资源。

However, that means you need to know exactly which resources have been used to deploy your EKS cluster.但是,这意味着您需要确切知道哪些资源已用于部署您的 EKS 集群。 Everything which has been deployed inside the cluster won't be imported though.但是,不会导入已部署在集群内的所有内容。

You can use terraform to import as Mornor mentioned,您可以使用 terraform 导入,如 Mornor 所述,

Then using Kubectl, you can dump your deployments and services etc by doing the following:然后使用 Kubectl,您可以通过执行以下操作来转储您的部署和服务等:

kubectl get services --all-namespaces -o yaml > all-service.yaml
kubectl get deployments --all-namespaces -o yaml > all-deployments.yaml

You can directly target a namespace or a specific deployment or service.您可以直接将命名空间或特定部署或服务作为目标。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS EKS NodeGroup“创建失败”:实例未能加入 kubernetes 集群 - AWS EKS NodeGroup "Create failed": Instances failed to join the kubernetes cluster AWS EKS 创建的 ASG 的每个 AZ 配置的多个实例类型 - Multiple instance types per AZ configuration for ASG created by AWS EKS 如何在没有 aws-auth configmap 的情况下登录 EKS 集群? - How to sign-in to EKS cluster without aws-auth configmap? AWS EKS 服务账户集群角色绑定不起作用访问被禁止 - AWS EKS Service account cluster role bindings not working access Forbidden 如何让 kubectl 登录到 AWS EKS 集群? - How do you get kubectl to log in to an AWS EKS cluster? 如何使用 Fargate 创建 AWS Kube.netes 集群 (EKS)? - How to create a AWS Kubernetes cluster (EKS) using Fargate? 无法通过单个 AWS CloudFormation 堆栈创建 AWS EKS 集群和工作节点组 - Unable to create AWS EKS cluster and worker nodes group by a single AWS CloudFormation stack 如何使用 kubectl 检查应用程序的容器/pod 是否分布到 AWS EKS 集群中的不同可用区? - How to use kubectl to check the containers/pods of an application are spread to different AZs in an AWS EKS cluster? coredns 没有部署在新的 EKS 集群中? - coredns not deploying in new EKS cluster? 将 JupyterHub 应用程序状态迁移到新的 k8s 集群? (AWS EKS) - Migrate JupyterHub app state to new k8s cluster? (AWS EKS)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM