【发布时间】:2020-03-27 18:00:22
【问题描述】:
我想将 Consul connect sidecar 添加到 kubernetes pod。
我已经在我的 Consul 集群中安装了 consul 注入器。我在文档中发现了这种添加注入注释的方法:
apiVersion: v1
kind: ServiceAccount
metadata:
name: static-server
---
apiVersion: v1
kind: Pod
metadata:
name: static-server
annotations:
"consul.hashicorp.com/connect-inject": "true"
spec:
containers:
# This name will be the service name in Consul.
- name: static-server
image: hashicorp/http-echo:latest
args:
- -text="hello world"
- -listen=:8080
ports:
- containerPort: 8080
name: http
# If ACLs are enabled, the serviceAccountName must match the Consul service name.
serviceAccountName: static-server
但是,在我的 K8s 集群中,目前有全状态集和部署。我在文档中发现您无法对部署进行注释。
有没有人尝试使用部署/状态集的 pod 建立 consul sidecar envoy?
【问题讨论】:
标签: kubernetes consul service-discovery