pkg/k8s/apis: support for preshared keys in peers

This commit adds support for defining preshared keys when declaring a
new Peer CRD. This preshared key will be used whenever the nodes in the
Kilo mesh communicate with that peer.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
Lucas Servén Marín
2020-05-05 11:36:39 +02:00
parent e4829832c5
commit 0a10dc921c
9 changed files with 64 additions and 9 deletions

View File

@@ -304,9 +304,16 @@ func schema_k8s_apis_kilo_v1alpha1_PeerSpec(ref common.ReferenceCallback) common
Format: "int32",
},
},
"presharedKey": {
SchemaProps: spec.SchemaProps{
Description: "PresharedKey is the optional symmetric encryption key for the peer.",
Type: []string{"string"},
Format: "",
},
},
"publicKey": {
SchemaProps: spec.SchemaProps{
Description: "PublicKey is the WireGuard public key for the node.",
Description: "PublicKey is the WireGuard public key for the peer.",
Type: []string{"string"},
Format: "",
},

View File

@@ -72,7 +72,10 @@ type PeerSpec struct {
// disables the feature.
// +optional
PersistentKeepalive int `json:"persistentKeepalive,omitempty"`
// PublicKey is the WireGuard public key for the node.
// PresharedKey is the optional symmetric encryption key for the peer.
// +optional
PresharedKey string `json:"presharedKey"`
// PublicKey is the WireGuard public key for the peer.
PublicKey string `json:"publicKey"`
}