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

feat: Add RBAC rules for Kubernetes Deployment tests #2307

Merged
merged 4 commits into from
Nov 5, 2024
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
1 change: 1 addition & 0 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ Kubernetes native, multi-tenant synthetic monitoring system
| serviceAccount.rbac.exec | bool | `true` | |
| serviceAccount.rbac.ingressCreateAndDelete | bool | `true` | for pod canary |
| serviceAccount.rbac.namespaceCreateAndDelete | bool | `true` | for namespace canary |
| serviceAccount.rbac.deploymentCreateAndDelete | bool | `true` | for deployment canary |
| serviceAccount.rbac.podsCreateAndDelete | bool | `true` | for pod and junit canaries |
| serviceAccount.rbac.readAll | bool | `true` | for use with kubernetes resource lookups |
| serviceAccount.rbac.secrets | bool | `true` | for secret management with valueFrom |
Expand Down
1 change: 1 addition & 0 deletions chart/ci/full-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ serviceAccount:
exec: true
ingressCreateAndDelete: true
namespaceCreateAndDelete: true
deploymentCreateAndDelete: true
podsCreateAndDelete: true
readAll: true
secrets: true
Expand Down
14 changes: 14 additions & 0 deletions chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ rules:
verbs:
- "*"
{{- end}}
{{- if .Values.serviceAccount.rbac.deploymentCreateAndDelete }}
- apiGroups:
- "apps"
resources:
- deployments
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
{{- end }}
{{- if .Values.serviceAccount.rbac.extra }}
{{ .Values.serviceAccount.rbac.extra | toYaml | nindent 2 }}
{{- end}}
Expand Down
9 changes: 8 additions & 1 deletion chart/values.schema.deref.json
Original file line number Diff line number Diff line change
Expand Up @@ -4471,6 +4471,12 @@
"title": "namespaceCreateAndDelete",
"type": "boolean"
},
"deploymentCreateAndDelete": {
"default": true,
"description": "for deployment canary",
"title": "deploymentCreateAndDelete",
"type": "boolean"
},
"podsCreateAndDelete": {
"default": true,
"description": "for pod and junit canaries",
Expand Down Expand Up @@ -4508,7 +4514,8 @@
"podsCreateAndDelete",
"exec",
"ingressCreateAndDelete",
"namespaceCreateAndDelete"
"namespaceCreateAndDelete",
"deploymentCreateAndDelete"
],
"title": "rbac"
}
Expand Down
10 changes: 9 additions & 1 deletion chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,13 @@
"title": "namespaceCreateAndDelete",
"type": "boolean"
},
"deploymentCreateAndDelete": {
"default": true,
"description": "for deployment canary",
"required": [],
"title": "deploymentCreateAndDelete",
"type": "boolean"
},
"podsCreateAndDelete": {
"default": true,
"description": "for pod and junit canaries",
Expand Down Expand Up @@ -564,7 +571,8 @@
"podsCreateAndDelete",
"exec",
"ingressCreateAndDelete",
"namespaceCreateAndDelete"
"namespaceCreateAndDelete",
"deploymentCreateAndDelete"
],
"title": "rbac"
}
Expand Down
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ serviceAccount:
# -- for namespace canary
namespaceCreateAndDelete: true

# -- for deployment canary
deploymentCreateAndDelete: true

# @schema
# required: false
# default: []
Expand Down
Loading