How to monitor AKS WindowsContainer - windows service (eventlog,custom log files) redirected to K8s logs - Streamed out as a docker log so that we can monitor using Azure Monitor
What is LogMonitor: Log Monitor is a log tool for Windows Containers. It monitors configured log sources and pipes a formatted output to STDOUT.
More info here -> https://github.com/microsoft/windows-container-tools/tree/main/LogMonitor
apiVersion: apps/v1
kind: Deployment
metadata:
name: mikkywinsvc
labels:
app: mikkywinsvc
spec:
replicas: 1
template:
metadata:
name: mikkywinsvc
labels:
app: mikkywinsvc
spec:
nodeSelector:
"kubernetes.io/os": windows
containers:
- name: mikkywinsvc
image: mikkyacr1.azurecr.io/mikkywinsvc1:latest
resources:
limits:
cpu: 1
memory: 800M
ports:
- containerPort: 80
selector:
matchLabels:
app: mikkywinsvc
useful commands - AKS
docker build -t mikkywinsvc1 .
mikkyacr1.azurecr.io
az acr login --name mikkyacr1.azurecr.io
docker image tag mikkywinsvc1:latest mikkyacr1.azurecr.io/mikkywinsvc1:latest
docker push mikkyacr1.azurecr.io/mikkywinsvc1:latest
kubectl exec -it mikkywinsvc-798dc868f7-jfc5v -- cmd
PS: Always use the latest LogMonitor downloaded from here -> https://github.com/microsoft/windows-container-tools/releases/
