OpenVPN : Access your k8s cluster
Install OpenVPN on the Cluster:
Ensure that OpenVPN is deployed as a pod or service within your Kubernetes cluster. This installation is a prerequisite for any remote connections to the cluster.Verify Installation:
you will find OpenVPN under installed components.

Access & Security
Download VPN Configuration File:
In the Access & Security section, download the VPN configuration file. This file contains the basic settings required by your VPN client.Adding a Firewall Rule
Under the VPN Firewall Rules section, click on Add firewall rule to specify a CIDR block that will allow networks or individual IP addresses to access your cluster.
Example 1:
Rule:85.95.6.3/32
Explanation: This rule permits access exclusively from the IP address85.95.6.3
.Example 2:
Rule:85.95.0.0/16
Explanation: This rule allows access from all IP addresses within the range85.95.0.0
to85.95.255.255
.
Calculation:Starting IP:
85.95.0.0
Ending IP:
85.95.255.255
Total Addresses: 65,536 (i.e., 2^(32-16))
These rules ensure that only the specified networks or IP addresses can access your cluster, providing a secure and controlled environment.
VPN Configuration File
Important:
The VPN configuration file provided by Kubedna is a starting point. On its own, it is not sufficient to secure access to your cluster.
Firewall Rules and IP Whitelisting
Add VPN Firewall Rules:
To secure your cluster, configure the VPN firewall rules. This step involves defining the allowed IP addresses or network ranges that can access the server.Whitelist Allowed IP Addresses:
Update your firewall settings to include the IP addresses or network ranges that are permitted to connect to the VPN server. This is crucial to prevent unauthorized access.Configure the VPN Client Settings:
Once the firewall rules are in place, adjust your VPN configuration file to reflect the allowed IP ranges. This may involve editing the file or importing it into your VPN client with the updated settings.
Connecting to Your Network
Use a Supported VPN Client:
Import the updated VPN configuration file into your preferred VPN client, such as:OpenVPN Client
Tunnelblick (for macOS)
Establish Connection:
Launch your VPN client and connect using the imported configuration. Once connected, your client will have a secure tunnel into your Kubernetes cluster.
Accessing Your Cluster
Download the kubeconfig File:
In addition to the VPN configuration, download the kubeconfig file from Kubedna. This file is required to interact with your Kubernetes cluster using tools likekubectl
.Configure kubectl:
Use the kubeconfig file to set up yourkubectl
context:CODEbash
Copy
export KUBECONFIG=/path/to/your/kubeconfig.yaml kubectl get nodes
This will confirm that you have proper access to your cluster.
Additional Notes
Security Reminder:
Always ensure that your VPN firewall rules are up-to-date. The configuration file must be tailored to include the correct allowed IP addresses or network ranges.Troubleshooting:
If you are unable to connect, verify that:OpenVPN is properly running on the cluster.
Firewall rules have been correctly configured.
The VPN client configuration file is updated with the allowed IPs.
The kubeconfig file is properly set up to access the cluster.
For further assistance, consult the Kubedna support team or refer to our online documentation portal.