Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Testnet-Manager] Add role in serviceaccount to read volumes #295

Merged
merged 6 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/testnet-manager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: testnet-manager
description: A Helm chart to deploy testnet-manager
type: application
version: 1.3.0
version: 1.3.1
appVersion: "1.0.0"
maintainers:
- name: Parity
Expand Down
2 changes: 1 addition & 1 deletion charts/testnet-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch

The helm chart installs the [Testnet Manager](https://github.com/paritytech/testnet-manager).

![Version: 1.3.0](https://img.shields.io/badge/Version-1.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)
![Version: 1.3.1](https://img.shields.io/badge/Version-1.3.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)

## Maintainers

Expand Down
52 changes: 49 additions & 3 deletions charts/testnet-manager/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,18 @@ rules:
resources: ["statefulsets"]
verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ $fullName }}-volume-reader
rules:
- apiGroups: [""]
resources: ["persistentvolumes", "persistentvolumeclaims"]
verbs: ["get", "list"]
---
# Creat Role bindings
{{- $serviceAccountName := include "testnet-manager.serviceAccountName" . -}}
# Allow the testnet-manager service account to read pods in the rococo namespace
# Allow the testnet-manager service account to read pods in the current namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -44,7 +53,7 @@ subjects:
name: {{ $serviceAccountName }}
namespace: {{ $.Release.Namespace }}
---
# Allow the testnet-manager service account to read configmaps in the rococo namespace
# Allow the testnet-manager service account to read configmaps in the current namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -59,7 +68,7 @@ subjects:
name: {{ $serviceAccountName }}
namespace: {{ $.Release.Namespace }}
---
# Allow the testnet-manager service account to read statefulsets in the rococo namespace
# Allow the testnet-manager service account to read statefulsets in the current namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
Expand All @@ -74,3 +83,40 @@ subjects:
name: {{ $serviceAccountName }}
namespace: {{ $.Release.Namespace }}
---
# Allow the testnet-manager service account to read volumes in the current namespace
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ $fullName }}-read-volume
namespace: {{ $.Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ $fullName }}-volume-reader
subjects:
- kind: ServiceAccount
name: {{ $serviceAccountName }}
namespace: {{ $.Release.Namespace }}
---
# Allow the testnet-manager service account to read nodes of the pod in the current namespace
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ $fullName }}-read-node
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ $fullName }}-node-reader
subjects:
- kind: ServiceAccount
name: {{ $serviceAccountName }}
namespace: {{ $.Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ $fullName }}-read-node
apiGroup: rbac.authorization.k8s.io
Loading