Skip to content

Commit 6372447

Browse files
authored
Merge pull request #1 from pi-lar/add_neuropil_fluidos_discovery
add neuropil fluidos discovery
2 parents d8c594f + fe14b20 commit 6372447

File tree

4 files changed

+149
-0
lines changed

4 files changed

+149
-0
lines changed
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ rearController:
124124
# -- The target port used by the REAR Gateway service.
125125
targetPort: 3004
126126

127+
npDiscovery:
128+
enabled: false
129+
name: np-fluidos-discovery
130+
imageName: registry.gitlab.com/pi-lar/neuropil-k8s/fluidos_discovery
131+
np_bootstrap_url: '*:udp4:demo.neuropil.io:3400'
132+
127133
networkManager:
128134
# -- The number of Network Manager, which can be increased for active/passive high availability.
129135
replicas: 1

0 commit comments

Comments
 (0)