简体   繁体   English

Kubernetes / AWS-删除服务后不删除ELB

[英]Kubernetes/AWS - ELB is not deleted when the service is deleted

I'm using the --cloud-provider=aws flag to integrate Kubernetes with AWS. 我正在使用--cloud-provider=aws标志将Kubernetes与AWS集成。 I'm able to create and expose a service via ELB using the following commands: 我可以使用以下命令通过ELB创建和公开服务:

kubectl run sample-nginx --image=docker.io/nginx --port=80

kubectl expose deployment/sample-nginx --port=80 --target-port=80 \
--name=sample-nginx-service --type=LoadBalancer && \
kubectl annotate svc sample-nginx-service \
service.beta.kubernetes.io/aws-load-balancer-internal=0.0.0.0/0

This exposes the nginx service on an internal-ELB on a private subnet. 这将在私有子网的内部ELB上公开nginx服务。 I'm able to access the service on the ELB as well. 我也可以在ELB上访问该服务。

Now, when I delete the service, the service is deleted, but the ELB is not. 现在,当我删除服务时,该服务将被删除,但ELB不会被删除。 Here's how I deleted the service: 这是我删除服务的方法:

kubectl delete services sample-nginx-service

Any pointers to what could be going wrong? 有什么提示可能会出问题吗? I did not see any errors in the kube-controller-manager log when I ran the deletion command. 运行删除命令时,在kube-controller-manager日志中没有看到任何错误。 What other logs should I be checking? 我还应该检查其他哪些日志?

Upgrading to etcd v3.0.17 from v3.0.10 fixed the issue. v3.0.10升级到etc​​d v3.0.17修复了该问题。 I found another log messaged in the controller logs which pointed to the issue here: 我在控制器日志中发现了另一个日志消息,指出此处的问题:

https://github.com/kubernetes/kubernetes/issues/41760 https://github.com/kubernetes/kubernetes/issues/41760

You seem to have a typo on your service delete command. 您的服务删除命令似乎有错字。

It should be kubectl delete services sample-nginx-service . 应该是kubectl delete services sample-nginx-service

I just tried this on my AWS cluster and confirmed that the ELB was deleted successfully after running this. 我只是在我的AWS集群上尝试过此操作,并确认运行此命令后成功删除了ELB。

I'm running Kubernetes 1.6.2 with kubectl 1.6.3 我正在用Kubectl 1.6.3运行Kubernetes 1.6.2

您可以使用配置文件执行相同的过程,看看是否与命令或配置相关吗?

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

相关问题 kubernetes:AWS ELB无法正常工作 - kubernetes: AWS ELB not working 获取 kubernetes 集群的所有 pod 列表(包括已删除)? (AWS EKS) - Get list of all pods (including deleted) for kubernetes cluster? (AWS EKS) 完全删除堆栈时的AWS Cloudformation回调 - AWS Cloudformation callback when a stack is completely deleted AWS 连接实例已删除 - AWS connect instance deleted ElasticSearch大量清除已删除文件的原因? (AWS ES服务) - ElasticSearch massive purge of deleted documents reasons? (AWS ES service) 如何在不使用 ELB 服务的情况下使用 kops 在 AWS 上创建 Kubernetes 集群? - How to use kops to create a Kubernetes cluster on AWS without the usage of the ELB service? 使用 AWS 配置 HSTS(ELB、Kubernetes Nginx 和 ACM) - Configuring HSTS with AWS (ELB, Kubernetes Nginx and ACM) 使用Kubernetes创建服务http和https的AWS ELB - Creating a AWS ELB serving http and https with Kubernetes AWS EventBridge:删除多个对象时如何仅发送 1 个通知 - AWS EventBridge: How to send only 1 notification when multiple objects deleted AWS Amplify:当资源已被部分删除时,如何删除环境? - AWS Amplify: How to delete the environment, when resources are already partially deleted?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM