You can use Logtail to collect application logs from nodes that run Windows. This topic describes how to use Logtail to collect application logs from nodes that run Windows.
Prerequisites
- A Container Service for Kubernetes (ACK) cluster is created and Enable Log Service is selected when you created the cluster. For more information, see Create a managed kubernetes cluster.
- Create a node pool that runs Windows.
Add Logtail to a node that runs Windows
Example
After you add Logtail to a node that runs Windows, use the following template to deploy
Logtail:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
app: logtail-test
name: logtail-test
spec:
replicas: 1
template:
metadata:
labels:
app: logtail-test
name: logtail-test
spec:
containers:
- name: nanoserver
image: mcr.microsoft.com/windows/servercore:1809
command: ["powershell.exe"]
args: ["ping -t 127.0.0.1 -w 10000"]
env:
######### Specify environment variables ###########
- name: aliyun_logs_logtail-stdout
value: stdout
- name: aliyun_logs_logttail-tags
value: tag1=v1
#################################
nodeSelector:
beta.kubernetes.io/os: windows
tolerations:
- effect: NoSchedule
key: os
operator: Equal
value: windows
After the preceding application is deployed, you can view the log data. For more information, see Query logs.