Skip to content

Commit fa222a4

Browse files
committed
add netbirdio/kubernetes-operator
Signed-off-by: Sebastian Hoß <seb@xn--ho-hia.de>
1 parent 061466d commit fa222a4

File tree

20 files changed

+1086
-0
lines changed

20 files changed

+1086
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-FileCopyrightText: The kube-custom-resources-rs Authors
2+
# SPDX-License-Identifier: 0BSD
3+
4+
name: Release netbird_io
5+
on:
6+
schedule:
7+
- cron: 1 12 * * WED
8+
workflow_dispatch:
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
steps:
15+
- id: checkout
16+
name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
- id: commits
21+
name: Count Commits
22+
run: echo "count=$(git rev-list --count HEAD --since='last Wednesday' -- custom-resources/netbird_io)" >> $GITHUB_OUTPUT
23+
- id: release
24+
name: Create Release Version
25+
if: steps.commits.outputs.count > 0
26+
run: echo "version=1.$(date --utc +'%Y%m%d').$(date --utc +'%-H%M%S')" >> $GITHUB_OUTPUT
27+
- name: Set up Rust
28+
if: steps.commits.outputs.count > 0
29+
uses: dtolnay/rust-toolchain@stable
30+
- name: Install cargo-workspaces
31+
uses: taiki-e/install-action@v2
32+
with:
33+
tool: cargo-edit
34+
- name: Cargo Version
35+
if: steps.commits.outputs.count > 0
36+
run: cargo set-version --package kcr_netbird_io ${{ steps.release.outputs.version }}
37+
- name: Publish to crates.io
38+
if: steps.commits.outputs.count > 0
39+
run: >
40+
cargo publish
41+
--allow-dirty
42+
--token ${{ secrets.CRATES_IO_TOKEN }}
43+
--package kcr_netbird_io
44+
--jobs 1
45+
--no-verify
46+
env:
47+
RUSTFLAGS: "-A warnings"
48+
- id: mail
49+
name: Send Mail
50+
if: steps.commits.outputs.count > 0
51+
uses: dawidd6/action-send-mail@v5
52+
with:
53+
server_address: ${{ secrets.MAIL_SERVER }}
54+
server_port: ${{ secrets.MAIL_PORT }}
55+
username: ${{ secrets.MAIL_USERNAME }}
56+
password: ${{ secrets.MAIL_PASSWORD }}
57+
subject: ${{ github.event.repository.name }}/netbird_io version ${{ steps.release.outputs.version }} published
58+
body: See ${{ steps.create_release.outputs.url }} for details.
59+
to: ${{ secrets.MAIL_RECIPIENT }}
60+
from: ${{ secrets.MAIL_SENDER }}
61+
- id: matrix
62+
name: Send Matrix Message
63+
if: steps.commits.outputs.count > 0
64+
uses: s3krit/matrix-message-action@v0.0.3
65+
with:
66+
room_id: ${{ secrets.MATRIX_ROOM_ID }}
67+
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
68+
message: ${{ github.event.repository.name }}/netbird_io version [${{ steps.release.outputs.version }}](${{ steps.create_release.outputs.url }}) published
69+
server: ${{ secrets.MATRIX_SERVER }}

.reuse/dep5

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,10 @@ Files: crd-catalog/NetApp/trident/*
10191019
Copyright: The NetApp/trident Authors
10201020
License: Apache-2.0
10211021

1022+
Files: crd-catalog/netbirdio/kubernetes-operator/*
1023+
Copyright: The netbirdio/kubernetes-operator Authors
1024+
License: BSD-3-Clause
1025+
10221026
Files: crd-catalog/netobserv/network-observability-operator/*
10231027
Copyright: The netobserv/network-observability-operator Authors
10241028
License: Apache-2.0

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ members = [
260260
"custom-resources/multicluster_x_k8s_io",
261261
"custom-resources/mutations_gatekeeper_sh",
262262
"custom-resources/nativestor_alauda_io",
263+
"custom-resources/netbird_io",
263264
"custom-resources/netchecks_io",
264265
"custom-resources/networkfirewall_services_k8s_aws",
265266
"custom-resources/networking_gke_io",

LICENSES/BSD-3-Clause.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) <year>, <owner>
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice, this
9+
list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
15+
3. Neither the name of the copyright holder nor the names of its
16+
contributors may be used to endorse or promote products derived from
17+
this software without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ The following groups are available:
300300
- [multicluster.x-k8s.io](https://crates.io/crates/kcr_multicluster_x_k8s_io)
301301
- [mutations.gatekeeper.sh](https://crates.io/crates/kcr_mutations_gatekeeper_sh)
302302
- [nativestor.alauda.io](https://crates.io/crates/kcr_nativestor_alauda_io)
303+
- [netbird.io](https://crates.io/crates/kcr_netbird_io)
303304
- [netchecks.io](https://crates.io/crates/kcr_netchecks_io)
304305
- [networkfirewall.services.k8s.aws](https://crates.io/crates/kcr_networkfirewall_services_k8s_aws)
305306
- [networking.gke.io](https://crates.io/crates/kcr_networking_gke_io)

code-generator/src/catalog.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2784,6 +2784,18 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[
27842784
],
27852785
ignores: &[],
27862786
},
2787+
UpstreamSource {
2788+
project_name: "netbirdio/kubernetes-operator",
2789+
license: BSD3,
2790+
urls: &[
2791+
"https://github.com/netbirdio/kubernetes-operator/blob/main/crds/netbird.io_nbgroups.yaml",
2792+
"https://github.com/netbirdio/kubernetes-operator/blob/main/crds/netbird.io_nbpolicies.yaml",
2793+
"https://github.com/netbirdio/kubernetes-operator/blob/main/crds/netbird.io_nbresources.yaml",
2794+
"https://github.com/netbirdio/kubernetes-operator/blob/main/crds/netbird.io_nbroutingpeers.yaml",
2795+
"https://github.com/netbirdio/kubernetes-operator/blob/main/crds/netbird.io_nbsetupkeys.yaml",
2796+
],
2797+
ignores: &[],
2798+
},
27872799
UpstreamSource {
27882800
project_name: "netobserv/network-observability-operator",
27892801
license: APACHE_V2,
@@ -3881,3 +3893,4 @@ const MPL_V2: &'static str = "MPL-2.0";
38813893
const KUBEMOD: &'static str = "LicenseRef-Kubemod";
38823894
const HASHICORP: &'static str = "LicenseRef-HashiCorp";
38833895
const OSL_V3: &'static str = "OSL-3.0";
3896+
const BSD3: &'static str = "BSD-3-Clause";
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
apiVersion: "apiextensions.k8s.io/v1"
2+
kind: "CustomResourceDefinition"
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: "v0.17.1"
6+
name: "nbgroups.netbird.io"
7+
spec:
8+
group: "netbird.io"
9+
names:
10+
kind: "NBGroup"
11+
listKind: "NBGroupList"
12+
plural: "nbgroups"
13+
singular: "nbgroup"
14+
scope: "Namespaced"
15+
versions:
16+
- name: "v1"
17+
schema:
18+
openAPIV3Schema:
19+
description: "NBGroup is the Schema for the nbgroups API."
20+
properties:
21+
apiVersion:
22+
description: "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
23+
type: "string"
24+
kind:
25+
description: "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
26+
type: "string"
27+
metadata:
28+
type: "object"
29+
spec:
30+
description: "NBGroupSpec defines the desired state of NBGroup."
31+
properties:
32+
name:
33+
minLength: 1
34+
type: "string"
35+
x-kubernetes-validations:
36+
- message: "Value is immutable"
37+
rule: "self == oldSelf"
38+
required:
39+
- "name"
40+
type: "object"
41+
status:
42+
description: "NBGroupStatus defines the observed state of NBGroup."
43+
properties:
44+
conditions:
45+
items:
46+
description: "NBCondition defines a condition in NBSetupKey status."
47+
properties:
48+
lastProbeTime:
49+
description: "Last time we probed the condition."
50+
format: "date-time"
51+
type: "string"
52+
lastTransitionTime:
53+
description: "Last time the condition transitioned from one status to another."
54+
format: "date-time"
55+
type: "string"
56+
message:
57+
description: "Human-readable message indicating details about last transition."
58+
type: "string"
59+
reason:
60+
description: "Unique, one-word, CamelCase reason for the condition's last transition."
61+
type: "string"
62+
status:
63+
description: "Status is the status of the condition.\nCan be True, False, Unknown."
64+
type: "string"
65+
type:
66+
description: "Type is the type of the condition."
67+
type: "string"
68+
required:
69+
- "status"
70+
- "type"
71+
type: "object"
72+
type: "array"
73+
groupID:
74+
type: "string"
75+
type: "object"
76+
type: "object"
77+
served: true
78+
storage: true
79+
subresources:
80+
status: {}
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
apiVersion: "apiextensions.k8s.io/v1"
2+
kind: "CustomResourceDefinition"
3+
metadata:
4+
annotations:
5+
controller-gen.kubebuilder.io/version: "v0.17.1"
6+
name: "nbpolicies.netbird.io"
7+
spec:
8+
group: "netbird.io"
9+
names:
10+
kind: "NBPolicy"
11+
listKind: "NBPolicyList"
12+
plural: "nbpolicies"
13+
singular: "nbpolicy"
14+
scope: "Cluster"
15+
versions:
16+
- name: "v1"
17+
schema:
18+
openAPIV3Schema:
19+
description: "NBPolicy is the Schema for the nbpolicies API."
20+
properties:
21+
apiVersion:
22+
description: "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources"
23+
type: "string"
24+
kind:
25+
description: "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
26+
type: "string"
27+
metadata:
28+
type: "object"
29+
spec:
30+
description: "NBPolicySpec defines the desired state of NBPolicy."
31+
properties:
32+
bidirectional:
33+
default: true
34+
type: "boolean"
35+
description:
36+
type: "string"
37+
destinationGroups:
38+
items:
39+
minLength: 1
40+
type: "string"
41+
type: "array"
42+
name:
43+
description: "Name Policy name"
44+
minLength: 1
45+
type: "string"
46+
ports:
47+
items:
48+
format: "int32"
49+
maximum: 65535.0
50+
minimum: 0.0
51+
type: "integer"
52+
type: "array"
53+
protocols:
54+
items:
55+
enum:
56+
- "tcp"
57+
- "udp"
58+
type: "string"
59+
type: "array"
60+
sourceGroups:
61+
items:
62+
minLength: 1
63+
type: "string"
64+
type: "array"
65+
required:
66+
- "name"
67+
type: "object"
68+
status:
69+
description: "NBPolicyStatus defines the observed state of NBPolicy."
70+
properties:
71+
conditions:
72+
items:
73+
description: "NBCondition defines a condition in NBSetupKey status."
74+
properties:
75+
lastProbeTime:
76+
description: "Last time we probed the condition."
77+
format: "date-time"
78+
type: "string"
79+
lastTransitionTime:
80+
description: "Last time the condition transitioned from one status to another."
81+
format: "date-time"
82+
type: "string"
83+
message:
84+
description: "Human-readable message indicating details about last transition."
85+
type: "string"
86+
reason:
87+
description: "Unique, one-word, CamelCase reason for the condition's last transition."
88+
type: "string"
89+
status:
90+
description: "Status is the status of the condition.\nCan be True, False, Unknown."
91+
type: "string"
92+
type:
93+
description: "Type is the type of the condition."
94+
type: "string"
95+
required:
96+
- "status"
97+
- "type"
98+
type: "object"
99+
type: "array"
100+
lastUpdatedAt:
101+
format: "date-time"
102+
type: "string"
103+
managedServiceList:
104+
items:
105+
type: "string"
106+
type: "array"
107+
tcpPolicyID:
108+
type: "string"
109+
udpPolicyID:
110+
type: "string"
111+
type: "object"
112+
type: "object"
113+
served: true
114+
storage: true
115+
subresources:
116+
status: {}

0 commit comments

Comments
 (0)