Tutorial Intro
Try running Eolh on a minimally configured EKS cluster.
Getting Started
Get started by deploying Eolh to monitor Windows containers on EKS.
What you'll need
Create Eolh Container
First, clone the Eolh repository and build Eolh:
git clone https://github.com/FFRI/eolh.git
cd eolh
./prepare_build.sh
env GOOS=windows GOARCH=amd64 go build -o eolh.exe cmd/main.go
Copy eolh.exe
and Dockerfile
to a Windows Server 2022 and run this command:
# some-directory/
# ├ eolh.exe
# └ Dockerfile
# cd some-directory
# If you are using ECR, your command would be
# `docker build -f Dockerfile -t <aws_account_id>.dkr.ecr.<region>.amazonaws.com/monitor:latest`
docker build -f Dockerfile -t <your_repository>/monitor:<your_tag> .
After that, push the monitor
image to your repository.
Create an EKS Cluster
Create an EKS cluster using the yaml file.
cluster.yaml
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: eolh-tutorial
region: us-east-1 # region of your choice
nodeGroups:
- name: ng-1
amiFamily: WindowsServer2022FullContainer
instanceType: t3.medium
desiredCapacity: 1
maxSize: 2
- name: linux-ng
amiFamily: AmazonLinux2
desiredCapacity: 1
maxSize: 2
The cluster will be created after you run the command:
eksctl create cluster -f cluster.yaml
Deploy Eolh
Now we can deploy Eolh as a DaemonSet. Replace '<<your_monitor_image_path>>' with the image path you pushed.
monitor.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: monitor
spec:
selector:
matchLabels:
name: monitor
template:
metadata:
labels:
name: monitor
spec:
containers:
- name: monitor
image: <your_monitor_image_path>
args:
- ".\\eolh.exe; "
securityContext:
windowsOptions:
hostProcess: true
runAsUserName: "NT AUTHORITY\\SYSTEM"
hostNetwork: true
nodeSelector:
"kubernetes.io/os": windows
Then deploy it:
kubectl apply -f monitor.yaml
Get the name of the pod that Eolh is running. Run this command:
kubectl get pods
Then you will see:
NAME READY STATUS RESTARTS AGE
monitor-<random> 1/1 Running 0 112s
Now you can see the Eolh's log.
kubectl logs monitor-<random>
To delete the cluster, run this command:
eksctl delete cluster -f cluster.yaml
- We tested this tutorial on Ubuntu 22.04 on WSL.↩