Skip to content

Commit f147b33

Browse files
authored
Add example steps (#10)
1 parent b8b268e commit f147b33

File tree

3 files changed

+38
-16
lines changed

3 files changed

+38
-16
lines changed

README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,23 @@ This operator easily provides NetBird access on Kubernetes clusters, allowing us
2626
```sh
2727
helm repo add netbirdio https://netbirdio.github.io/kubernetes-operator
2828
```
29-
2. (Recommended) Install [cert-manager](https://cert-manager.io/docs/installation/#default-static-install).
30-
3. (Recommended) Create a values.yaml file, check `helm show values netbirdio/kubernetes-operator` for more info.
31-
4. Install using `helm install --create-namespace -f values.yaml -n netbird netbird-operator netbirdio/kubernetes-operator`.
29+
2. (Recommended) Install [cert-manager](https://cert-manager.io/docs/installation/#default-static-install) for k8s API to communicate with the NetBird operator.
30+
```sh
31+
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.0/cert-manager.yaml
32+
```
33+
3. Add NetBird API token
34+
```shell
35+
kubectl create namespace netbird
36+
kubectl -n netbird create secret generic netbird-mgmt-api-key --from-literal=NB_API_KEY=$(cat ~/nb-pat.secret)
37+
```
38+
4. (Recommended) Create a [`values.yaml`](examples/ingress/values.yaml) file, check `helm show values netbirdio/kubernetes-operator` for more info.
39+
5. Install using `helm install --create-namespace -f values.yaml -n netbird netbird-operator netbirdio/kubernetes-operator`.
40+
6. (Recommended) Check pod status using `kubectl get pods -n netbird`.
41+
6. (Optional) Create an [`exposed-nginx.yaml`](examples/ingress/exposed-nginx.yaml) file to create a Nginx service for testing.
42+
7. (Optional) Apply the Nginx service:
43+
```sh
44+
kubectl apply -f exposed-nginx.yaml
45+
```
3246

3347
> Learn more about the values.yaml options [here](helm/kubernetes-operator/values.yaml) and [Granting controller access to NetBird Management](docs/usage.md#granting-controller-access-to-netbird-management).
3448
#### Using install.yaml

examples/ingress/exposed-nginx.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
labels:
5-
app: test
6-
name: test
5+
app: nginx
6+
name: nginx
77
namespace: default
88
spec:
99
replicas: 1
1010
selector:
1111
matchLabels:
12-
app: test
12+
app: nginx
1313
strategy:
1414
rollingUpdate:
1515
maxSurge: 25%
@@ -18,7 +18,7 @@ spec:
1818
template:
1919
metadata:
2020
labels:
21-
app: test
21+
app: nginx
2222
spec:
2323
containers:
2424
- image: nginx
@@ -32,9 +32,10 @@ metadata:
3232
netbird.io/expose: "true"
3333
netbird.io/policy: default
3434
netbird.io/resource-name: nginx
35+
netbird.io/groups: nginx-k8s-gke
3536
labels:
36-
app: test
37-
name: test
37+
app: nginx
38+
name: nginx
3839
namespace: default
3940
spec:
4041
ports:
@@ -43,5 +44,5 @@ spec:
4344
protocol: TCP
4445
targetPort: 80
4546
selector:
46-
app: test
47+
app: nginx
4748
type: ClusterIP

examples/ingress/values.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1+
#operator:
2+
# image:
3+
# tag: "0.1.0"
14
ingress:
25
enabled: true
36
router:
47
enabled: true
5-
policies:
6-
default:
7-
name: Kubernetes Default Policy
8-
sourceGroups:
9-
- All
8+
# policies:
9+
# default:
10+
# name: Kubernetes Default Policy
11+
# sourceGroups:
12+
# - All
1013

1114
netbirdAPI:
12-
key: "nbp_m0LM9ZZvDUzFO0pY50iChDOTxJgKFM3DIqmZ" # Replace with valid NetBird Service Account token
15+
# Replace with valid NetBird Service Account token (PAT)
16+
# https://docs.netbird.io/how-to/access-netbird-public-api#creating-an-access-token
17+
#key: "nbp_m0LM9yZvDUzF8fpY20iChDOTxJgKFM3DIqmZ"
18+
# Use keyFromSecret instead of plain text secret
19+
keyFromSecret: "netbird-mgmt-api-key"

0 commit comments

Comments
 (0)