Kubernetes 自动加入Consul

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.

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

时间: 2024-11-03 02:58:39

Kubernetes 自动加入Consul的相关文章

Kubernetes——自动扩展容器!假设你突然需要增加你的应用;你只需要告诉deployment一个新的 pod 副本总数即可

参考:http://kubernetes.kansea.com/docs/hellonode/ 现在你应该可以通过这个地址来访问这个service: http://EXTERNAL_IP:8080 或者运行 curl http://EXTERNAL_IP:8080 如果通过浏览器或者 CURL 来访问新的 web 服务, 你应该可以看到一些运行日志: kubectl logs <POD-NAME> Kubernetes 的强大功能之一就是他可以很容易的扩容你的应用程序.假设你突然需要增加你的应

HashiCorp Consul + Kubernetes深度融合

SEP 05 2018?MITCHELL HASHIMOTO We're excited to announce multiple features that deeply integrate HashiCorp Consul with Kubernetes. This post will share the initial set of features that will be released in the coming weeks. The features include an off

Kubernetes集群水平扩展——HPA(自动伸缩)

Kubernetes集群可以通过Replication Controller的scale机制完成服务的扩容或缩容,实现具有伸缩性的服务. Kubernetes集群自动伸缩分为: sacle手动伸缩:可参考K8s资源对象的基本管理之使用命令行的方式(升级.回滚.扩容.缩容): autoscale自动伸缩:也就是本篇博文所介绍的HPA: Kubernetes自动扩展主要分为: 水平扩展:针对实例数目的增减: 垂直扩展:也就是单个实例就可以使用的资源的增减,比如增加CPU.内存: 一.HPA简介 HP

kubernetes ConfigMap和Secret

1 容器化应用配置方式概述 1 启动时直接向命令传递参数 docker 容器可用来运行单个应用程序,在制作docker镜像时,Dockerfile中的ENTRYPOINT 和 CMD 指令可用于指定容器启动时要运行的程序及相关的参数,CMD 指令以列表的形式指定要运行的程序及相关的参数,但若同时存在ENTRYPOINT指令,则CMD指令列表中的所有元素都被视为是ENTRYPOINT中程序的命令行参数,另外,在基于某镜像使用Docker 命令创建容器时,可在命令行向ENTRYPOINT中的程序传递

Kubernetes+Docker+Istio 容器云实践

随着社会的进步与技术的发展,人们对资源的高效利用有了更为迫切的需求.近年来,互联网.移动互联网的高速发展与成熟,大应用的微服务化也引起了企业的热情关注,而基于Kubernetes+Docker的容器云方案也随之进入了大众的视野.开普勒云是一个基于Kubernetes+Docker+Istio的微服务治理解决方案. 一.Microservices 1.1 解决大应用微服务化后的问题 现在各大企业都在谈论微服务,在微服务的大趋势之下技术圈里逢人必谈微服务,及微服务化后的各种解决方案. 1.2 当我们

kubernetes 学习笔记3

kubernetes  自动发布和回滚 deployment 引入的目的是为了更好的解决pod的编排问题. 创建一个deployment对象来生成对应的replica set 并完成 pod副本的创建过程 检查deployment的状态来看部署动作是否完成(pod副本的数量是否达到预期的值) 更新deployment以创建新的pod(比如镜像升级) 如果当前deployment不稳定,则回滚至一个早先的deployment版本 创建deployment $ kubectl create -f d

基于kubernetes构建Docker集群管理详解-转

http://blog.liuts.com/post/247/ 一.前言        Kubernetes 是Google开源的容器集群管理系统,基于Docker构建一个容器的调度服务,提供资源调度.均衡容灾.服务注册.动态扩缩容等功能套件,目前最新版本为0.6.2.本文介绍如何基于Centos7.0构建Kubernetes平台,在正式介绍之前,大家有必要先理解Kubernetes几个核心概念及其承担的功能.以下为Kubernetes的架构设计图:1. Pods        在Kuberne

Consul实践之Consul常见应用场景及方案梳理(FAQ)

Consul实践之Consul常见应用场景及方案梳理(FAQ),这篇文章用来回答一些在文章<Consul实践之相关计划与相关问题>中提到的一些问题.本方案整理参考依据于<使用Consul和Registrator实现Docker容器服务发现>英文原文<SERVICE DISCOVERY FOR DOCKER CONTAINERS USING CONSUL AND REGISTRATOR>,方案的实施依据可以根据原文进行. 手动新增的服务节点是否可以自动发现? 将consu

nginx+upsync+consul 构建动态nginx配置系统

参考: http://www.php230.com/weixin1456193048.html  [upsync模块说明.性能评测] https://www.jianshu.com/p/76352efc5657 https://www.jianshu.com/p/c3fe55e6a5f2 说明: 动态nginx负载均衡的配置,可以通过Consul+Consul-template方式,但是这种方案有个缺点:每次发现配置变更都需要reload nginx,而reload是有一定损耗的.而且,如果你需