Copy # https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-deploy-eck.html
kubectl create -f https://download.elastic.co/downloads/eck/2.9.0/crds.yaml
If it is a self-host ECK, you can directly associate internal elasticsearch with kibana, for example.
Copy # https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-apm-eck-managed-es.html
apiVersion : apm.k8s.elastic.co/v1
kind : ApmServer
metadata :
name : weplanx
namespace : elastic-system
spec :
version : 8.10.3
count : 1
config :
apm-server :
host : "0.0.0.0:8200"
rum :
enabled : true
expvar :
enabled : true
http :
tls :
selfSignedCertificate :
disabled : true
podTemplate :
spec :
affinity :
nodeAffinity :
requiredDuringSchedulingIgnoredDuringExecution :
nodeSelectorTerms :
- matchExpressions :
- key : kubernetes.io/hostname
operator : NotIn
values :
- main
elasticsearchRef :
name : elasticsearch
kibanaRef :
name : kibana
Copy apiVersion : apm.k8s.elastic.co/v1
kind : ApmServer
metadata :
name : weplanx
namespace : elastic-system
spec :
version : 8.10.3
count : 1
config :
apm-server :
host : "0.0.0.0:8200"
rum :
enabled : true
expvar :
enabled : true
kibana :
enabled : true
host : https://kibana.xxx.com:5601
output :
elasticsearch :
hosts : [ "https://elastic.xxx.com:9200" ]
username : xxx
password : xxx
protocol : "https"
http :
tls :
selfSignedCertificate :
disabled : true
Copy # https://www.elastic.co/guide/en/cloud-on-k8s/current/k8s-apm-connecting.html
kubectl get secret/weplanx-apm-token -o go-template= '{{index .data "secret-token" | base64decode}}' -n elastic-system
Each creation automatically generates a new key and service to plug into the application OpenTelemetry
Finally, the APM integration must be enabled in kibana, and the access is successful.