Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconcile peer configs to a secret #212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paddyoneill
Copy link

Relates to #211

Remove the peer config from status, and reconcile to a secret. This implementation creates a secret per wireguard, and adds peer configs as keys. This allows peer configs to be retrieved using kubectl get secret/<wireguard-name>-peer-configs -o jsonpath='{.data.<peer>}'

For example

kubectl get secret/test-vpn-peer-configs -o jsonpath='{.data.my-peer}' | base64 -d
[Interface]
PrivateKey = QIqIVfDK1kZKSmAIdlMbS76zjXBhptHo3FbwxDBeuFw=
Address = 10.8.0.2
DNS = 10.96.0.10, default.svc.cluster.local

[Peer]
PublicKey = yh1ZhiucGz8Jg6NJbfMBR3s28mxBO3LGmHBuZUltegw=
AllowedIPs = 10.8.0.0/24,172.16.0.0/12
EndPoint = 172.16.0.42:51820

* Add function to write peer config to secret

Removes config from peer status object

* Fix peer status update

* Remove duplicate RBAC rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant