Before installing the agent on the operating systems we support below, you need to download the certificate according to the instructions at Initialize Certificate . Information on setting up the agent is in the readme file, and the instruction scripts are also in the downloaded certificate file. Use this information with the instructions below to complete Agent for Log setup.
Setting
You can install the agent using Kubectl.
The goal when deploying in a k8s environment is usually to push the logs of all other pods. Therefore, we should deploy the agent as a daemon-set .
Kubectl
After initializing the Certificate, you will save the user authentication information to the k8s master node (or any machine that has kubectl and has execute rights on kubernetes).
Move to the agent you want to install, k8s / kubectl folder. Run command:
In order for the gent log to be able to read the logs of other pods, you need to repair your computer and disable selinux. On the k8s home page , it is also specified to disable selinux with centos. On k8s nodes, run the command:
Copy
setenforce 0
and go to the file /etc/sysconfig/selinuxto edit SELINUX=enforcingand become SELINUX=disabled.
The configuration files below have been prepared by us in the script when downloading the certificate. The description below helps readers imagine what it would be like if we created a manual.
Configuration
You need to edit the {parts in brackets} in the files below to suit your environment:
Filebeat
Filenamespace.yml.
Copy
File configmap.yml. For example, the configuration below will push all pod logs in the web-app namespace to the system
{$BOOTSTRAP_SERVERS}, {$TOPIC}Read the info.md file in the downloaded certificate folder.
Copy
Filesecret.yml
Copy
$vng.trust.pem, $user.cer.pem, $user.key.pem The content is md5 hash of the corresponding files in the certificate directory or create a secret with --from-file cert