Configuring Kubernetes Observer jobs
Using this observer, you can configure jobs that discover the structure of your Kubernetes clusters, including pods, worker nodes and containers.
Before you begin
For Kubernetes load jobs, ensure you have the Kubernetes service details to hand, such as the Kubernetes host IP and SSL Certificate details. For Weave Scope listen jobs, first install Weave Scope, and then configure a job using the Weave Scope IP and port parameters.
Existing Load job functionality has been divided into two separate jobs, Load and Local. Local observations now run on the jobs/local endpoint. Existing scripts that use jobs/local to trigger a local observation of the Kubernetes environment will need to change the endpoint to jobs/local. With the introduction of new local job, the system-health job has been automatically migrated to use the same endpoint by the Kubernetes cron job. Any existing local jobs using the load API that are not automatically migrated, can be seen in the UI, deleted, and created using the correct job type.
The Kubernetes Observer is installed as part of the core installation procedure.
About this task
The observer reads topology data from Kubernetes through its REST APIs, or Weave Scope.
- Load
- A transient (one-off) job that loads all requested topology data from a Kubernetes environment.
- Local
- Performs a local observation of the Kubernetes REST API for available resources, and loads them in the topology service.
- Weave_scope Listen
- A standalone job that listens to the Weave Scope agent and continues to stream topology and state data to Agile Service Manager.
| Parameter | Action | Details |
|---|---|---|
| Unique ID | Enter a unique name for the job | Required |
| Encrypted Kubernetes token | The service account token for kubernetes. | Required. Must be encrypted. |
| Kubernetes Master IP address | Enter the Kubernetes Master IP address. | Required |
| Kubernetes API port | Enter the Kubernetes API port number. | Required |
| Trust all certificate by bypassing certificate verification | Enter true if you want to connect to Kubernetes without certificate | Required |
| Exact HTTPS certificate file name | Enter the exact name of the SSL/HTTPS certificate. | Optional. If 'Trust all certificate' is set to false, then this parameter is Required. |
| data_center | Specify the name of the data center in which the Kubernetes instance is running. | Required |
| API query timeout (ms) | Specify the Kubernetes REST API query timeout. | Optional. The default is 5000 ms (that is, 5 seconds) |
| Correlate | If 'true', enables the Event Analytics correlation on the namespace groups. | Optional |
| Namespace | Specify the Kubernetes namespace. | Optional. If left empty, all namespaces are observed. |
| Terminated pods | Choose whether terminated pods should be hidden (true or false). | Optional. The default is false. |
| Job schedule | Specify when the job runs. | Optional. Load jobs only. |
| Observer job description | Enter additional information to describe the job. | Optional |
./bin/encrypt_password.sh
Enter and then confirm the password. The encryption
utility will return an encrypted password, which you enter in the Encrypted Kubernetes
token field when configuring the Load job.- Get the kubernetes master IP and its API port
using:
kubectl cluster-info - Run the following OpenSSL
command:
echo -n | openssl s_client -connect {master ip}:{api} | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > ./certificate_file_name.crtThe certificate is saved as certificate_file_name.crt
- Copy the certificate file to the $ASM_HOME/security directory.
- When configuring the Load job, enter the certificate file name in the Exact HTTPS certificate file name field.
| Parameter | Action | Details |
|---|---|---|
| Unique ID | Enter a unique name for the job | Required |
| Host | Enter the Weave Scope host name (or IP address) of the web socket to be observed. | Required |
| Port | Enter the Weave Scope port number of the web socket to be observed. | Required |
| Cluster Name | Enter the name of the cluster or data center to be observed. | Required |
| Namespaces | Enter a list of namespaces to be observed. | Optional. If left empty, all namespaces will be observed. |
| Resource types | Select the Weave Scope resource types to observe. | Optional. |
| Resources to exclude | List resources to be excluded by ID, label, rank or namespace. | Optional. Containers named 'pod' are excluded by default. |
| Observer job description | Enter additional information to describe the job. | Optional |
Procedure
Configure the load or local jobs
Configure the weave_scope job