Skip to content

Commit 35173e0

Browse files
achetronicjodevsa
authored andcommitted
fix: Change apiversion to canonical one (#93)
BREAKING CHANGE
1 parent 762d87d commit 35173e0

36 files changed

+126
-241
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
5353
# This variable is used to construct full image tags for bundle and catalog images.
5454
#
5555
# For example, running 'make bundle-build bundle-push catalog-build catalog-push' will build and push both
56-
# example.com/manager-bundle:$VERSION and example.com/manager-catalog:$VERSION.
56+
# wireguard-operator.io/manager-bundle:$VERSION and wireguard-operator.io/manager-catalog:$VERSION.
5757
IMAGE_TAG_BASE ?= ghcr.io/jodevsa/wireguard-operator
5858

5959
# BUNDLE_IMG defines the image:tag used for the bundle.

PROJECT

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
domain: example.com
1+
domain: wireguard-operator.io
22
layout:
33
- go.kubebuilder.io/v3
44
plugins:
@@ -11,7 +11,7 @@ resources:
1111
crdVersion: v1
1212
namespaced: true
1313
controller: true
14-
domain: example.com
14+
domain: wireguard-operator.io
1515
group: vpn
1616
kind: Wireguard
1717
path: github.com/jodevsa/wireguard-operator/api/v1alpha1
@@ -20,7 +20,7 @@ resources:
2020
crdVersion: v1
2121
namespaced: true
2222
controller: true
23-
domain: example.com
23+
domain: wireguard-operator.io
2424
group: vpn
2525
kind: WireguardPeer
2626
path: github.com/jodevsa/wireguard-operator/api/v1alpha1

README.md

Lines changed: 35 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
2-
3-
# Wireguard operator
1+
# Wireguard Operator
42
<img width="1394" alt="Screenshot 2022-02-26 at 02 05 29" src="https://user-images.githubusercontent.com/14154314/177223431-445fbbb1-ff5b-4fd5-86b3-850b81f0a98f.png">
53

6-
painless deployment of wireguard on kubernetes
4+
Painless deployment of wireguard on kubernetes
5+
6+
## Support and discussions
77

8-
# Support and discussions
8+
If you are facing any problems please open an [issue](https://github.com/jodevsa/wireguard-operator/issues) or start a
9+
[discussion](https://github.com/jodevsa/wireguard-operator/discussions)
910

10-
If you are facing any problems please open an [issue](https://github.com/jodevsa/wireguard-operator/issues) or start a [discussion](https://github.com/jodevsa/wireguard-operator/discussions)
11-
# Tested with
11+
## Tested with
1212
- [x] IBM Cloud Kubernetes Service
1313
- [x] Gcore Labs KMP
1414
* requires `spec.enableIpForwardOnPodInit: true`
@@ -22,52 +22,53 @@ If you are facing any problems please open an [issue](https://github.com/jodevsa
2222
- [ ] Azure Kubernetes Service
2323
- [ ] ...?
2424

25-
# Architecture
25+
## Architecture
2626

2727
![alt text](./readme/main.png)
28-
# Features
28+
29+
## Features
2930
* Falls back to userspace implementation of wireguard [wireguard-go](https://github.com/WireGuard/wireguard-go) if wireguard kernal module is missing
3031
* Automatic key generation
3132
* Automatic IP allocation
3233
* Does not need persistance. peer/server keys are stored as k8s secrets and loaded into the wireguard pod
3334
* Exposes a metrics endpoint by utilizing [prometheus_wireguard_exporter](https://github.com/MindFlavor/prometheus_wireguard_exporter)
3435

35-
# Example
36+
## Example
37+
38+
### Server
3639

37-
## server
3840
```
39-
apiVersion: vpn.example.com/v1alpha1
41+
apiVersion: vpn.wireguard-operator.io/v1alpha1
4042
kind: Wireguard
4143
metadata:
4244
name: "my-cool-vpn"
4345
spec:
4446
mtu: "1380"
4547
```
4648

47-
48-
## peer
49+
### Peer
4950

5051
```
51-
apiVersion: vpn.example.com/v1alpha1
52+
apiVersion: vpn.wireguard-operator.io/v1alpha1
5253
kind: WireguardPeer
5354
metadata:
5455
name: peer1
5556
spec:
5657
wireguardRef: "my-cool-vpn"
57-
5858
```
5959

60+
#### Peer configuration
6061

62+
Peer configuration can be retrieved using the following command:
6163

62-
### Peer configuration
63-
64-
Peer configuration can be retreived using the following command
65-
#### command:
66-
```
64+
```console
6765
kubectl get wireguardpeer peer1 --template={{.status.config}} | bash
6866
```
69-
#### output:
70-
```
67+
68+
After executing it, something similar to the following will be shown. Use this config snippet to configure your
69+
preferred Wireguard client:
70+
71+
```console
7172
[Interface]
7273
PrivateKey = WOhR7uTMAqmZamc1umzfwm8o4ZxLdR5LjDcUYaW/PH8=
7374
Address = 10.8.0.3
@@ -80,15 +81,21 @@ AllowedIPs = 0.0.0.0/0
8081
Endpoint = 32.121.45.102:51820
8182
```
8283

83-
84-
# installation:
84+
## How to deploy
8585
```
8686
kubectl apply -f https://github.com/jodevsa/wireguard-operator/releases/download/v1.2.20/release.yaml
8787
```
8888

89-
90-
91-
# uninstall
89+
## How to remove
9290
```
9391
kubectl delete -f https://github.com/jodevsa/wireguard-operator/releases/download/v1.2.20/release.yaml
9492
```
93+
94+
## How to collaborate
95+
96+
This project is done on top of [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder), so read about that project
97+
before collaborating. Of course, we are open to external collaborations for this project. For doing it you must fork the
98+
repository, make your changes to the code and open a PR. The code will be reviewed and tested (always)
99+
100+
> We are developers and hate bad code. For that reason we ask you the highest quality on each line of code to improve
101+
> this project on each iteration.

bundle/manifests/vpn.example.com_wireguardpeers.yaml renamed to bundle/manifests/vpn.wireguard-operator.io_wireguardpeers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.7.0
66
creationTimestamp: null
7-
name: wireguardpeers.vpn.example.com
7+
name: wireguardpeers.vpn.wireguard-operator.io
88
spec:
9-
group: vpn.example.com
9+
group: vpn.wireguard-operator.io
1010
names:
1111
kind: WireguardPeer
1212
listKind: WireguardPeerList

bundle/manifests/vpn.example.com_wireguards.yaml renamed to bundle/manifests/vpn.wireguard-operator.io_wireguards.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ metadata:
44
annotations:
55
controller-gen.kubebuilder.io/version: v0.7.0
66
creationTimestamp: null
7-
name: wireguards.vpn.example.com
7+
name: wireguards.vpn.wireguard-operator.io
88
spec:
9-
group: vpn.example.com
9+
group: vpn.wireguard-operator.io
1010
names:
1111
kind: Wireguard
1212
listKind: WireguardList

bundle/manifests/wireguard-manager-config_v1_configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ data:
1111
port: 9443
1212
leaderElection:
1313
leaderElect: true
14-
resourceName: a6d3bffc.example.com
14+
resourceName: a6d3bffc.wireguard-operator.io
1515
kind: ConfigMap
1616
metadata:
1717
name: wireguard-manager-config

bundle/manifests/wireguard-operator.clusterserviceversion.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ metadata:
55
alm-examples: |-
66
[
77
{
8-
"apiVersion": "vpn.example.com/v1alpha1",
8+
"apiVersion": "vpn.wireguard-operator.io/v1alpha1",
99
"kind": "Wireguard",
1010
"metadata": {
1111
"name": "wireguard-sample"
1212
},
1313
"spec": null
1414
},
1515
{
16-
"apiVersion": "vpn.example.com/v1alpha1",
16+
"apiVersion": "vpn.wireguard-operator.io/v1alpha1",
1717
"kind": "WireguardPeer",
1818
"metadata": {
1919
"name": "wireguardpeer-sample"
@@ -33,12 +33,12 @@ spec:
3333
- description: WireguardPeer is the Schema for the wireguardpeers API
3434
displayName: Wireguard Peer
3535
kind: WireguardPeer
36-
name: wireguardpeers.vpn.example.com
36+
name: wireguardpeers.vpn.wireguard-operator.io
3737
version: v1alpha1
3838
- description: Wireguard is the Schema for the wireguards API
3939
displayName: Wireguard
4040
kind: Wireguard
41-
name: wireguards.vpn.example.com
41+
name: wireguards.vpn.wireguard-operator.io
4242
version: v1alpha1
4343
description: op
4444
displayName: wireguard
@@ -122,7 +122,7 @@ spec:
122122
- update
123123
- watch
124124
- apiGroups:
125-
- vpn.example.com
125+
- vpn.wireguard-operator.io
126126
resources:
127127
- wireguardpeers
128128
verbs:
@@ -134,21 +134,21 @@ spec:
134134
- update
135135
- watch
136136
- apiGroups:
137-
- vpn.example.com
137+
- vpn.wireguard-operator.io
138138
resources:
139139
- wireguardpeers/finalizers
140140
verbs:
141141
- update
142142
- apiGroups:
143-
- vpn.example.com
143+
- vpn.wireguard-operator.io
144144
resources:
145145
- wireguardpeers/status
146146
verbs:
147147
- get
148148
- patch
149149
- update
150150
- apiGroups:
151-
- vpn.example.com
151+
- vpn.wireguard-operator.io
152152
resources:
153153
- wireguards
154154
verbs:
@@ -160,13 +160,13 @@ spec:
160160
- update
161161
- watch
162162
- apiGroups:
163-
- vpn.example.com
163+
- vpn.wireguard-operator.io
164164
resources:
165165
- wireguards/finalizers
166166
verbs:
167167
- update
168168
- apiGroups:
169-
- vpn.example.com
169+
- vpn.wireguard-operator.io
170170
resources:
171171
- wireguards/status
172172
verbs:

cmd/manager/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ func main() {
7676
Port: 9443,
7777
HealthProbeBindAddress: probeAddr,
7878
LeaderElection: enableLeaderElection,
79-
LeaderElectionID: "a6d3bffc.example.com",
79+
LeaderElectionID: "a6d3bffc.wireguard-operator.io",
8080
})
8181
if err != nil {
8282
setupLog.Error(err, "unable to start manager")

config/crd/bases/vpn.example.com_wireguardpeers.yaml renamed to config/crd/bases/vpn.wireguard-operator.io_wireguardpeers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.8.0
77
creationTimestamp: null
8-
name: wireguardpeers.vpn.example.com
8+
name: wireguardpeers.vpn.wireguard-operator.io
99
spec:
10-
group: vpn.example.com
10+
group: vpn.wireguard-operator.io
1111
names:
1212
kind: WireguardPeer
1313
listKind: WireguardPeerList

config/crd/bases/vpn.example.com_wireguards.yaml renamed to config/crd/bases/vpn.wireguard-operator.io_wireguards.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.8.0
77
creationTimestamp: null
8-
name: wireguards.vpn.example.com
8+
name: wireguards.vpn.wireguard-operator.io
99
spec:
10-
group: vpn.example.com
10+
group: vpn.wireguard-operator.io
1111
names:
1212
kind: Wireguard
1313
listKind: WireguardList

config/crd/kustomization.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# since it depends on service name and namespace that are out of this kustomize package.
33
# It should be run by config/default
44
resources:
5-
- bases/vpn.example.com_wireguardpeers.yaml
6-
- bases/vpn.example.com_wireguards.yaml
5+
- bases/vpn.wireguard-operator.io_wireguardpeers.yaml
6+
- bases/vpn.wireguard-operator.io_wireguards.yaml
77
#+kubebuilder:scaffold:crdkustomizeresource
88

99
patchesStrategicMerge:

config/crd/patches/cainjection_in_wireguardpeers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
7-
name: wireguardpeers.vpn.example.com
7+
name: wireguardpeers.vpn.wireguard-operator.io

config/crd/patches/cainjection_in_wireguards.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ kind: CustomResourceDefinition
44
metadata:
55
annotations:
66
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
7-
name: wireguards.vpn.example.com
7+
name: wireguards.vpn.wireguard-operator.io

config/crd/patches/webhook_in_wireguardpeers.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
5-
name: wireguardpeers.vpn.example.com
5+
name: wireguardpeers.vpn.wireguard-operator.io
66
spec:
77
conversion:
88
strategy: Webhook

config/crd/patches/webhook_in_wireguards.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
5-
name: wireguards.vpn.example.com
5+
name: wireguards.vpn.wireguard-operator.io
66
spec:
77
conversion:
88
strategy: Webhook

config/manager/controller_manager_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ webhook:
88
port: 9443
99
leaderElection:
1010
leaderElect: true
11-
resourceName: a6d3bffc.example.com
11+
resourceName: a6d3bffc.wireguard-operator.io

config/manifests/bases/wireguard-operator.clusterserviceversion.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ spec:
1313
- description: WireguardPeer is the Schema for the wireguardpeers API
1414
displayName: Wireguard Peer
1515
kind: WireguardPeer
16-
name: wireguardpeers.vpn.example.com
16+
name: wireguardpeers.vpn.wireguard-operator.io
1717
version: v1alpha1
1818
- description: Wireguard is the Schema for the wireguards API
1919
displayName: Wireguard
2020
kind: Wireguard
21-
name: wireguards.vpn.example.com
21+
name: wireguards.vpn.wireguard-operator.io
2222
version: v1alpha1
2323
description: op
2424
displayName: wireguard

0 commit comments

Comments
 (0)