Skip to content

Commit 4f68b1e

Browse files
Adapt datasource crds for manila and cinder bundles
1 parent 0d84734 commit 4f68b1e

File tree

8 files changed

+395
-75
lines changed

8 files changed

+395
-75
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
apiVersion: knowledge.cortex/v1alpha1
3+
kind: Datasource
4+
metadata:
5+
name: netapp-aggr-labels-cinder
6+
spec:
7+
operator: cortex-cinder
8+
databaseSecretRef:
9+
name: cortex-cinder-postgres
10+
namespace: {{ .Release.Namespace }}
11+
{{- if .Values.datasources.prometheus.sso.enabled }}
12+
ssoSecretRef:
13+
name: cortex-cinder-prometheus-sso
14+
namespace: {{ .Release.Namespace }}
15+
{{- end }}
16+
type: prometheus
17+
prometheus:
18+
secretRef:
19+
name: cortex-cinder-prometheus
20+
namespace: {{ .Release.Namespace }}
21+
alias: netapp_aggr_labels
22+
query: netapp_aggr_labels
23+
type: netapp_aggregate_labels_metric
24+
---
25+
apiVersion: knowledge.cortex/v1alpha1
26+
kind: Datasource
27+
metadata:
28+
name: netapp-node-cpu-busy-cinder
29+
spec:
30+
operator: cortex-cinder
31+
databaseSecretRef:
32+
name: cortex-cinder-postgres
33+
namespace: {{ .Release.Namespace }}
34+
{{- if .Values.datasources.prometheus.sso.enabled }}
35+
ssoSecretRef:
36+
name: cortex-cinder-prometheus-sso
37+
namespace: {{ .Release.Namespace }}
38+
{{- end }}
39+
type: prometheus
40+
prometheus:
41+
secretRef:
42+
name: cortex-cinder-prometheus
43+
namespace: {{ .Release.Namespace }}
44+
alias: netapp_node_cpu_busy
45+
query: netapp_node_cpu_busy
46+
type: netapp_node_metric
47+
---
48+
apiVersion: knowledge.cortex/v1alpha1
49+
kind: Datasource
50+
metadata:
51+
name: netapp-volume-aggr-labels
52+
spec:
53+
operator: cortex-cinder
54+
databaseSecretRef:
55+
name: cortex-cinder-postgres
56+
namespace: {{ .Release.Namespace }}
57+
{{- if .Values.datasources.prometheus.sso.enabled }}
58+
ssoSecretRef:
59+
name: cortex-cinder-prometheus-sso
60+
namespace: {{ .Release.Namespace }}
61+
{{- end }}
62+
type: prometheus
63+
prometheus:
64+
secretRef:
65+
name: cortex-cinder-prometheus
66+
namespace: {{ .Release.Namespace }}
67+
alias: netapp_volume_aggr_labels
68+
query: netapp_volume_aggr_labels
69+
type: netapp_volume_aggregate_labels_metric
70+
---
71+
apiVersion: knowledge.cortex/v1alpha1
72+
kind: Datasource
73+
metadata:
74+
name: cinder-storage-pools
75+
spec:
76+
operator: cortex-cinder
77+
databaseSecretRef:
78+
name: cortex-cinder-postgres
79+
namespace: {{ .Release.Namespace }}
80+
{{- if .Values.datasources.openstack.sso.enabled }}
81+
ssoSecretRef:
82+
name: cortex-cinder-openstack-sso
83+
namespace: {{ .Release.Namespace }}
84+
{{- end }}
85+
type: openstack
86+
openstack:
87+
secretRef:
88+
name: cortex-cinder-openstack-keystone
89+
namespace: {{ .Release.Namespace }}
90+
type: cinder
91+
cinder:
92+
type: storagePools
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
# Cluster level access is required as the controller manager has no default namespace set.
3+
kind: ClusterRole
4+
metadata:
5+
name: cortex-cinder-knowledge-secret-reader
6+
rules:
7+
- apiGroups: [""]
8+
resources: ["secrets"]
9+
verbs: ["get", "list", "watch"]
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: ClusterRoleBinding
13+
metadata:
14+
name: cortex-cinder-knowledge-secret-reader-binding
15+
subjects:
16+
- kind: ServiceAccount
17+
name: cortex-cinder-knowledge-controller-manager
18+
namespace: {{ .Release.Namespace }}
19+
roleRef:
20+
kind: ClusterRole
21+
name: cortex-cinder-knowledge-secret-reader
22+
apiGroup: rbac.authorization.k8s.io
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: cortex-cinder-postgres
6+
data:
7+
host: {{ .Values.postgres.host | b64enc | quote }}
8+
user: {{ .Values.postgres.user | b64enc | quote }}
9+
password: {{ .Values.postgres.password | b64enc | quote }}
10+
database: {{ .Values.postgres.database | b64enc | quote }}
11+
port: {{ .Values.postgres.port | b64enc | quote }}
12+
---
13+
apiVersion: v1
14+
kind: Secret
15+
metadata:
16+
name: cortex-cinder-prometheus
17+
data:
18+
url: {{ .Values.datasources.prometheus.url | b64enc | quote }}
19+
---
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: cortex-cinder-openstack-keystone
24+
data:
25+
url: {{ .Values.datasources.openstack.url | b64enc | quote }}
26+
availability: {{ .Values.datasources.openstack.availability | b64enc | quote }}
27+
username: {{ .Values.datasources.openstack.username | b64enc | quote }}
28+
password: {{ .Values.datasources.openstack.password | b64enc | quote }}
29+
projectName: {{ .Values.datasources.openstack.projectName | b64enc | quote }}
30+
userDomainName: {{ .Values.datasources.openstack.userDomainName | b64enc | quote }}
31+
projectDomainName: {{ .Values.datasources.openstack.projectDomainName | b64enc | quote }}
32+
{{- if .Values.datasources.prometheus.sso.enabled }}
33+
---
34+
apiVersion: v1
35+
kind: Secret
36+
metadata:
37+
name: cortex-cinder-prometheus-sso
38+
data:
39+
cert: {{ .Values.datasources.prometheus.sso.cert | b64enc | quote }}
40+
key: {{ .Values.datasources.prometheus.sso.key | b64enc | quote }}
41+
selfSigned: {{ .Values.datasources.prometheus.sso.selfSigned | b64enc | quote }}
42+
{{- end }}
43+
{{- if .Values.datasources.openstack.sso.enabled }}
44+
---
45+
apiVersion: v1
46+
kind: Secret
47+
metadata:
48+
name: cortex-cinder-openstack-sso
49+
data:
50+
cert: {{ .Values.datasources.openstack.sso.cert | b64enc | quote }}
51+
key: {{ .Values.datasources.openstack.sso.key | b64enc | quote }}
52+
selfSigned: {{ .Values.datasources.openstack.sso.selfSigned | b64enc | quote }}
53+
{{- end }}

helm/bundles/cortex-cinder/values.yaml

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,47 @@ alerts:
1515
enabled: true
1616
prometheus: openstack
1717

18+
# SSO certificate to use.
19+
sharedSSOCert: &sharedSSOCert
20+
# Certificate "public key". (Optional, remove this key if not needed)
21+
cert: |
22+
-----BEGIN CERTIFICATE-----
23+
Your certificate here
24+
-----END CERTIFICATE-----
25+
# Certificate private key. (Optional, remove this key if not needed)
26+
key: |
27+
-----BEGIN PRIVATE KEY-----
28+
Your private key here
29+
-----END PRIVATE KEY
30+
# Whether the certificate is self-signed.
31+
# If true, the certificate is not verified.
32+
selfSigned: "false"
33+
34+
postgres:
35+
host: cortex-cinder-postgresql
36+
user: postgres
37+
password: secret
38+
database: postgres
39+
port: "5432"
40+
41+
datasources:
42+
prometheus:
43+
url: "https://path-to-your-prometheus"
44+
sso:
45+
enabled: false
46+
<<: *sharedSSOCert
47+
openstack:
48+
url: "https://path-to-keystone/v3"
49+
availability: public
50+
username: openstack-user-with-all-project-read-access
51+
password: openstack-user-password
52+
projectName: openstack-project-of-user
53+
userDomainName: openstack-domain-of-user
54+
projectDomainName: openstack-domain-of-project-scoped-to
55+
sso:
56+
enabled: false
57+
<<: *sharedSSOCert
58+
1859
# Values accessible to all subcharts.
1960
global:
2061
# Values passed to the service through a configmap.
@@ -55,8 +96,6 @@ cortex-kpis:
5596
conf:
5697
kpis:
5798
# Configuration of KPIs that should be extracted from the synced data.
58-
# Each KPI can specify its own dependencies on other extractors and
59-
# synced data.
6099
#
61100
# The `name` should correspond to a known KPI extractor plugin.
62101
plugins: []
@@ -67,34 +106,8 @@ cortex-knowledge-operator:
67106
# Use this to unambiguate multiple cortex deployments in the same cluster.
68107
namePrefix: cortex-cinder
69108
conf:
70-
datasources:
71-
prometheus:
72-
# Prometheus metrics to sync into the database.
73-
# Each metric can be synced from a different Prometheus instance.
74-
# The `type` parameter should map to a known metric model in the database.
75-
metrics:
76-
# NetApp harvest exporter metrics for Cinder storage pools.
77-
- alias: netapp_aggr_labels
78-
query: netapp_aggr_labels
79-
type: netapp_aggregate_labels_metric
80-
- alias: netapp_node_cpu_busy
81-
query: netapp_node_cpu_busy
82-
type: netapp_node_metric
83-
- alias: netapp_volume_aggr_labels
84-
query: netapp_volume_aggr_labels
85-
type: netapp_volume_aggregate_labels_metric
86-
87-
openstack:
88-
cinder:
89-
# One of admin, public, or internal
90-
availability: public
91-
types:
92-
- storage_pools
93-
94109
extractor:
95110
# Configuration of features that should be extracted from the synced data.
96-
# Each extractor can specify its own dependencies on other extractors or
97-
# synced data.
98111
#
99112
# The `name` should correspond to a known feature extractor plugin.
100113
# Note that the order defined here will also be the order in which the
@@ -104,12 +117,6 @@ cortex-knowledge-operator:
104117
# NetApp-specific extractors.
105118
- name: netapp_storage_pool_cpu_usage_extractor
106119
recencySeconds: 60 # 1 minute
107-
dependencies:
108-
datasources:
109-
prometheus:
110-
metrics:
111-
- alias: netapp_node_cpu_busy
112-
- alias: netapp_aggr_labels
113120

114121
cortex-scheduler:
115122
fullnameOverride: cortex-cinder-scheduler
@@ -127,8 +134,6 @@ cortex-scheduler:
127134
# Note: there needs to be at least one pipeline with the name "default".
128135
- name: default
129136
# Configuration of scheduler steps that modify the Cinder scheduler weights.
130-
# Each scheduler step can specify its own dependencies on extractors and
131-
# synced data.
132137
#
133138
# The `name` should correspond to a known scheduler plugin.
134139
plugins: []
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
apiVersion: knowledge.cortex/v1alpha1
3+
kind: Datasource
4+
metadata:
5+
name: netapp-aggr-labels-manila
6+
spec:
7+
operator: cortex-manila
8+
databaseSecretRef:
9+
name: cortex-manila-postgres
10+
namespace: {{ .Release.Namespace }}
11+
{{- if .Values.datasources.prometheus.sso.enabled }}
12+
ssoSecretRef:
13+
name: cortex-manila-prometheus-sso
14+
namespace: {{ .Release.Namespace }}
15+
{{- end }}
16+
type: prometheus
17+
prometheus:
18+
secretRef:
19+
name: cortex-manila-prometheus
20+
namespace: {{ .Release.Namespace }}
21+
alias: netapp_aggr_labels
22+
query: netapp_aggr_labels
23+
type: netapp_aggregate_labels_metric
24+
---
25+
apiVersion: knowledge.cortex/v1alpha1
26+
kind: Datasource
27+
metadata:
28+
name: netapp-node-cpu-busy-manila
29+
spec:
30+
operator: cortex-manila
31+
databaseSecretRef:
32+
name: cortex-manila-postgres
33+
namespace: {{ .Release.Namespace }}
34+
{{- if .Values.datasources.prometheus.sso.enabled }}
35+
ssoSecretRef:
36+
name: cortex-manila-prometheus-sso
37+
namespace: {{ .Release.Namespace }}
38+
{{- end }}
39+
type: prometheus
40+
prometheus:
41+
secretRef:
42+
name: cortex-manila-prometheus
43+
namespace: {{ .Release.Namespace }}
44+
alias: netapp_node_cpu_busy
45+
query: netapp_node_cpu_busy
46+
type: netapp_node_metric
47+
---
48+
apiVersion: knowledge.cortex/v1alpha1
49+
kind: Datasource
50+
metadata:
51+
name: manila-storage-pools
52+
spec:
53+
operator: cortex-manila
54+
databaseSecretRef:
55+
name: cortex-manila-postgres
56+
namespace: {{ .Release.Namespace }}
57+
{{- if .Values.datasources.openstack.sso.enabled }}
58+
ssoSecretRef:
59+
name: cortex-manila-openstack-sso
60+
namespace: {{ .Release.Namespace }}
61+
{{- end }}
62+
type: openstack
63+
openstack:
64+
secretRef:
65+
name: cortex-manila-openstack-keystone
66+
namespace: {{ .Release.Namespace }}
67+
type: manila
68+
manila:
69+
type: storagePools
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
# Cluster level access is required as the controller manager has no default namespace set.
3+
kind: ClusterRole
4+
metadata:
5+
name: cortex-manila-knowledge-secret-reader
6+
rules:
7+
- apiGroups: [""]
8+
resources: ["secrets"]
9+
verbs: ["get", "list", "watch"]
10+
---
11+
apiVersion: rbac.authorization.k8s.io/v1
12+
kind: ClusterRoleBinding
13+
metadata:
14+
name: cortex-manila-knowledge-secret-reader-binding
15+
subjects:
16+
- kind: ServiceAccount
17+
name: cortex-manila-knowledge-controller-manager
18+
namespace: {{ .Release.Namespace }}
19+
roleRef:
20+
kind: ClusterRole
21+
name: cortex-manila-knowledge-secret-reader
22+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)