分享web开发知识

注册/登录|最近发布|今日推荐

主页 IT知识网页技术软件开发前端开发代码编程运营维护技术分享教程案例
当前位置:首页 > 教程案例

Kubernetes 自动加入Consul

发布时间:2023-09-06 02:15责任编辑:林大明关键词:暂无标签
SEP 19 2018?MITCHELL HASHIMOTO

We‘re releasing?HashiCorp Consul + Kubernetes?features every week.

This week we‘re showcasing the auto-join feature to enable nodes running inside and outside of Kubernetes to join a Consul cluster running on Kubernetes. Rather than joining with a static IP address or DNS entry, the auto-join feature uses the Kubernetes API to discover pods running Consul agents and joins those pods.

Video

To learn more about the Kubernetes auto-join provider for Consul, watch the video below or scroll down to read more. The video below shows a non-Kubernetes node automatically joining a Consul cluster running within Kubernetes.

http://v.youku.com/v_show/id_XMzgzMjc4MDIyNA==.html?spm=a2h3j.8428770.3416059.1

Auto-join for Kubernetes

Auto-join is a feature that enables Consul to use cloud or platform APIs for finding other Consul agents to join. This solves the problem of having to know the IP address of the initial set of agents to join a cluster. In the case of cloud APIs, hosts can often be tagged with specific values that Consul can use to filter hosts to find running Consul agents.

The Kubernetes auto-join provider uses the Kubernetes API to discover pods running Consul agents that can be joined. This feature can be used by agents both inside and outside of Kubernetes, but is particularly useful for agents running outside of Kubernetes because they cannot use standard Kubernetes service discovery to find the pods.

$ consul agent -retry-join ‘provider=k8s label_selector="app=consul,component=server"‘

The?-retry-join?flag above will cause the agent to query Kubernetes for pods labeled with?app=consul,component=server?and attempt to join those pods using the pod or host IP. If no pods are found, Consul will retry periodically.

Consul authenticates with Kubernetes using a standard kubeconfig file used for authenticating with?kubectl. It automatically searches standard locations for this file. This allows the Kubernetes auto-join feature to work with all major hosted Kubernetes offerings.

The Kubernetes auto-join provider supports many configuration options. See the full reference documentation of?available configuration options?for more information.

Next

The Kubernetes auto-join provider is available in Consul 1.2.3 and later. To learn more, see the?auto-join documentation.

We have more exciting Consul + Kubernetes integrations being released in the coming weeks. Please?read the Consul and Kubernetes announcement blog post?to learn more.

Kubernetes 自动加入Consul

原文地址:http://blog.51cto.com/13883466/2178854

知识推荐

我的编程学习网——分享web前端后端开发技术知识。 垃圾信息处理邮箱 tousu563@163.com 网站地图
icp备案号 闽ICP备2023006418号-8 不良信息举报平台 互联网安全管理备案 Copyright 2023 www.wodecom.cn All Rights Reserved