Kibana version:
7.14
Elasticsearch version:
7.14
APM Server version:
7.14
APM Agent language and version:
Go (Gin)
go.elastic.co/apm/module/apmgin v1.13.1
Browser version:
None
Original install method (e.g. download page, yum, deb, from source, etc.) and version:
I am using Elastic Cloud on Kubernetes (ECK) way to install. Here is the step:
I have a folder elastic with these files:
elastic/elastic-namespace.yaml
apiVersion: v1
kind: Namespace
metadata:
name: elastic
elastic/hm-elasticsearch.yaml
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: hm-elasticsearch
namespace: elastic
spec:
version: 7.14.0
nodeSets:
- name: default
count: 1
config:
node.store.allow_mmap: false
elastic/hm-kibana.yaml
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: hm-kibana
namespace: elastic
spec:
version: 7.14.0
count: 1
elasticsearchRef:
name: hm-elasticsearch
elastic/hm-amp.yaml
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
name: hm-apm
namespace: elastic
spec:
version: 7.14.0
count: 1
elasticsearchRef:
name: "hm-elasticsearch"
kibanaRef:
name: "hm-kibana"
Then I installed by
kubectl apply --filename=https://download.elastic.co/downloads/eck/1.7.0/crds.yaml
kubectl apply --filename=https://download.elastic.co/downloads/eck/1.7.0/operator.yaml
kubectl apply --filename=elastic # "elastis" is the folder including files above.
Fresh install or upgraded from other version?
Fresh install
Is there anything special in your setup?
None
Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):
After install, I can see these services:
➜ kubectl get svc -n elastic
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hm-elasticsearch-es-transport ClusterIP None <none> 9300/TCP 4h49m
hm-elasticsearch-es-http ClusterIP 10.43.222.10 <none> 9200/TCP 4h49m
hm-kibana-kb-http ClusterIP 10.43.17.34 <none> 5601/TCP 4h49m
hm-apm-apm-http ClusterIP 10.43.72.56 <none> 8200/TCP 4h49m
hm-elasticsearch-es-default ClusterIP None <none> 9200/TCP 4h49m
and secrets:
➜ kubectl get secret -n elastic
NAME TYPE DATA AGE
default-token-hrz7n kubernetes.io/service-account-token 3 4h6m
hm-kibana-kibana-user Opaque 1 4h6m
elastic-hm-kibana-kibana-user Opaque 3 4h6m
hm-apm-apm-kb-user Opaque 1 4h6m
hm-apm-apm-user Opaque 1 4h6m
hm-elasticsearch-es-http-ca-internal Opaque 2 4h6m
elastic-hm-apm-apm-kb-user Opaque 3 4h6m
elastic-hm-apm-apm-user Opaque 3 4h6m
hm-kibana-kb-http-ca-internal Opaque 2 4h6m
hm-kibana-kb-http-certs-internal Opaque 3 4h6m
hm-kibana-kb-http-certs-public Opaque 2 4h6m
hm-apm-apm-kibana-ca Opaque 2 4h6m
hm-elasticsearch-es-http-certs-internal Opaque 3 4h6m
hm-elasticsearch-es-http-certs-public Opaque 2 4h6m
hm-kibana-kb-es-ca Opaque 2 4h6m
hm-apm-apm-http-ca-internal Opaque 2 4h6m
hm-apm-apm-es-ca Opaque 2 4h6m
hm-elasticsearch-es-transport-ca-internal Opaque 2 4h6m
hm-elasticsearch-es-transport-certs-public Opaque 1 4h6m
hm-elasticsearch-es-remote-ca Opaque 1 4h6m
hm-elasticsearch-es-elastic-user Opaque 1 4h6m
hm-elasticsearch-es-internal-users Opaque 3 4h6m
hm-elasticsearch-es-xpack-file-realm Opaque 3 4h6m
hm-apm-apm-http-certs-internal Opaque 3 4h6m
hm-apm-apm-http-certs-public Opaque 2 4h6m
hm-apm-apm-token Opaque 1 4h6m
hm-apm-apm-config Opaque 1 4h6m
hm-elasticsearch-es-default-es-transport-certs Opaque 3 4h6m
hm-elasticsearch-es-default-es-config Opaque 1 4h6m
hm-kibana-kb-config Opaque 2 4h6m
Then I try to save the APM public certificate locally by
kubectl get secret hm-elasticsearch-es-http-certs-public --namespace=elastic --output=go-template='{{index .data "tls.crt" | base64decode }}' > data/elastic-apm/tls.crt
I mount this tls.crt to Kubernetes by PersistentVolume
, and pass to my Go (Gin) app container by ELASTIC_APM_SERVER_CERT
. Here is my full env list I am using for this Go app:
ELASTIC_APM_SERVER_URL: "https://hm-apm-apm-http.elastic:8200"
ELASTIC_APM_ENVIRONMENT: "development"
ELASTIC_APM_LOG_LEVEL: "debug"
ELASTIC_APM_LOG_FILE: "stderr"
ELASTIC_APM_VERIFY_SERVER_CERT: "true"
ELASTIC_APM_SERVER_CERT: "/data/elastic-apm/tls.crt"
I can confirm my certificate be mounted successfully. However, my Elastic APM agent in Go app shows error
{"level":"error","time":"2021-08-08T16:29:22Z","message":"config request failed: sending config request failed: Get "https://hm-apm-apm-http.elastic:8200/config/v1/agents?service.environment=production\u0026service.name=hm-api-server\": failed to verify server certificate"}
{"level":"debug","time":"2021-08-08T16:29:51Z","message":"gathering metrics"}
{"level":"debug","time":"2021-08-08T16:29:52Z","message":"request failed: sending event request failed: Post "https://hm-apm-apm-http.elastic:8200/intake/v2/events\": failed to verify server certificate (next request in ~0s)"}
Am I using right certificate from Kubernetes secrets? Because there are many secrets there.
Any help would be appreciate, thanks!