If you are using a bare-metal Kubernetes cluster, you can use MetalLB to expose your ICAP service.
Enable MetalLB with an appropriate IP range for your network
# Replace the IP range with one suitable for your network
microk8s enable metallb:192.168.1.200-192.168.1.220
Update values.yaml with the following content:
scanner:
# Other scanner settings remain unchanged
# Enable external LoadBalancer service for ICAP
externalService:
enabled: true
annotations: {}
icapPort: 1344
Run the following:
helm upgrade my-release visionone-filesecurity/visionone-filesecurity \
-n visionone-filesecurity \
-f values.yaml
Run the following:
# Check the service status
kubectl get service -n visionone-filesecurity | grep scanner-lb
# Get the external IP assigned by MetalLB
EXTERNAL_IP=$(kubectl get service -n visionone-filesecurity my-release-visionone-filesecurity-scanner-lb -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Your MetalLB external IP is: $EXTERNAL_IP"
Install and use the c-icap-client to test your connection:
# Install c-icap-client
sudo apt-get install c-icap
# Test with file scanning
c-icap-client -i $EXTERNAL_IP -s scan -p 1344 -f sample.txt -x "X-scan-file-name: sample.txt"