Skip to content

Commit ba45c45

Browse files
committed
Create clusterRole only on request
1 parent a1c8051 commit ba45c45

File tree

5 files changed

+27
-17
lines changed

5 files changed

+27
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,6 @@ kubectl create secret generic cb-ingestion-token \
132132
--from-literal=INGESTION_API_TOKEN=hahaha \
133133
-n cloudbolt-collector
134134

135-
helm upgrade --install cloudbolt-collector ./ -f values.yaml --namespace cloudbolt-collector --create-namespace --set INGESTION_API_URL=$INGESTION_API_URL --set prometheusBaseUrl=$PROMETHEUS_BASE_URL --set coreapiBaseUrl=$COREAPI_BASE_URL --set DEBUG=true
135+
helm upgrade --install cloudbolt-collector ./ -f values.yaml --namespace cloudbolt-collector --create-namespace --set INGESTION_API_URL=$INGESTION_API_URL --set prometheusBaseUrl=$PROMETHEUS_BASE_URL --set coreapiBaseUrl=$COREAPI_BASE_URL --set DEBUG=true --set clusterRole.create=true
136136

137137
helm upgrade --install cloudbolt-collector ./ -f values.yaml --namespace cloudbolt-collector --create-namespace --set INGESTION_API_URL="https://c1i3z7ha68.execute-api.us-west-2.amazonaws.com/v1/data-ingest-api-dev-v1" --set DEBUG=true

templates/clusterrole-nodes.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

templates/clusterrole-pv.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

templates/clusterrolebinding.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,27 @@
1+
{{/* ClusterRoles don't seem to be required on OpenShift */}}
2+
{{- if .Values.clusterRole.create -}}
3+
---
4+
apiVersion: rbac.authorization.k8s.io/v1
5+
kind: ClusterRole
6+
metadata:
7+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-nodes-access
8+
rules:
9+
- apiGroups: [""]
10+
resources: ["nodes"]
11+
verbs: ["get", "list"]
12+
---
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: ClusterRole
15+
metadata:
16+
name: {{ include "cloudbolt-collector-helm.fullname" . }}-pv-access
17+
rules:
18+
- apiGroups: [""]
19+
resources: ["persistentvolumes"]
20+
verbs: ["get", "list"]
21+
{{ end }}
22+
123
{{- if .Values.serviceAccount.create -}}
24+
---
225
kind: ClusterRoleBinding
326
apiVersion: rbac.authorization.k8s.io/v1
427
metadata:

values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ INGESTION_API_URL: ""
1010
prometheusBaseUrl: ""
1111
coreapiBaseUrl: ""
1212

13+
clusterRole:
14+
# Set to true to create a ClusterRoles for the collector
15+
create: false
1316
image:
1417
repository: cloudboltsoftware/cloudbolt-collector
1518
pullPolicy: Always

0 commit comments

Comments
 (0)