The pod is made of 4 containers:
- Security Capability Model, (branch stable), listening on port 6000
- Refinement engine, (branch pod), listening on port 5000
- NSF Catalogue, (branch francesco), listening on port 8984
- Remediator engine, this repository.
kind is a tool for running local Kubernetes clusters using Docker container "nodes".
- Docker
INFO 🚧: even though this mini-guide is tailored for deploying the pod on a Kind Kuberentes cluster, you can run it just as well on any other Kubernetes cluster, such as those created with Minikube, or even native clusters.
Make sure to select the correct branch for each project.
- Security Capability Model -> (branch stable)
- Refinement engine -> (branch pod)
- NSF Catalogue -> (branch francesco)
You'll find the k8s resources files in the k8s_deployment folder.
The --platform flag is needed on Apple Silicon Macs. ARM versions of the containers don't work because of some dependency missing ARM binaries.
docker build --platform linux/amd64 -t nsf-catalogue .
docker build --platform linux/amd64 -t secap .
docker build --platform linux/amd64 -t fishy-remediator .
docker build --platform linux/amd64 -t refeng .
Check that the four images appear
docker image ls
kind create cluster
kind load docker-image fishy-remediator secap nsf-catalogue refeng
Check that the four images appear
docker exec -it kind-control-plane crictl images
kubectl apply -f pod.yml
The shell from which you executed the command will automatically attach to the fishy-remediator container.
In any moment you can exit from the shell session with the pod (i.e. the fishy-remediator container by default), and re-attach later via the following command:
kubectl attach -it poli-remediator
In this way container services are accessible directly on the machine in which the Kind cluster is running.
# kubectl port-forward <kubernetes-resource-name> <locahost-port>:<pod-port>
kubectl port-forward poli-remediator 6000:6000 # Security Capability Model
kubectl port-forward poli-remediator 5000:5000 # Refinement engine
kubectl port-forward poli-remediator 8984:8984 # NSF Catalogue
kubectl delete pods poli-remediator
kind delete cluster