This article describes the procedure to integrate a Minikube Kubernetes in VirtualBox with FortiGate Private SDN Connector. The integration can protect the Kubernetes Cluster from external threats with FortiGate when exposing the application or services to the public.
Minikube is a lightweight tool to deploy a one-node Kubernetes Cluster. It requires a docker or Virtual Machine to deploy.
In this example, the cluster is deployed with a VirtualBox.
FortiGate.
The deployment of Kubernetes will need to install a Minikube and VirtualBox. The procedure below will provide a guide to set up the environment.
Refer to the link below for the installation guide: https://minikube.sigs.k8s.io/docs/start/
After the 'minikube start' is executed in the CLI command, it will create a one-node Kubernetes and automatically choose the driver available. To deploy with a specific driver execute the command below:
minikube start <----- Automatically choose driver available.
minikube start --driver=<driver name> <----- Specific driver to mount Minikube.
minikube start --driver=none <----- Deploy Minikube without driver (only available to Linux OS).
After the minikube is deployed, the IP Address can be verified with the command below:
Adapter 1: NAT (External device or host connection).
Adapter 2: Host-only Adapter (Internal Kubernetes connection).
For Kubernetes to be accessible from the host or external devices, the NAT adapter needs to configure port forwarding. In VirtualBox, go to minikube -> Settings -> Network -> Adapter 1 -> Advanced -> Port Forwarding -> Create new rules:
Host IP: Interface IP connected to external devices (By default, localhost is applied).
Host Port: Any port between 1-65535 for external devices connection.
Guest Port: Kubernetes cluster port.
The Kubernetes cluster port can be obtained from the command below:
kubectl apply -f <YAML file or JSON file path>
Refer to the guide below for more information:
Note:
Versions of Kubernetes before v1.22 automatically created long-term credentials for accessing the Kubernetes API. This older mechanism was based on creating FortiToken Secrets that could then be mounted into running Pods. In more recent versions, including Kubernetes v1.26, API credentials are obtained directly by using the TokenRequest API, and are mounted into Pods using a projected volume.
The tokens obtained using this method have bounded lifetimes and are automatically invalidated when the Pod they are mounted into is deleted.
It is still possible to manually create a service account FortiToken Secret; for example, if a FortiToken that never expires.
Example of YAML is provided below:
apiVersion: v1
kind: Secret
metadata:
name: <token name>
annotations:
kubernetes.io/service-account.name: <service account name>
type: kubernetes.io/service-account-token
The IP address and a port number need to point towards the port forwarding exposed at the VirtualBox NAT Adapter in Step 3
Note:
The Secret FortiToken is obtained from the configuration from Step 5.
The FortiToken is encoded with base64 and needs to be decoded for application in the FortiGate Private SDN Connector configuration.
Use the kubectl command below to get the FortiToken:
kubectl get secrets -o jsonpath="{.items[?(@.metadata.annotations['kubernetes\.io/service-account\.name']=='fortigateconnector')].data.token}"| base64 –decode
OR
kubectl get secrets -o json
Copy the FortiToken in the output below and decode manually with Base64:
Refer to the below link for configuration:
Collecting only node IP addresses with Kubernetes SDN connectors
Related documents:
https://docs.fortinet.com/document/fortigate/6.2.0/new-features/295444/private-cloud-k8s-connector
https://minikube.sigs.k8s.io/docs/start/
https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/
Awesome KB for everyone!
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.