You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/command/connect/envoy/bootstrap_tpl.go

56 lines
1.3 KiB

package envoy
type templateArgs struct {
ProxyCluster, ProxyID string
AgentHTTPAddress string
AgentHTTPPort string
AgentTLS bool
AgentCAFile string
AdminBindAddress string
AdminBindPort string
LocalAgentClusterName string
Token string
}
const bootstrapTemplate = `
# Bootstrap Config for Consul Connect
# Generated by consul connect envoy
admin:
access_log_path: /dev/null
address:
socket_address:
address: "{{ .AdminBindAddress }}"
port_value: {{ .AdminBindPort }}
node:
cluster: "{{ .ProxyCluster }}"
id: "{{ .ProxyID }}"
static_resources:
clusters:
- name: "{{ .LocalAgentClusterName }}"
connect_timeout: 1s
type: STATIC
{{ if .AgentTLS -}}
tls_context:
common_tls_context:
validation_context:
trusted_ca:
filename: {{ .AgentCAFile }}
{{- end }}
http2_protocol_options: {}
hosts:
- socket_address:
address: "{{ .AgentHTTPAddress }}"
port_value: {{ .AgentHTTPPort }}
dynamic_resources:
lds_config: {ads: {}}
cds_config: {ads: {}}
ads_config:
api_type: GRPC
grpc_services:
initial_metadata:
- key: x-consul-token
value: "{{ .Token }}"
envoy_grpc:
cluster_name: "{{ .LocalAgentClusterName }}"
`