The module is not enabled by default in any bundles.
The module is configured using the ModuleConfig custom resource named openvpn (learn more about setting up Deckhouse…).
Example of the ModuleConfig/openvpn resource for configuring the module:
apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
name: openvpn
spec:
version: 2
enabled: true
settings: # <-- Module parameters from the "Parameters" section below.
Parameters
Schema version: 2
- authobject
Options related to authentication or authorization in the application.
- auth.allowedUserGroupsarray of strings
An array of user groups that can access the OpenVPN admin panel.
This parameter is used if the user-authn module is enabled or the externalAuthentication parameter is set.
Caution! Note that you must add those groups to the appropriate field in the DexProvider config if this module is used together with the user-authn one.
- auth.externalAuthenticationobject
Parameters to enable external authentication based on the NGINX Ingress external-auth mechanism that uses the Nginx auth_request module.
Note! External authentication is enabled automatically if the user-authn module is enabled.
- auth.externalAuthentication.authSignInURLstring
The URL to redirect the user for authentication (if the authentication service returned a non-200 HTTP response code).
- auth.externalAuthentication.authURLstring
The URL of the authentication service. If the user is authenticated, the service should return an HTTP 200 response code.
- auth.externalAuthentication.authSignInURLstring
- auth.whitelistSourceRangesarray of strings
The CIDR range for which authentication to access the OpenVPN is allowed.
- auth.allowedUserGroupsarray of strings
- externalHoststring
An IP address or a domain clients use to connect to the OpenVPN server.
By default, data from an
openvpn-externalservice are used. - externalIPstring
The IP address of a cluster node to connect OpenVPN clients.
It is only required if the
ExternalIPinlet is used. - externalPortinteger
The port to expose on the
externalIPor load balancer.Default:
5416 - highAvailabilityboolean
Manually enable the high availability mode.
By default, Deckhouse automatically decides whether to enable the HA mode. Click here to learn more about the HA mode for modules.
- hostPortinteger
Port to connect to the OpenVPN server, which will be available on the node where it is scheduled.
The parameter is available when selecting inlet
HostPort.Default:
5416 - httpsobject
What certificate type to use with the OpenVPN admin panel.
This parameter completely overrides the
global.modules.httpssettings.- https.certManagerobject
- https.certManager.clusterIssuerNamestring
What ClusterIssuer to use for the OpenVPN admin panel (currently,
letsencrypt,letsencrypt-staging,selfsignedare available; also, you can define your own).Currently,
letsencrypt,letsencrypt-staging,selfsignedare available. Also, you can define your own.Default:
"letsencrypt"
- https.certManager.clusterIssuerNamestring
- https.customCertificateobject
- https.customCertificate.secretNamestring
The name of the Secret in the
d8-systemnamespace to use with the OpenVPN admin panel (this Secret must have the kubernetes.io/tls format).Default:
"false"
- https.customCertificate.secretNamestring
- https.modestring
The HTTPS usage mode:
CertManager— the OpenVPN admin panel will use HTTPS and get a certificate from the ClusterIssuer defined in thecertManager.clusterIssuerNameparameter.CustomCertificate— the OpenVPN admin panel will use the certificate from thed8-systemnamespace for HTTPS.Disabled— in this mode, the OpenVPN admin panel works over HTTP only.OnlyInURI— the OpenVPN admin panel will work over HTTP (thinking that there is an external HTTPS load balancer in front of it that terminates HTTPS traffic). All the links in the user-authn will be generated using the HTTPS scheme. Load balancer should provide a redirect from HTTP to HTTPS.
Allowed values:
Disabled,CertManager,CustomCertificate,OnlyInURI
- https.certManagerobject
- ingressClassstring
The class of the Ingress controller used for the OpenVPN admin panel.
By default, the
modules.ingressClassglobal value is used.Pattern:
^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ - inletstring
The way the connection is implemented.
The following inlet types are supported:
ExternalIP— when there are nodes with public IPs. It is used together with theexternalIPparameter.LoadBalancer— for all cloud providers and cloud-based placement strategies that support the provision of LoadBalancers.HostPort— the port of the OpenVPN server will be available on the node where it is scheduled. The port can be configured in thehostPortparameter.Direct— for non-standard cases. You need to create a service calledopenvpn-externalin thed8-openvpnnamespace. It will route traffic to the Pod with theapp: openvpnlabel to the port calledovpn-tcp(or just 1194). This service provides the externalIP, the IP address of the balancer or its host. If none of these are present, you need to specify theexternalHostparameter.
Allowed values:
ExternalIP,LoadBalancer,HostPort,Direct - loadBalancerobject
A section of optional parameters of the
LoadBalancerinlet.- loadBalancer.annotationsobject
Annotations to assign to the service for flexible configuration of the load balancer.
Note that module does not take into account the specifics of setting annotations in different clouds. If annotations for the provision of the load balancer are only used when the service is being created, then you need to restart the module (disable/enable it) to update them.
- loadBalancer.sourceRangesarray of strings
A list of CIDRs that are allowed to connect to the Load Balancer.
The cloud provider may not support this option or ignore it.
- loadBalancer.annotationsobject
- nodeSelectorobject
The same as in the Pods’
spec.nodeSelectorparameter in Kubernetes.If the parameter is omitted or
false, it will be determined automatically. - pmacctEnabledboolean
Enable logging of user’s activity via VPN in JSON format.
All connections within
tuninterfaces will be collected vialibpcapand logged as{"event_type": "purge", "ip_src": "172.25.175.10", "ip_dst": "10.222.0.10", "port_src": 32172, "port_dst": 53, "ip_proto": "udp", "packets": 1, "bytes": 53}Default:
false - pushDefaultGatewayToClientboolean
Routing all client traffic through the VPN. A default route will be added to clients.
Default:
false - pushToClientDNSstring
The IP address of the DNS server to send to clients upon connection.
By default, the IP address of the
kube-system/kube-dnsservice is used. - pushToClientRoutesarray of strings
A list of routes to send to clients upon their connection.
By default, this list is generated automatically using the local cluster network, service subnet, and Pod subnet.
Example:
pushToClientRoutes: - 172.25.176.0/24 - 172.25.178.0/255.255.255.0 - pushToClientSearchDomainsarray of strings
A list of search domains to send to clients upon connection.
The default value is a value from the
global.discovery.clusterDomainvariable. - tcpEnabledboolean
Default:
true - tolerationsarray of objects
The same as in the Pods’
spec.tolerationsparameter in Kubernetes.If the parameter is omitted or
false, it will be determined automatically.- tolerations.effectstring
- tolerations.keystring
- tolerations.operatorstring
- tolerations.tolerationSecondsinteger
- tolerations.valuestring
- tunnelNetworkstring
Tunnel network for OpenVPN server.
Default:
"172.25.175.0/24"Examples:
tunnelNetwork: 172.25.175.0/24tunnelNetwork: 172.25.178.0/255.255.255.0 - udpEnabledboolean
Default:
false
Authentication
user-authn module provides authentication by default. You can also configure authentication using the externalAuthentication parameter. If these options are disabled, the module will use basic auth with the auto-generated password.
Use kubectl to see password:
kubectl -n d8-system exec deploy/deckhouse -- deckhouse-controller module values openvpn -o json | jq '.openvpn.internal.auth.password'
Delete the Secret to re-generate password:
kubectl -n d8-openvpn delete secret/basic-auth
Note! The
auth.passwordparameter is deprecated.