Skip to content

Commit c6c7fca

Browse files
committed
initial commit to add neuropil discovery to fluidos node project
also adds np discovery roles, following file naming layout updates readme.md with updated values.yaml for helm-docs
1 parent d8c594f commit c6c7fca

File tree

5 files changed

+158
-1
lines changed

5 files changed

+158
-1
lines changed

deployments/node/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ A Helm chart for Fluidos Node
4141
| networkManager.pod.labels | object | `{}` | Labels for the network-manager pod. |
4242
| networkManager.pod.resources | object | `{"limits":{},"requests":{}}` | Resource requests and limits (https://kubernetes.io/docs/user-guide/compute-resources/) for the network-manager pod. |
4343
| networkManager.replicas | int | `1` | The number of Network Manager, which can be increased for active/passive high availability. |
44+
| npDiscovery.enabled | bool | `true` | enable the discovery of KnownCluster and Flavors via the neuropil cybersecurity mesh |
45+
| npDiscovery.imageName | string | `"registry.gitlab.com/pi-lar/neuropil-k8s/fluidos_discovery"` | the image to be used (mainly used for testing local changes) |
46+
| npDiscovery.name | string | `"np-fluidos-discovery"` | the name of the np discovery pod / deployment |
47+
| npDiscovery.np_bootstrap_url | string | `"*:udp4:demo.neuropil.io:3400"` | the initial bootstrap url to initiate participation in the mesh structure. Please note: there is no SLA attached to this demo instance, but you may run your own |
4448
| provider | string | `"your-provider"` | |
4549
| pullPolicy | string | `"IfNotPresent"` | The pullPolicy for fluidos-node pods. |
4650
| rearController.imageName | string | `"ghcr.io/fluidos-project/rear-controller"` | |
@@ -78,4 +82,4 @@ A Helm chart for Fluidos Node
7882
| webhook.issuer | string | `"self-signed"` | Configuration for the webhook server. |
7983

8084
----------------------------------------------
81-
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
85+
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
rules:
2+
- apiGroups:
3+
- ""
4+
resources:
5+
- '*'
6+
verbs:
7+
- get
8+
- list
9+
- watch
10+
- apiGroups:
11+
- ""
12+
resources:
13+
- configmaps
14+
verbs:
15+
- get
16+
- list
17+
- watch
18+
- apiGroups:
19+
- network.fluidos.eu
20+
resources:
21+
- knownclusters
22+
verbs:
23+
- create
24+
- get
25+
- patch
26+
- list
27+
- watch
28+
- apiGroups:
29+
- nodecore.fluidos.eu
30+
resources:
31+
- flavors
32+
verbs:
33+
- create
34+
- delete
35+
- get
36+
- list
37+
- patch
38+
- update
39+
- watch
40+
- apiGroups:
41+
- nodecore.fluidos.eu
42+
resources:
43+
- flavors/status
44+
verbs:
45+
- get
46+
- patch
47+
- update
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{ if .Values.npDiscovery.enabled }}
2+
{{- $npDiscoveryConfig := (merge (dict "name" "np-discovery" "module" "np-discovery") .) -}}
3+
apiVersion: apps/v1
4+
kind: Deployment
5+
metadata:
6+
labels:
7+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }}
8+
name: np-fluidos-discovery
9+
namespace: {{ .Release.Namespace }}
10+
spec:
11+
replicas: 1
12+
selector:
13+
matchLabels:
14+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 6 }}
15+
template:
16+
metadata:
17+
{{ if .Values.rearController.pod.annotations }}
18+
annotations:
19+
{{- toYaml .Values.rearController.pod.annotations | nindent 8 }}
20+
{{ end }}
21+
labels:
22+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 8 }}
23+
{{ if .Values.rearController.pod.labels }}
24+
{{ toYaml .Values.rearController.pod.labels | nindent 8 }}
25+
{{ end }}
26+
spec:
27+
{{- if gt .Values.rearController.replicas 1.0 }}
28+
affinity:
29+
podAntiAffinity:
30+
preferredDuringSchedulingIgnoredDuringExecution:
31+
- weight: 100
32+
podAffinityTerm:
33+
labelSelector:
34+
matchLabels:
35+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 18 }}
36+
topologyKey: kubernetes.io/hostname
37+
{{- end }}
38+
securityContext:
39+
{{- include "fluidos.podSecurityContext" $npDiscoveryConfig | nindent 8 }}
40+
serviceAccountName: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
41+
containers:
42+
- image: {{ .Values.npDiscovery.imageName }}
43+
securityContext:
44+
{{- include "fluidos.containerSecurityContext" $npDiscoveryConfig | nindent 10 }}
45+
name: {{ .Values.npDiscovery.name }}
46+
resources: {{- toYaml .Values.rearController.pod.resources | nindent 10 }}
47+
env:
48+
- name: NP_BOOTSTRAP_URL
49+
value: {{ .Values.npDiscovery.np_bootstrap_url | quote }}
50+
{{- if (.Values.common).nodeSelector }}
51+
nodeSelector:
52+
{{- toYaml .Values.common.nodeSelector | nindent 8 }}
53+
{{- end }}
54+
{{- if ((.Values.common).tolerations) }}
55+
tolerations:
56+
{{- toYaml .Values.common.tolerations | nindent 8 }}
57+
{{- end }}
58+
{{- if ((.Values.common).affinity) }}
59+
affinity:
60+
{{- toYaml .Values.common.affinity | nindent 8 }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{ if .Values.npDiscovery.enabled }}
2+
{{- $npDiscoveryConfig := (merge (dict "name" "np-discovery" "module" "np-discovery") .) -}}
3+
4+
apiVersion: v1
5+
kind: ServiceAccount
6+
metadata:
7+
name: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
8+
labels:
9+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }}
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: ClusterRoleBinding
13+
metadata:
14+
name: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
15+
labels:
16+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }}
17+
subjects:
18+
- kind: ServiceAccount
19+
name: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
20+
namespace: {{ .Release.Namespace }}
21+
roleRef:
22+
apiGroup: rbac.authorization.k8s.io
23+
kind: ClusterRole
24+
name: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
25+
---
26+
apiVersion: rbac.authorization.k8s.io/v1
27+
kind: ClusterRole
28+
metadata:
29+
name: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
30+
labels:
31+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }}
32+
{{ .Files.Get (include "fluidos.cluster-role-filename" (dict "prefix" ( include "fluidos.prefixedName" $npDiscoveryConfig )))}}
33+
34+
{{- end }}

deployments/node/values.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,16 @@ rearController:
124124
# -- The target port used by the REAR Gateway service.
125125
targetPort: 3004
126126

127+
npDiscovery:
128+
# -- enable the discovery of KnownCluster and Flavors via the neuropil cybersecurity mesh
129+
enabled: False
130+
# -- the initial bootstrap url to initiate participation in the mesh structure. Please note: there is no SLA attached to this demo instance, but you may run your own
131+
np_bootstrap_url: '*:udp4:demo.neuropil.io:3400'
132+
# -- the name of the np discovery pod / deployment
133+
name: np-fluidos-discovery
134+
# -- the image to be used (mainly used for testing local changes)
135+
imageName: registry.gitlab.com/pi-lar/neuropil-k8s/fluidos_discovery
136+
127137
networkManager:
128138
# -- The number of Network Manager, which can be increased for active/passive high availability.
129139
replicas: 1

0 commit comments

Comments
 (0)