Open b2ronn opened 2 years ago
First, the spec.data_stream
field in your manifest doesn't exist (API doc).
apiVersion: apm.k8s.elastic.co/v1
kind: ApmServer
metadata:
name: apm-apm-sample
namespace: elastic
spec:
data_stream:
namespace: test2
Your manifest should be rejected:
> kubectl apply -f eck-5441-apm.yml
error: error validating " eck-5441-apm.yml ": error validating data: ValidationError(ApmServer.spec):
unknown field "data_stream" in co.elastic.k8s.apm.v1.ApmServer.spec;
if you choose to ignore these errors, turn validation off with --validate=false
Second, the standalone APM Server is now considered as legacy and will be soon deprecated because the Elastic APM integration became generally available starting 7.16
. This method of installing APM Server will be removed in a future release. Please consider getting started with the Elastic APM integration instead.
Third, the following questions are not ECK related but directly related to using APM, so I will transfer the issue to get help from the APM team who will be in a better position to answer it.
why don't all transactions have kubernetes.namespace?
how to change data_streams.namespace by default?
how to make the data written to different datastreams according to the template < type>-
- (traces-apm.app.petclinic-elastic, metrics-apm.app.petclinic-elastic) ? in apm-server 7.15 it was, but in 8.0.0 it was deprecated
spec.data_stream.namespace: test2 - Yes. it was just a test and didn't delete it.
data_stream.namespace by default can be changed through integrations, but I have an elastic-agent with an apm-server in one namespace, and java-agents will write there from other namespaces. through the fleet and the elastic-agent it is also not possible to change the data_stream.namespace for apm and java-agent. data_stream.namespace
---
kind: Namespace
apiVersion: v1
metadata:
name: elastic
---
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: kibana
spec:
version: 8.0.1
count: 1
elasticsearchRef:
name: elasticsearch
config:
xpack.fleet.agents.elasticsearch.hosts: ["https://elasticsearch-es-http.elastic.svc:9200"]
xpack.fleet.agents.fleet_server.hosts: ["https://fleet-server-agent-http.elastic.svc:8220"]
xpack.fleet.packages:
- name: apm
version: latest
xpack.fleet.agentPolicies:
- name: Default Fleet Server on ECK policy
is_default_fleet_server: true
package_policies:
- package:
name: fleet_server
name: fleet_server-1
- name: Default Elastic Agent on ECK policy
is_default: true
unenroll_timeout: 900
package_policies:
- package:
name: apm
name: apm-1
inputs:
- type: apm
enabled: true
vars:
- name: host
value: 0.0.0.0:8200
---
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.0.1
nodeSets:
- name: elastic
count: 1
config:
node.store.allow_mmap: false
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: fleet-server
spec:
image: docker.elastic.co/beats/elastic-agent:8.0.1
version: 8.0.1
kibanaRef:
name: kibana
elasticsearchRefs:
- name: elasticsearch
mode: fleet
fleetServerEnabled: true
deployment:
replicas: 1
podTemplate:
spec:
serviceAccountName: fleet-server
automountServiceAccountToken: true
securityContext:
runAsUser: 0
---
apiVersion: agent.k8s.elastic.co/v1alpha1
kind: Agent
metadata:
name: elastic-agent
spec:
image: docker.elastic.co/beats/elastic-agent:8.0.1
version: 8.0.1
kibanaRef:
name: kibana
fleetServerRef:
name: fleet-server
mode: fleet
deployment:
replicas: 1
podTemplate:
spec:
serviceAccountName: fleet-server
securityContext:
runAsUser: 0
---
apiVersion: v1
kind: Service
metadata:
name: apm
spec:
selector:
agent.k8s.elastic.co/name: elastic-agent
ports:
- protocol: TCP
port: 8200
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: fleet-server
rules:
- apiGroups: [""]
resources:
- pods
- namespaces
- nodes
verbs:
- get
- watch
- list
- apiGroups: ["coordination.k8s.io"]
resources:
- leases
verbs:
- get
- create
- update
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: fleet-server
namespace: elastic
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: fleet-server
subjects:
- kind: ServiceAccount
name: fleet-server
namespace: elastic
roleRef:
kind: ClusterRole
name: fleet-server
apiGroup: rbac.authorization.k8s.io
@b2ronn . Hi, were you able to solve the issue? I am also not able to change the namespace of APM integration through UI, it is always creating index and data stream in default space. I am using eck 8.2.3 . Have created a issue https://github.com/elastic/fleet-server/issues/1628 for the same. Any help much appreciated.
@SanjuTechie87 perhaps unrelated, but we recently fixed a bug in 8.3.0
where changing the APM Server data stream didn't work: https://www.elastic.co/guide/en/apm/guide/current/release-notes-8.3.html#_bug_fixes
i have a test simple configuration.
traces and metrics are written. but there are a few questions (maybe I didn't find it in the documentation)
ps: