Get Data Storage Address of Global Service Cluster¶
Insight is a product for unified observation of multiple clusters. To achieve unified storage and querying of observation data from multiple clusters, sub-clusters need to report the collected observation data to the global service cluster for unified storage. This document provides the required address of the storage component when installing the collection component insight-agent.
Install insight-agent in Global Service Cluster¶
If installing insight-agent in the global service cluster, it is recommended to access the cluster via domain name:
export vminsert_host="vminsert-insight-victoria-metrics-k8s-stack.insight-system.svc.cluster.local" # (1)!
export es_host="insight-es-master.insight-system.svc.cluster.local" # (2)!
export otel_col_host="insight-opentelemetry-collector.insight-system.svc.cluster.local" # (3)!
Install insight-agent in Other Clusters¶
Get Address via Interface Provided by Insight Server¶
-
The management cluster uses the default LoadBalancer mode for exposure.
Log in to the console of the global service cluster and run the following command:
export INSIGHT_SERVER_IP=$(kubectl get service insight-server -n insight-system --output=jsonpath={.spec.clusterIP}) curl --location --request POST 'http://'"${INSIGHT_SERVER_IP}"'/apis/insight.io/v1alpha1/agentinstallparam'Note
Please replace the
${INSIGHT_SERVER_IP}parameter in the command.You will get the following response:
{ "values": { "global": { "exporters": { "logging": { "host": "10.6.182.32" }, "metric": { "host": "10.6.182.32" }, "auditLog": { "host": "10.6.182.32" }, "trace": { "host": "10.6.182.32" } } }, "opentelemetry-operator": { "enabled": true }, "opentelemetry-collector": { "enabled": true } } }global.exporters.logging.hostis the log service address, no need to set the proper service port, the default value will be used.global.exporters.metric.hostis the metrics service address.global.exporters.trace.hostis the trace service address.global.exporters.auditLog.hostis the audit log service address (same service as trace but different port).
-
Management cluster disables LoadBalancer
When calling the interface, you need to additionally pass an externally accessible node IP from the cluster, which will be used to construct the complete access address of the proper service.
export INSIGHT_SERVER_IP=$(kubectl get service insight-server -n insight-system --output=jsonpath={.spec.clusterIP}) curl --location --request POST 'http://'"${INSIGHT_SERVER_IP}"'/apis/insight.io/v1alpha1/agentinstallparam' --data '{"extra": {"EXPORTER_EXTERNAL_IP": "10.5.14.51"}}'You will get the following response:
{ "values": { "global": { "exporters": { "logging": { "scheme": "https", "host": "10.5.14.51", "port": 32007, "user": "elastic", "password": "j8V1oVoM1184HvQ1F3C8Pom2" }, "metric": { "host": "10.5.14.51", "port": 30683 }, "auditLog": { "host": "10.5.14.51", "port": 30884 }, "trace": { "host": "10.5.14.51", "port": 30274 } } }, "opentelemetry-operator": { "enabled": true }, "opentelemetry-collector": { "enabled": true } } }global.exporters.logging.hostis the log service address.global.exporters.logging.portis the NodePort exposed by the log service.global.exporters.metric.hostis the metrics service address.global.exporters.metric.portis the NodePort exposed by the metrics service.global.exporters.trace.hostis the trace service address.global.exporters.trace.portis the NodePort exposed by the trace service.global.exporters.auditLog.hostis the audit log service address (same service as trace but different port).global.exporters.auditLog.portis the NodePort exposed by the audit log service.
Connect via LoadBalancer¶
-
If
LoadBalanceris enabled in the cluster and aVIPis set for Insight, you can manually execute the following command to obtain the address information forvminsertandopentelemetry-collector:$ kubectl get service -n insight-system | grep lb lb-insight-opentelemetry-collector LoadBalancer 10.233.23.12 <pending> 4317:31286/TCP,8006:31351/TCP 24d lb-vminsert-insight-victoria-metrics-k8s-stack LoadBalancer 10.233.63.67 <pending> 8480:31629/TCP 24dlb-vminsert-insight-victoria-metrics-k8s-stackis the address for the metrics service.lb-insight-opentelemetry-collectoris the address for the tracing service.
-
Execute the following command to obtain the address information for
elasticsearch:$ kubectl get service -n mcamel-system | grep es mcamel-common-es-cluster-masters-es-http NodePort 10.233.16.120 <none> 9200:30465/TCP 47dmcamel-common-es-cluster-masters-es-httpis the address for the logging service.
Connect via NodePort¶
The LoadBalancer feature is disabled in the global service cluster.
In this case, the LoadBalancer resources mentioned above will not be created by default. The relevant service names are:
- vminsert-insight-victoria-metrics-k8s-stack (metrics service)
- common-es (logging service)
- insight-opentelemetry-collector (tracing service)
After obtaining the corresponding port information for the services in the above two scenarios, make the following settings:
--set global.exporters.logging.host= # (1)!
--set global.exporters.logging.port= # (2)!
--set global.exporters.metric.host= # (3)!
--set global.exporters.metric.port= # (4)!
--set global.exporters.trace.host= # (5)!
--set global.exporters.trace.port= # (6)!
--set global.exporters.auditLog.host= # (7)!
- NodeIP of the externally accessible management cluster
- NodePort of the logging service port 9200
- NodeIP of the externally accessible management cluster
- NodePort of the metrics service port 8480
- NodeIP of the externally accessible management cluster
- NodePort of the tracing service port 4317
- NodeIP of the externally accessible management cluster