
When applying the rook ceph some warnings regarding the nodePort and the password were showing up due to them not being specified on the resources.yaml Added the nodePort and the password to the resources.yaml and specified their description and type. Test plan: - PASS: Enable the ceph dashboard - PASS: Apply the rook-ceph application - PASS: Check the helm controller logs - PASS: There must not be any warning regarding the fields - PASS: Access the https://<floating_ip>:30443 - PASS: Check if the dashboard is being correctly launched Closes-bug: 2086124 Change-Id: I0766d4f4796fb95615b46882fa802342d76e7688 Signed-off-by: Arthur Antonio Duarte Freire <arthurantonio.duartefreire@windriver.com>
108 lines
3.9 KiB
Diff
108 lines
3.9 KiB
Diff
From 6008afb8bb117e9275b15bfbe83b4c38e7adee8d Mon Sep 17 00:00:00 2001
|
|
From: Arthur Antonio Duarte Freire <arthurantonio.duartefreire@windriver.com>
|
|
Date: Thu, 4 Jul 2024 13:58:36 -0300
|
|
Subject: [PATCH] Add support ceph dashboard
|
|
|
|
Add support for ceph dashboard by creating the following resources:
|
|
- NodePort to expose the dashboard
|
|
- Secret to set the default password
|
|
- GlobalNetworkPolicy to allow the use of the ports
|
|
|
|
---
|
|
.../templates/dashboard-external.yaml | 23 +++++++++++++++++++
|
|
.../templates/dashboard-secret.yaml | 10 ++++++++
|
|
.../templates/dashboard-gnp.yaml | 18 +++++++++++++++
|
|
.../charts/rook-ceph/templates/resources.yaml | 6 +++++
|
|
4 files changed, 57 insertions(+)
|
|
create mode 100644 deploy/charts/rook-ceph-cluster/templates/dashboard-external.yaml
|
|
create mode 100644 deploy/charts/rook-ceph-cluster/templates/dashboard-secret.yaml
|
|
create mode 100644 deploy/charts/rook-ceph-cluster/templates/dashboard-gnp.yaml
|
|
|
|
diff --git a/deploy/charts/rook-ceph-cluster/templates/dashboard-external.yaml b/deploy/charts/rook-ceph-cluster/templates/dashboard-external.yaml
|
|
new file mode 100644
|
|
index 0000000..06e67fa
|
|
--- /dev/null
|
|
+++ b/deploy/charts/rook-ceph-cluster/templates/dashboard-external.yaml
|
|
@@ -0,0 +1,23 @@
|
|
+{{ if .Values.cephClusterSpec.dashboard.enabled }}
|
|
+apiVersion: v1
|
|
+kind: Service
|
|
+metadata:
|
|
+ name: rook-ceph-mgr-dashboard-external-https
|
|
+ namespace: rook-ceph
|
|
+ labels:
|
|
+ app: rook-ceph-mgr
|
|
+ rook_cluster: rook-ceph
|
|
+spec:
|
|
+ ports:
|
|
+ - name: dashboard
|
|
+ nodePort: {{ .Values.cephClusterSpec.dashboard.nodePort }}
|
|
+ port: {{ .Values.cephClusterSpec.dashboard.port }}
|
|
+ protocol: TCP
|
|
+ targetPort: {{ .Values.cephClusterSpec.dashboard.port }}
|
|
+ selector:
|
|
+ app: rook-ceph-mgr
|
|
+ rook_cluster: rook-ceph
|
|
+ mgr_role: active
|
|
+ sessionAffinity: None
|
|
+ type: NodePort
|
|
+{{ end }}
|
|
diff --git a/deploy/charts/rook-ceph-cluster/templates/dashboard-secret.yaml b/deploy/charts/rook-ceph-cluster/templates/dashboard-secret.yaml
|
|
new file mode 100644
|
|
index 0000000..ae4be31
|
|
--- /dev/null
|
|
+++ b/deploy/charts/rook-ceph-cluster/templates/dashboard-secret.yaml
|
|
@@ -0,0 +1,10 @@
|
|
+{{ if .Values.cephClusterSpec.dashboard.enabled }}
|
|
+apiVersion: v1
|
|
+data:
|
|
+ password: {{ .Values.cephClusterSpec.dashboard.password }}
|
|
+kind: Secret
|
|
+metadata:
|
|
+ name: rook-ceph-dashboard-password
|
|
+ namespace: rook-ceph
|
|
+type: kubernetes.io/rook
|
|
+{{ end }}
|
|
diff --git a/deploy/charts/rook-ceph-cluster/templates/dashboard-gnp.yaml b/deploy/charts/rook-ceph-cluster/templates/dashboard-gnp.yaml
|
|
new file mode 100644
|
|
index 0000000..a000ff0
|
|
--- /dev/null
|
|
+++ b/deploy/charts/rook-ceph-cluster/templates/dashboard-gnp.yaml
|
|
@@ -0,0 +1,18 @@
|
|
+{{ if .Values.cephClusterSpec.dashboard.enabled }}
|
|
+apiVersion: crd.projectcalico.org/v1
|
|
+kind: GlobalNetworkPolicy
|
|
+metadata:
|
|
+ name: rook-ceph-mgr-dashboard-gnp
|
|
+spec:
|
|
+ ingress:
|
|
+ - action: Allow
|
|
+ destination:
|
|
+ ports:
|
|
+ - {{ .Values.cephClusterSpec.dashboard.port }}
|
|
+ - {{ .Values.cephClusterSpec.dashboard.nodePort }}
|
|
+ protocol: TCP
|
|
+ order: 500
|
|
+ selector: has(nodetype) && nodetype == 'controller' && has(iftype) && iftype contains 'oam'
|
|
+ types:
|
|
+ - Ingress
|
|
+{{ end }}
|
|
diff --git a/deploy/charts/rook-ceph/templates/resources.yaml b/deploy/charts/rook-ceph/templates/resources.yaml
|
|
index 87cacb5..ef6642e 100644
|
|
--- a/deploy/charts/rook-ceph/templates/resources.yaml
|
|
+++ b/deploy/charts/rook-ceph/templates/resources.yaml
|
|
@@ -1011,6 +1011,12 @@ spec:
|
|
maximum: 65535
|
|
minimum: 0
|
|
type: integer
|
|
+ nodePort:
|
|
+ description: Port to be used to external access
|
|
+ type: integer
|
|
+ password:
|
|
+ description: Password to be used on the dashboard
|
|
+ type: string
|
|
prometheusEndpoint:
|
|
description: Endpoint for the Prometheus host
|
|
type: string
|
|
--
|
|
2.34.1
|