I can't start apm servicemap

yaml context

kind: ApmServer
  name: apm-server
  version: 7.7.0
  count: 1
        disabled: true
        type: NodePort
          - name: http
            nodePort: 31822
            port: 8200
            protocol: TCP
            targetPort: 8200
    apm-server.rum.enabled: true
    apm-server.rum.allow_origins: ['*']
    name: elasticsearch-master

Hey @wajika, thanks for reporting. It's not clear for me on which button you clicked based on the provided gif.
When I spin up the 7.7.0 stack locally I can successfully access the service map (https://kibana-url:5601/app/apm#/service-map), which then prompts me to enable a trial license. Which can be done this way in ECK.

It refreshed the page and returned to /app/kibana#/home

@wajika you need to enable trial licenses at ECK-level, you cannot do it at Kibana level.
You can follow those instructions.

@sebgl I have used a trial license and it still has no effect

Unfortunately you ran into a corner case by starting a trial once via Kibana and then again via ECK. ECK enforces the license it is running on in all clusters it manages. When you clicked the "start trial" button in Kibana, ECK immediately reverted your cluster back to a Basic license (because ECK itself was Basic licensed at that time). When you then started the ECK trial your existing cluster was not upgraded to trial again, because you can start a trial only once. I realise that this behaviour is frustrating and opened https://github.com/elastic/cloud-on-k8s/issues/3141 to improve ECK in that respect. Sorry about that!

Your options are now:

  • create a new Elasticsearch cluster to try out APM service map (it should pick up the trial license from ECK)
  • if you are in contact with a sales representative from Elastic you can ask for a trial extension which you could install to get your existing cluster back into trial mode.

I have operated kubectl delete -f a few times before, and the data directory of elasticsearch is also deleted, but every time I re-kubectl create -f, this problem still exists

Can you check whether the ECK trial has been started successfully by following the instructions here and running

kubectl -n elastic-system get configmap elastic-licensing -o json | jq .data

This is assuming you have installed the operator in the elastic-system namespace and that you have jq installed.

You should see "eck_license_level": "enterprise_trial" as part of the returned JSON document.

My situation is a bit different from that in the documentation. Instead of deploying elastic under the elastic-system namespace, I placed it directly under the defaults ns, but I see that lic will appear under elastic-system ns regardless of whether the namespace is added , Does this have an impact on authorization?

cat lic.yaml
> apiVersion: v1
> kind: Secret
> metadata:
> name: eck-trial-license
> labels:
> license.k8s.elastic.co/type: enterprise_trial
> annotations:
> elastic.co/eula: accepted

> kubectl  get configmap elastic-licensing -o json | jq .data
> {
>   "eck_license_level": "basic",
>   "enterprise_resource_units": "1",
>   "timestamp": "2020-05-28T00:59:04Z",
>   "total_managed_memory": "9.13GB"
> }

I re-executed kubectl create -f . -nelastic-system(redeploy),the license_level obtained is still basic

> kubectl -n elastic-system get configmap elastic-licensing -o json | jq .data
> {
>   "eck_license_level": "basic",
>   "enterprise_resource_units": "1",
>   "timestamp": "2020-05-28T01:21:04Z",
>   "total_managed_memory": "9.13GB"
> }

The licensing configmap data shows that the trial has not been successfully activated in your ECK installation.

The license secret needs to be created in a namespace the operator can read from. In your case the natural choice would be the default namespace as this is where you installed the operator. Our examples use elastic-system because that is our recommend way of deploying ECK and that is also what is used in the YAML manifest we release with ECK, but other namespaces work just as well.

For a definitive answer we would need to know better how exactly you deployed ECK (which namespaces does it have access to, did you change any of the RBAC permissions, which of the config options are you using and with what values? Maybe you can share your manifest?)

It might also help to enable debug logging to see why your trial is not started.