Skip to content

Commit 2bc2c5d

Browse files
authored
Merge pull request #51 from Collaborne/pr/mount-selinux
Use ':z' modifier for mounts
2 parents 6cf4760 + 062a94a commit 2bc2c5d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ The main motivator for this project was having the ability to route service requ
1313
## Usage
1414
First, you need to initialize your PKI infrastructure. Easyrsa is bundled in this container, so this is fairly easy. Replace `OVPN_SERVER_URL` with your endpoint to-be.
1515
```
16-
$ docker run --user=$(id -u) -e OVPN_SERVER_URL=tcp://vpn.my.fqdn:1194 -v $PWD:/etc/openvpn -ti ptlange/openvpn ovpn_initpki
16+
$ docker run --user=$(id -u) -e OVPN_SERVER_URL=tcp://vpn.my.fqdn:1194 -v $PWD:/etc/openvpn:z -ti ptlange/openvpn ovpn_initpki
1717
```
1818
Follow the instructions on screen. Remember (or better: securely store) your secure password for the CA. You are now left with a `pki` folder in your current working directory.
1919

2020
Generate the initial Certificate Revocation List. This file needs to be updated every `$EASYRSA_CRL_DAYS`. All clients will be blocked when this file expires.
2121
```
22-
$ docker run --user=$(id -u) -e EASYRSA_CRL_DAYS=180 -v $PWD:/etc/openvpn -ti ptlange/openvpn easyrsa gen-crl
22+
$ docker run --user=$(id -u) -e EASYRSA_CRL_DAYS=180 -v $PWD:/etc/openvpn:z -ti ptlange/openvpn easyrsa gen-crl
2323
```
2424

2525

@@ -63,8 +63,8 @@ With the pki still in `$PWD/pki` we can create a new VPN user and grab the `.ovp
6363

6464
```
6565
# Generate VPN client credentials for CLIENTNAME without password protection; leave 'nopass' out to enter password
66-
$ docker run --user=$(id -u) -v $PWD:/etc/openvpn -ti ptlange/openvpn easyrsa build-client-full CLIENTNAME nopass
67-
$ docker run --user=$(id -u) -e OVPN_SERVER_URL=tcp://vpn.my.fqdn:1194 -v $PWD:/etc/openvpn --rm ptlange/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn
66+
$ docker run --user=$(id -u) -v $PWD:/etc/openvpn:z -ti ptlange/openvpn easyrsa build-client-full CLIENTNAME nopass
67+
$ docker run --user=$(id -u) -e OVPN_SERVER_URL=tcp://vpn.my.fqdn:1194 -v $PWD:/etc/openvpn:z --rm ptlange/openvpn ovpn_getclient CLIENTNAME > CLIENTNAME.ovpn
6868
```
6969

7070
`CLIENTNAME.ovpn` can now be used to connect to the cluster and interact with k8s services and pods directly. Whoohoo!

kube/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ OVPN_PORT="${OVPN_PORT:-1194}"
2222
if [ ! -d pki ]; then
2323
echo "This script requires a directory named 'pki' in the current working directory, populated with a CA generated by easyrsa"
2424
echo "You can easily generate this. Execute the following command and follow the instructions on screen:"
25-
echo "docker run -e OVPN_SERVER_URL=$serverurl -v $PWD:/etc/openvpn -ti ptlange/openvpn ovpn_initpki"
25+
echo "docker run -e OVPN_SERVER_URL=$serverurl -v $PWD:/etc/openvpn:z -ti ptlange/openvpn ovpn_initpki"
2626
exit 1
2727
fi
2828

0 commit comments

Comments
 (0)