Skip to content

Commit

Permalink
Deployments should respect serviceAccount.autmount value in Helm chart (
Browse files Browse the repository at this point in the history
#568)

* automountServiceAccountToken should use value specified in Helm chart

Signed-off-by: Vidar Anima Normann <[email protected]>

* Fix typo in documentation maount->mount

Signed-off-by: Vidar Anima Normann <[email protected]>

* Add automountServiceAccountToken that matches Values in deployments for ui, kyverno-plugin and trivy-plugin

Signed-off-by: Vidar Anima Normann <[email protected]>

* Correct improper reference to automount-attribute for kyverno and trivy plugins

Signed-off-by: Vidar Anima Normann <[email protected]>

---------

Signed-off-by: Vidar Anima Normann <[email protected]>
Co-authored-by: Vidar Anima Normann <[email protected]>
  • Loading branch information
vidarno and Vidar Anima Normann authored Nov 13, 2024
1 parent 613c454 commit 525fa79
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions charts/policy-reporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Open `http://localhost:8082/` in your browser.
| annotations | object | `{}` | Key/value pairs that are attached to all resources. |
| rbac.enabled | bool | `true` | Create RBAC resources |
| serviceAccount.create | bool | `true` | Create ServiceAccount |
| serviceAccount.automount | bool | `true` | Enable ServiceAccount automaount |
| serviceAccount.automount | bool | `true` | Enable ServiceAccount automount |
| serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount |
| serviceAccount.name | string | `""` | The ServiceAccount name |
| service.enabled | bool | `true` | Create Service |
Expand Down Expand Up @@ -371,7 +371,7 @@ Open `http://localhost:8082/` in your browser.
| ui.clusters | list | `[]` | Connected Policy Reporter APIs |
| ui.imagePullSecrets | list | `[]` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| ui.serviceAccount.create | bool | `true` | Create ServiceAccount |
| ui.serviceAccount.automount | bool | `true` | Enable ServiceAccount automaount |
| ui.serviceAccount.automount | bool | `true` | Enable ServiceAccount automount |
| ui.serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount |
| ui.serviceAccount.name | string | `""` | The ServiceAccount name |
| ui.extraManifests | list | `[]` | list of extra manifests |
Expand Down Expand Up @@ -431,7 +431,7 @@ Open `http://localhost:8082/` in your browser.
| plugin.kyverno.blockReports.policyReport.annotations | list | `[]` | Annotations for all created (Cluster)PolicyReports |
| plugin.kyverno.imagePullSecrets | list | `[]` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| plugin.kyverno.serviceAccount.create | bool | `true` | Create ServiceAccount |
| plugin.kyverno.serviceAccount.automount | bool | `true` | Enable ServiceAccount automaount |
| plugin.kyverno.serviceAccount.automount | bool | `true` | Enable ServiceAccount automount |
| plugin.kyverno.serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount |
| plugin.kyverno.serviceAccount.name | string | `""` | The ServiceAccount name |
| plugin.kyverno.podAnnotations | object | `{}` | Additional annotations to add to each pod |
Expand Down Expand Up @@ -488,7 +488,7 @@ Open `http://localhost:8082/` in your browser.
| plugin.trivy.policyReporter.secretRef | string | `""` | Secret to read the API configuration from supports `host`, `certificate`, `skipTLS`, `username`, `password` key |
| plugin.trivy.imagePullSecrets | list | `[]` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| plugin.trivy.serviceAccount.create | bool | `true` | Create ServiceAccount |
| plugin.trivy.serviceAccount.automount | bool | `true` | Enable ServiceAccount automaount |
| plugin.trivy.serviceAccount.automount | bool | `true` | Enable ServiceAccount automount |
| plugin.trivy.serviceAccount.annotations | object | `{}` | Annotations for the ServiceAccount |
| plugin.trivy.serviceAccount.name | string | `""` | The ServiceAccount name |
| plugin.trivy.podAnnotations | object | `{}` | Additional annotations to add to each pod |
Expand Down
2 changes: 1 addition & 1 deletion charts/policy-reporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "policyreporter.serviceAccountName" . }}
automountServiceAccountToken: true
automountServiceAccountToken: {{ .Values.serviceAccount.automount }}
{{- if .Values.podSecurityContext }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "kyverno-plugin.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.plugin.kyverno.serviceAccount.automount }}
{{- if .Values.plugin.kyverno.podSecurityContext }}
securityContext:
{{- toYaml .Values.plugin.kyverno.podSecurityContext | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "trivy-plugin.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.plugin.trivy.serviceAccount.automount }}
{{- if .Values.plugin.trivy.podSecurityContext }}
securityContext:
{{- toYaml .Values.plugin.trivy.podSecurityContext | nindent 8 }}
Expand Down Expand Up @@ -94,4 +95,4 @@ spec:
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/policy-reporter/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "ui.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.ui.serviceAccount.automount }}
{{- if .Values.ui.podSecurityContext }}
securityContext:
{{- toYaml .Values.ui.podSecurityContext | nindent 8 }}
Expand Down
8 changes: 4 additions & 4 deletions charts/policy-reporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ rbac:
serviceAccount:
# -- Create ServiceAccount
create: true
# -- Enable ServiceAccount automaount
# -- Enable ServiceAccount automount
automount: true
# -- Annotations for the ServiceAccount
annotations: {}
Expand Down Expand Up @@ -974,7 +974,7 @@ ui:
serviceAccount:
# -- Create ServiceAccount
create: true
# -- Enable ServiceAccount automaount
# -- Enable ServiceAccount automount
automount: true
# -- Annotations for the ServiceAccount
annotations: {}
Expand Down Expand Up @@ -1183,7 +1183,7 @@ plugin:
serviceAccount:
# -- Create ServiceAccount
create: true
# -- Enable ServiceAccount automaount
# -- Enable ServiceAccount automount
automount: true
# -- Annotations for the ServiceAccount
annotations: {}
Expand Down Expand Up @@ -1371,7 +1371,7 @@ plugin:
serviceAccount:
# -- Create ServiceAccount
create: true
# -- Enable ServiceAccount automaount
# -- Enable ServiceAccount automount
automount: true
# -- Annotations for the ServiceAccount
annotations: {}
Expand Down

0 comments on commit 525fa79

Please sign in to comment.