Kubernetes Connector — Prerequisites
Gather the Prometheus KPI response path and endpoints before connector setup.
Follow below steps before setting up the Kubernetes Connector.
-
To get the host (prometheus_kpi_response_path), refer to below example:
{ "metric":{ "__name__":"container_cpu_usage_seconds_total", "beta_kubernetes_io_arch":"amd64", "beta_kubernetes_io_os":"linux", "container":"go-hello-world", "cpu":"total", "id":"/kubepods/besteffort/pod2a967dcf-e65a-4d0b-aff2- c3d32ecc327d/20b9198c645f18b6ead2e6b7edecda44f7a0ba7e77d7b56fa15d3f5 43df911af", "image":"blackxcloudeng/go-hello- world@sha256:057ace518486f28d6fe813340172064eb515e280b46908b60a6d46a 7cc94375c", "instance":"localhost.localdomain", "job":"kubernetes-cadvisor", "kubernetes_io_arch":"amd64", "kubernetes_io_hostname":"localhost.localdomain", "kubernetes_io_os":"linux", "minikube_k8s_io_commit":"0a0ad764652082477c00d51d2475284b5d39ceed", "minikube_k8s_io_name":"minikube", "minikube_k8s_io_updated_at":"2021_10_06T14_52_48_0700", "minikube_k8s_io_version":"v1.23.2", "name":"k8s_go-hello-world_go-hello-world-6cc76464db- vtrjw_default_2a967dcf-e65a-4d0b-aff2-c3d32ecc327d_0", "namespace":"default", "pod":"go-hello-world-6cc76464db-vtrjw" }, "values":[ [ 1637154420, "404.775392965" ] ] } -
To get the comp (prometheus_kpi_response_path), refer to below example:
{ "metric":{ "__name__":"process_max_fds", "app":"go-hello-world", "appnomic_io_platform":"golang", "apponomic_app":"go-hello-world", "instance":"192.0.2.100:8086", "job":"kubernetes-pods", "kubernetes_namespace":"default", "kubernetes_pod_container_name":"go-hello-world", "kubernetes_pod_host_ip":"192.0.2.101", "kubernetes_pod_ip":"192.0.2.100", "kubernetes_pod_name":"go-hello-world-6cc76464db-vtrjw", "kubernetes_pod_uid":"2a967dcf-e65a-4d0b-aff2-c3d32ecc327d", "pod_template_hash":"6cc76464db", "prometheus_io_path":"/metrics", "prometheus_io_port":"8086", "prometheus_io_scrape":"true" }, "values":[ [ 1637154840, "1048576" ] ] }For Example:
+----+--------------+-----------------------------+--------------+-- -----------------+------------------------------+------------ | id | host_or_comp | uid | service_name | kpi_name | pod_name | pod_namespace | +----+--------------+-----------------------------+--------------+-- -----------------+------------------------------+------------ | 1 | host | $.metric.name | $.metric.job | $.metric.__name__ | $.metric.pod | $.metric.namespace | | 2 | comp | $.metric.kubernetes_pod_uid | $.metric.job | $.metric.__name__ | $.metric.kubernetes_pod_name | $.metric.kubernetes_namespace | +----+--------------+-----------------------------+--------------+-- -----------------+------------------------------+------------ -
To get the Kubernetes certificates.
-
client.crt file is located in below path:
<Path where minikube is installed>.minikube/profiles/minikubeFor Example:
-----BEGIN CERTIFICATE----- MIIDITCCAgmgAwIBAgIBAjANBgkqhkiG9w0BAQsFADAVMRMwEQYDVQQDEwptaW5p a3ViZUNBMB4XDTIxMTAwNTA5MDQzNFoXDTIyMTAwNjA5MDQzNFowMTEXMBUGA1UE ChMOc3lzdGVtOm1hc3RlcnMxFjAUBgNVBAMTDW1pbmlrdWJlLXVzZXIwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC1suWm8Nak/bqe0tuNQ1ObP060NujE A+joRYkqX07CnIjXHIne907JSS5BFwuO9JjLMWnYPU7fbW1qhre9C0kGh1AiMmZd KI0j/KrkDaRCPgh2sg0kvni95K4zs3GDTX64AEEH/nRu9bIs2M0a60WH+g9bEAiy p8yMJysh3F7DtK/yRMyqZ+MixQrG4fxJYqgCwqUi9vo1PytuXocLUUux0jsOQcbE KConllq0ifKzfMunp7l61wlzOMGLb8R26VmtyHI8OmRh27XOCV1LWgBBRzYmtoSD KdfO5UygM7RJwtArXAAXrHp7KRqSVZ+69gRE4p5tHy4Gx6QxEwPhigVvAgMBAAGj YDBeMA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUH AwIwDAYDVR0TAQH/BAIwADAfBgNVHSMEGDAWgBSXOaU382c172Dpc7/aMA3Nyuw1 1jANBgkqhkiG9w0BAQsFAAOCAQEAZiGBnRngMRcl10mQhkAU2m3NHr0An17WN3TJ m2JLOz9+o7rsHwBz9f/k7+jhaMzg+JdW4FlLAbkf7mkh1HAHbKBiuvGRDd8bSdcq Xw+T8ICkRwyGibCjqVT66rD3FPWViW1aI9KHaFw+I6+bkkVyoGMz1vp1SEC9czel KpdSEN6oM5a1dGtk7OqyFuNay8fCaxjWUIQ4OF/qD/wQ0VQiVDhTVk5Nk2R1NeVU +7615NJbBRYolsp/TOTMJ7Og8H+ffmtbEhWtqOG9ZKq5633CcsrAjxiG4TSMx5QU 9eWtsgc2pZbtuzRhRaVTQGI/DPHl/bDYneUGONVIcn19qz7k6Q== -----END CERTIFICATE----- -
Client-key is located in below path:
<Path where minikube is installed> .minikube/profiles/minikubeFor Example:
<contents of client.key>
-
-
To get the config file from Kubernetes.
-
Config file is located in the below path:
<Path where kubernetes runs>/.kube -
Remove the certificate-authority and provide the path for client-certificate and client-key in the below file and encode to Base64.
apiVersion: v1 clusters: - cluster: # certificate-authority: /home/CentOS/.minikube/ca.crt extensions: - extension: last-update: Wed, 06 Oct 2021 14:52:52 IST provider: minikube.sigs.k8s.io version: v1.23.2 name: cluster_info server: https://<ip>:<port> name: minikube contexts: - context: cluster: minikube extensions: - extension: last-update: Wed, 06 Oct 2021 14:52:52 IST provider: minikube.sigs.k8s.io version: v1.23.2 name: context_info namespace: default user: minikube name: minikube current-context: minikube kind: Config preferences: {} users: - name: minikube user: client-certificate: </path of the key present inside docker>/client.crt client-key: </path of the key present inside docker>/client. Key
-
-
Create account using Control Center for a particular client or organization.
Create application and services for that account using Control Center.