Skip to content

Commit fe14b20

Browse files
committed
add np discovery roles, follow file naming layout
1 parent 789d29c commit fe14b20

File tree

3 files changed

+89
-9
lines changed

3 files changed

+89
-9
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

deployments/node/templates/fluidos-np-discovery.yaml renamed to deployments/node/templates/fluidos-np-discovery-deployment.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
{{ if .Values.npDiscovery.enabled }}
2-
{{- $rearControllerConfig := (merge (dict "name" "rear-controller" "module" "rear-controller") .) -}}
2+
{{- $npDiscoveryConfig := (merge (dict "name" "np-discovery" "module" "np-discovery") .) -}}
33
apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
labels:
7-
{{- include "fluidos.labels" $rearControllerConfig | nindent 4 }}
7+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 4 }}
88
name: np-fluidos-discovery
99
namespace: {{ .Release.Namespace }}
1010
spec:
1111
replicas: 1
1212
selector:
1313
matchLabels:
14-
{{- include "fluidos.labels" $rearControllerConfig | nindent 6 }}
14+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 6 }}
1515
template:
1616
metadata:
1717
{{ if .Values.rearController.pod.annotations }}
1818
annotations:
1919
{{- toYaml .Values.rearController.pod.annotations | nindent 8 }}
2020
{{ end }}
2121
labels:
22-
{{- include "fluidos.labels" $rearControllerConfig | nindent 8 }}
22+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 8 }}
2323
{{ if .Values.rearController.pod.labels }}
2424
{{ toYaml .Values.rearController.pod.labels | nindent 8 }}
2525
{{ end }}
@@ -32,17 +32,16 @@ spec:
3232
podAffinityTerm:
3333
labelSelector:
3434
matchLabels:
35-
{{- include "fluidos.labels" $rearControllerConfig | nindent 18 }}
35+
{{- include "fluidos.labels" $npDiscoveryConfig | nindent 18 }}
3636
topologyKey: kubernetes.io/hostname
3737
{{- end }}
3838
securityContext:
39-
{{- include "fluidos.podSecurityContext" $rearControllerConfig | nindent 8 }}
40-
serviceAccountName: {{ include "fluidos.prefixedName" $rearControllerConfig }}
39+
{{- include "fluidos.podSecurityContext" $npDiscoveryConfig | nindent 8 }}
40+
serviceAccountName: {{ include "fluidos.prefixedName" $npDiscoveryConfig }}
4141
containers:
4242
- image: {{ .Values.npDiscovery.imageName }}
43-
imagePullPolicy: {{ .Values.pullPolicy }}
4443
securityContext:
45-
{{- include "fluidos.containerSecurityContext" $rearControllerConfig | nindent 10 }}
44+
{{- include "fluidos.containerSecurityContext" $npDiscoveryConfig | nindent 10 }}
4645
name: {{ .Values.npDiscovery.name }}
4746
resources: {{- toYaml .Values.rearController.pod.resources | nindent 10 }}
4847
env:
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 }}

0 commit comments

Comments
 (0)