Skip to content

feat: Add support for rbac resources #797

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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/cloudquery/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sources:
maintainers:
- name: yevgenypats
email: [email protected]
version: 38.2.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version bumps are handled automatically by CI based on the type of commit.
In this case, since the commit is a feat:, the minor will be bumped which is correct.

Do remove this code change here.

version: 38.2.1
appVersion: 6.20.5
annotations:
artifacthub.io/license: MPL-2.0
Expand Down
10 changes: 7 additions & 3 deletions charts/cloudquery/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cloudquery

![Version: 38.2.0](https://img.shields.io/badge/Version-38.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 6.20.2](https://img.shields.io/badge/AppVersion-6.20.2-informational?style=flat-square)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as the above, do remove this code change.

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

Open source high performance data integration platform designed for security and infrastructure teams.

Expand Down Expand Up @@ -52,6 +52,12 @@ Kubernetes: `^1.8.0-0`
| nameOverride | string | `""` | Partially override common.names.fullname template (will maintain the release name) |
| nodeSelector | object | `{}` | Optional. Adds the nodeSelector to the admin pod and cronjob. |
| promtail | object | See [values.yaml](./values.yaml) | Promtail sub-chart configuration |
| rbac | object | `{"annotations":{},"apiVersion":"v1","create":false,"labels":{},"name":"cloudquery-read-only"}` | RBAC configuration |
| rbac.annotations | object | `{}` | Additional annotations to be applied to the ClusterRole and ClusterRoleBinding |
| rbac.apiVersion | string | `"v1"` | API version of the ClusterRoleBinding |
| rbac.create | bool | `false` | Create the ClusterRole and ClusterRoleBinding |
| rbac.labels | object | `{}` | Additional labels to be applied to the ClusterRole and ClusterRoleBinding |
| rbac.name | string | `"cloudquery-read-only"` | Name of the ClusterRole and ClusterRoleBinding |
| resources.admin | object | `{"requests":{"cpu":"1000m","memory":"1024Mi"}}` | Optional. Resource requests/ limit for admin pod. |
| resources.cronJob | object | `{"requests":{"cpu":"1000m","memory":"1024Mi"}}` | Optional. Resource requests/ limit for cronJob. |
| schedule | string | `"0 */6 * * *"` | Schedule fetch time Every 6 hours. More information at: https://crontab.guru/#0_0_*_*_* |
Expand All @@ -66,5 +72,3 @@ Kubernetes: `^1.8.0-0`
| volumeMounts | string | `nil` | |
| volumes | string | `nil` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0)
Comment on lines -69 to -70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did this get removed?

11 changes: 11 additions & 0 deletions charts/cloudquery/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{/*
Create the name of the cluster role to use
*/}}
{{- define "cloudquery.clusterRoleName" -}}
{{- if .Values.rbac.create }}
{{- default (include "cloudquery.fullname" .) .Values.rbac.name }}
{{- else }}
{{- default "default" .Values.rbac.name }}
{{- end }}
{{- end }}

{{/*
Return the image to use depending on the AppVersion and image tag defined
*/}}
Expand Down
28 changes: 28 additions & 0 deletions charts/cloudquery/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/{{ .Values.rbac.apiVersion }}
kind: ClusterRole
metadata:
name: {{ include "cloudquery.clusterRoleName" . }}
labels:
{{- include "cloudquery.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
rules:
- apiGroups:
- "*"
resources:
- "*"
verbs:
- get
- list
- nonResourceURLs:
- "*"
verbs:
- get
- list
{{- end }}
23 changes: 23 additions & 0 deletions charts/cloudquery/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/{{ .Values.rbac.apiVersion }}
kind: ClusterRoleBinding
metadata:
name: {{ include "cloudquery.clusterRoleName" . }}
labels:
{{- include "cloudquery.labels" . | nindent 4 }}
{{- with .Values.rbac.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "cloudquery.clusterRoleName" . }}
subjects:
- kind: ServiceAccount
name: {{ include "cloudquery.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
14 changes: 13 additions & 1 deletion charts/cloudquery/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ serviceAccount:
# -- Additional custom label for the ServiceAccount
labels: {}

# -- RBAC configuration
rbac:
# -- Create the ClusterRole and ClusterRoleBinding
create: false
# -- Name of the ClusterRole and ClusterRoleBinding
name: cloudquery-read-only
# -- API version of the ClusterRoleBinding
apiVersion: v1
# -- Additional labels to be applied to the ClusterRole and ClusterRoleBinding
labels: {}
# -- Additional annotations to be applied to the ClusterRole and ClusterRoleBinding
annotations: {}

admin:
# -- Enable admin container
# useful for debugging into cloudquery
Expand Down Expand Up @@ -112,7 +125,6 @@ volumes:
# Optional. Additional volumes to mount in the pod.
volumeMounts:


resources:
# -- Optional. Resource requests/ limit for admin pod.
admin:
Expand Down
Loading