Fork of - https://github.com/offlinehacker/openvpn-k8s
1.1K
Dockerfile to run openvpn inside kubernetes.
If you find this image useful you can help by doing one of the following:
Automated builds of the image are available on Dockerhub and is the recommended method of installation.
docker pull offlinehacker/openvpn-k8s:latest
Alternatively you can build the image locally.
git clone https://github.com/offlinehacker/openvpn-k8s.git
cd openvpn
docker build -t offlinehacker/openvpn-k8s .
This image was created to simply have openvpn access to kubernetes cluster.
First you will need to create secret volume with dh params and server certificate in pkcs12 format.
openvpn-secrets.yaml file:
apiVersion: v1
kind: Secret
metadata:
name: openvpn
data:
dh.pem: <base64_encoded_dh_pem_file>
certs.p12: <base64_encoded_certs_file>
kubectl create -f openvpn-secrets.yaml
openvpn-controller.yaml file:
apiVersion: v1
kind: ReplicationController
metadata:
name: openvpn
labels:
name: openvpn
spec:
replicas: 2
selector:
name: openvpn
template:
metadata:
labels:
name: openvpn
spec:
containers:
- name: openvpn
image: offlinehacker/openvpn-k8s
securityContext:
capabilities:
add:
- NET_ADMIN
env:
- name: OVPN_NETWORK
value: 10.240.0.0
- name: OVPN_SUBNET
value: 255.255.0.0
- name: OVPN_PROTO
value: tcp
- name: OVPN_K8S_SERVICE_NETWORK
value: 10.241.240.0
- name: OVPN_K8S_SERVICE_SUBNET
value: 255.255.240.0
- name: OVPN_K8S_DNS
value: 10.241.240.10
ports:
- name: openvpn
containerPort: 1194
volumeMounts:
- mountPath: /etc/openvpn/pki
name: openvpn
volumes:
- name: openvpn
secret:
secretName: openvpn
openvpn-service.yaml file:
kind: Service
apiVersion: v1
metadata:
name: openvpn
spec:
ports:
- name: openvpn
port: 1194
targetPort: 1194
selector:
name: openvpn
type: LoadBalancer
kubectl create -f openvpn-service.yaml
Below is the complete list of available options that can be used to customize your packetbeat container instance.
duplicate-cnContent type
Image
Digest
Size
4 MB
Last updated
almost 10 years ago
docker pull sstarcher/openvpn-k8s