Hello,
On the istio documentation page there is tutorial of setup istiod for logging into elastic :
I guess this tutorial is valid only if using mixer, so in the default install 1.5 this will not work.
Is there any tutorial how to achieve the same goal without using mixer ? Or should I re-enable mixer ?
Any help on this subject will be very useful, thank you in advance.
If someone is looking to log to ELK, my current solution is to activate logging by the ingress gateway with EnvoyFilter and installing fluentd daemon set to the istio-system
node pool (i’m using dedicated node pool for istio-system)
Envoy filter
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: ingress-gateway-logging
namespace: istio-system
spec:
workloadSelector:
labels:
istio: my-ingress-gateway
configPatches:
- applyTo: NETWORK_FILTER
match:
context: ANY
listener:
filterChain:
filter:
name: "envoy.http_connection_manager"
patch:
operation: MERGE
value:
typed_config:
"@type": "type.googleapis.com/envoy.config.filter.network.http_connection_manager.v2.HttpConnectionManager"
access_log:
- name: envoy.file_access_log
config:
path: /dev/stdout
json_format:
protocol: "%PROTOCOL%"
duration: "%DURATION%"
method: "%REQ(:METHOD)%"
urlPath: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%"
responseCode: "%RESPONSE_CODE%"
Fuentd configuration
<source>
@id fluentd-containers.log
@type tail
path /var/log/containers/*.log
pos_file /var/log/es-containers.log.pos
time_format %Y-%m-%dT%H:%M:%S.%NZ
tag raw.kubernetes.*
format json
read_from_head false
</source>
<filter kubernetes.**>
@type grep
<regexp>
key $.kubernetes.labels.istio
pattern my-ingress-gateway
</regexp>
<regexp>
key $.kubernetes.labels.app
pattern ^(.+)$
</regexp>
</filter>
<match kubernetes.**>
@type elasticsearch_dynamic
@log_level info
include_tag_key true
host logging-cluster
port 9200
index_name ${record['kubernetes']['labels']['app']}.${Time.at(time).getutc.strftime(@logstash_dateformat)}
include_timestamp true
<buffer>
@type file
path /var/log/fluentd-buffers/wanted.containers.buffer
flush_mode interval
retry_type exponential_backoff
retry_max_times 10
retry_wait 10s
flush_thread_count 2
flush_interval 30s
chunk_limit_size 8M
queue_limit_length 16
overflow_action block
</buffer>
</match>