简体   繁体   English

在 Kubernetes 内使用 PVC 加密 EBS 卷而不会丢失数据

[英]Encrypt EBS volume with PVC without data loss inside Kubernetes

I have a Prometheus server deployment running inside EKS cluster.我有一个在 EKS 集群内运行的 Prometheus 服务器部署。 The EBS volume attached to prometheus deployment is un-encrypted.附加到 prometheus 部署的 EBS 卷未加密。 I want to encrypt the volume attached to the prometheus server deployment.我想加密附加到 prometheus 服务器部署的卷。 I don't want to suffer data loss or maybe minimum data loss.我不想遭受数据丢失或最小的数据丢失。 Challenges foreseen are with process of creating encrypted volume and attaching it to the prometheus deployment since time taken for that process would be too long maybe for 600GB of data.可以预见的挑战是创建加密卷并将其附加到 prometheus 部署的过程,因为该过程所花费的时间对于 600GB 的数据来说可能太长了。 Can anyone provide any suggestion, it would be great if someone could provide some sort of help.任何人都可以提供任何建议,如果有人可以提供某种帮助,那就太好了。

I think doing this in place is going to be extremely challenging.我认为在原地做这件事将是极具挑战性的。

What you could do is boot a second prometheus pod, backed by an encrypted PVC, and configure the first prometheus to remote-write to the second instance.您可以做的是启动第二个 prometheus pod,由加密的 PVC 支持,并将第一个 prometheus 配置为远程写入第二个实例。

If you set up the constraints on your cluster nodes correctly via taints and tolerations, you can ensure both prometheus pods run on the same node.如果您通过 taints 和 tolerations 在集群节点上正确设置约束,则可以确保两个 prometheus pod 在同一节点上运行。 You will then be able to ssh in to the eks node, find the two PVC volumes as local filesystem mounts, and cp -R from the source unencrypted volume to the target encrypted volume.然后,您将能够 ssh 进入 eks 节点,找到两个 PVC 卷作为本地文件系统挂载,并 cp -R 从源未加密卷到目标加密卷。

This should allow you to shift the data with no loss.应该允许您无损失地移动数据。

While on the subject of prometheus - take a look at VictoriaMetrics - it is a near-100% compatible drop-in for prometheus which uses less memory and is much more io and cpu efficient.关于普罗米修斯的主题——看看VictoriaMetrics——它是普罗米修斯的近 100% 兼容的插件,它使用更少的 memory,并且 io 和 CPU 效率更高。 These are major wins if you need prometheus in a EKS environment.如果您在 EKS 环境中需要 prometheus,这些都是重大胜利。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM