Skip to content

Commit

Permalink
feat: Add RBAC rules for Kubernetes Deployment tests (#2307)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianshub authored Nov 5, 2024
1 parent 24e949f commit 394c1d7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 2 deletions.
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

0 comments on commit 394c1d7

Please sign in to comment.