In today’s digital landscape, securing your Kubernetes cluster is paramount. Introducing Kube-Scan, a straightforward and effective tool that assesses the risk levels of your workloads within Kubernetes. Whether you’re an experienced developer or just starting your journey in container orchestration, this guide will provide you with all you need to know about deploying and using Kube-Scan effortlessly.
Getting Started with Kube-Scan
Before you dive into the details, it’s important to understand what Kube-Scan does. Think of a Kubernetes cluster like a bustling city, where each application is a building. Kube-Scan acts as a vigilant inspector, evaluating each building’s safety and ensuring all are compliant with regulations.
As the inspector conducts its evaluation, it assigns a risk score to each building (workload) based on its current configuration. This score ranges from 0 (no risk) to 10 (high risk), offering a clear insight into which applications need attention. It evaluates over 20 settings to deliver a comprehensive risk assessment.
Quickstart Guide
To get Kube-Scan running, follow these simple steps:
- Apply the Kube-Scan configuration:
kubectl apply -f https://raw.githubusercontent.com/octarineseck/kube-scan/master/kube-scan.yaml
kubectl port-forward --namespace kube-scan svc/kube-scan-ui 8080:80
Using a Load-Balancer Service
If you’re using a cloud provider that supports load balancers, follow these steps:
- Deploy using the load balancer configuration:
kubectl apply -f https://raw.githubusercontent.com/octarineseck/kube-scan/master/kube-scan-lb.yaml
kubectl -n kube-scan get service kube-scan-ui -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
# or for hostname
kubectl -n kube-scan get service kube-scan-ui -o jsonpath='{.status.loadBalancer.ingress[0].hostname}'
Interacting with the API
If you’ve set up Kube-Scan with a load balancer, the following API calls will be useful:
- Get all the risks in your cluster:
GET http://HOST/api/risks
POST http://HOST/api/refresh
GET http://HOST/api/refreshing_status
Building from Source Code
If you want to customize Kube-Scan, you can build it from source. Here’s how:
- Build the server image:
cd server
docker build -t SERVER_TAG_NAME .
docker push SERVER_TAG_NAME
cd client
docker build -t CLIENT_TAG_NAME .
docker push CLIENT_TAG_NAME
Uninstalling Kube-Scan
If you need to uninstall Kube-Scan for any reason, use the following commands:
- To remove the basic installation:
kubectl delete -f https://raw.githubusercontent.com/octarineseck/kube-scan/master/kube-scan.yaml
kubectl delete -f https://raw.githubusercontent.com/octarineseck/kube-scan/master/kube-scan-lb.yaml
Troubleshooting Tips
If you encounter issues while using Kube-Scan, here are some troubleshooting strategies:
- Ensure that Kubernetes is running correctly and you have the necessary permissions.
- Check the logs of the Kube-Scan pod using:
kubectl logs -n kube-scan
Concluding Thoughts
Kube-Scan is a powerful tool to ensure your Kubernetes workloads remain secure and compliant. With its risk scoring and easy-to-follow setup, you can keep your applications in check like a seasoned inspector. At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

