Skip to content

Commit

Permalink
feat(px-central): Support multi-instances within same cluster
Browse files Browse the repository at this point in the history
it fixes portworx#664
  • Loading branch information
abdennour committed Nov 5, 2024
1 parent 93bffd1 commit 02b3883
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 30 deletions.
2 changes: 1 addition & 1 deletion charts/px-central/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ keywords:
name: px-central
sources:
- https://github.com/portworx/helm/tree/master/charts/px-central
version: 2.7.3
version: 2.7.4
appVersion: 2.7.3
name: px-central
8 changes: 3 additions & 5 deletions charts/px-central/templates/px-backup/pxcentral-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ metadata:
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: px-backup-cluster-role
namespace: {{ .Release.Namespace }}
name: px-backup-cluster-role-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: px-backup
{{- include "px-central.labels" . | nindent 4 }}
Expand Down Expand Up @@ -46,8 +45,7 @@ rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: px-backup-cluster-role-binding
namespace: {{ .Release.Namespace }}
name: px-backup-cluster-role-binding-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-apiserver
{{- include "px-central.labels" . | nindent 4 }}
Expand All @@ -57,7 +55,7 @@ subjects:
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: px-backup-cluster-role
name: px-backup-cluster-role-{{ .Release.Namespace }}
apiGroup: rbac.authorization.k8s.io
---
kind: Role
Expand Down
16 changes: 6 additions & 10 deletions charts/px-central/templates/px-backup/pxcentral-prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: pxc-prometheus-operator
namespace: {{ .Release.Namespace }}
name: pxc-prometheus-operator-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: px-backup
{{- include "px-central.labels" . | nindent 4 }}
Expand All @@ -40,13 +39,12 @@ subjects:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: pxc-prometheus-operator
name: pxc-prometheus-operator-{{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pxc-prometheus-operator
namespace: {{ .Release.Namespace }}
name: pxc-prometheus-operator-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: px-backup
{{- include "px-central.labels" . | nindent 4 }}
Expand Down Expand Up @@ -187,8 +185,7 @@ spec:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: px-backup-dashboard-prometheus
namespace: {{ .Release.Namespace }}
name: px-backup-dashboard-prometheus-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: px-backup
{{- include "px-central.labels" . | nindent 4 }}
Expand Down Expand Up @@ -219,15 +216,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: px-backup-dashboard-prometheus
namespace: {{ .Release.Namespace }}
name: px-backup-dashboard-prometheus-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: px-backup
{{- include "px-central.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: px-backup-dashboard-prometheus
name: px-backup-dashboard-prometheus-{{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: px-backup-dashboard-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ roleRef:
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name | quote }}
namespace: {{ .Release.Namespace }}
name: {{ .Release.Name | quote }}-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-apiserver
{{- include "px-central.labels" . | nindent 4 }}
Expand All @@ -59,7 +58,7 @@ rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name | quote }}
name: {{ .Release.Name | quote }}-{{ .Release.Namespace }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-apiserver
Expand All @@ -70,7 +69,7 @@ subjects:
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name | quote }}
name: {{ .Release.Name | quote }}-{{ .Release.Namespace }}
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
Expand Down
16 changes: 6 additions & 10 deletions charts/px-central/templates/px-monitor/prometheus/prometheus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ metadata:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pxcentral-prometheus
namespace: {{ .Release.Namespace }}
name: pxcentral-prometheus-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-prometheus
{{- include "px-central.labels" . | nindent 4 }}
Expand All @@ -50,15 +49,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: pxcentral-prometheus
namespace: {{ .Release.Namespace }}
name: pxcentral-prometheus-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-prometheus
{{- include "px-central.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: pxcentral-prometheus
name: pxcentral-prometheus-{{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: pxcentral-prometheus
Expand Down Expand Up @@ -207,8 +205,7 @@ spec:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: pxcentral-prometheus-operator
namespace: {{ .Release.Namespace }}
name: pxcentral-prometheus-operator-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-prometheus
{{- include "px-central.labels" . | nindent 4 }}
Expand Down Expand Up @@ -269,15 +266,14 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: pxcentral-prometheus-operator
namespace: {{ .Release.Namespace }}
name: pxcentral-prometheus-operator-{{ .Release.Namespace }}
labels:
app.kubernetes.io/component: pxcentral-prometheus
{{- include "px-central.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: pxcentral-prometheus-operator
name: pxcentral-prometheus-operator-{{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: pxcentral-prometheus-operator
Expand Down

0 comments on commit 02b3883

Please sign in to comment.