1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-05 15:37:19 +00:00

refactor: move helm image pull secrets in config folder (#6069)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-01-20 21:04:25 +01:00 committed by GitHub
parent 00b88993da
commit 8b818b903d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 33 deletions

View file

@ -151,6 +151,8 @@ The command removes all the Kubernetes components associated with the chart and
| metricsConfig.namespaces.include | list | `[]` | List of namespaces to capture metrics for. | | metricsConfig.namespaces.include | list | `[]` | List of namespaces to capture metrics for. |
| metricsConfig.namespaces.exclude | list | `[]` | list of namespaces to NOT capture metrics for. | | metricsConfig.namespaces.exclude | list | `[]` | list of namespaces to NOT capture metrics for. |
| metricsConfig.metricsRefreshInterval | string | `nil` | Rate at which metrics should reset so as to clean up the memory footprint of kyverno metrics, if you might be expecting high memory footprint of Kyverno's metrics. Default: 0, no refresh of metrics | | metricsConfig.metricsRefreshInterval | string | `nil` | Rate at which metrics should reset so as to clean up the memory footprint of kyverno metrics, if you might be expecting high memory footprint of Kyverno's metrics. Default: 0, no refresh of metrics |
| imagePullSecrets | object | `{}` | Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| existingImagePullSecrets | list | `[]` | Existing Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument |
| customLabels | object | `{}` | Additional labels | | customLabels | object | `{}` | Additional labels |
| rbac.create | bool | `true` | Create ClusterRoles, ClusterRoleBindings, and ServiceAccount | | rbac.create | bool | `true` | Create ClusterRoles, ClusterRoleBindings, and ServiceAccount |
| rbac.serviceAccount.create | bool | `true` | Create a ServiceAccount | | rbac.serviceAccount.create | bool | `true` | Create a ServiceAccount |
@ -192,8 +194,6 @@ The command removes all the Kubernetes components associated with the chart and
| extraArgs | list | `["--loggingFormat=text"]` | Extra arguments to give to the binary. | | extraArgs | list | `["--loggingFormat=text"]` | Extra arguments to give to the binary. |
| extraInitContainers | list | `[]` | Array of extra init containers | | extraInitContainers | list | `[]` | Array of extra init containers |
| extraContainers | list | `[]` | Array of extra containers to run alongside kyverno | | extraContainers | list | `[]` | Array of extra containers to run alongside kyverno |
| imagePullSecrets | object | `{}` | Image pull secrets for image verify and imageData policies. This will define the `--imagePullSecrets` Kyverno argument. |
| existingImagePullSecrets | list | `[]` | Existing Image pull secrets for image verify and imageData policies. This will define the `--imagePullSecrets` Kyverno argument. |
| resources.limits | object | `{"memory":"384Mi"}` | Pod resource limits | | resources.limits | object | `{"memory":"384Mi"}` | Pod resource limits |
| resources.requests | object | `{"cpu":"100m","memory":"128Mi"}` | Pod resource requests | | resources.requests | object | `{"cpu":"100m","memory":"128Mi"}` | Pod resource requests |
| initResources.limits | object | `{"cpu":"100m","memory":"256Mi"}` | Pod resource limits | | initResources.limits | object | `{"cpu":"100m","memory":"256Mi"}` | Pod resource limits |

View file

@ -142,10 +142,6 @@ maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- define "kyverno.imagePullSecret" }}
{{- printf "{\"auths\":{\"%s\":{\"auth\":\"%s\"}}}" .registry (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end }}
{{- define "kyverno.image" -}} {{- define "kyverno.image" -}}
{{- if .image.registry -}} {{- if .image.registry -}}
{{ .image.registry }}/{{ required "An image repository is required" .image.repository }}:{{ default .defaultTag .image.tag }} {{ .image.registry }}/{{ required "An image repository is required" .image.repository }}:{{ default .defaultTag .image.tag }}

View file

@ -39,7 +39,7 @@ app.kubernetes.io/part-of: {{ template "kyverno.name" . }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- tpl (join "" $resourceFilters) . }} {{- tpl (join "" $resourceFilters) . }}
{{- end }} {{- end -}}
{{- define "kyverno.config.webhooks" -}} {{- define "kyverno.config.webhooks" -}}
{{- $excludeDefault := dict "key" "kubernetes.io/metadata.name" "operator" "NotIn" "values" (list (include "kyverno.namespace" .)) }} {{- $excludeDefault := dict "key" "kubernetes.io/metadata.name" "operator" "NotIn" "values" (list (include "kyverno.namespace" .)) }}
@ -51,4 +51,8 @@ app.kubernetes.io/part-of: {{ template "kyverno.name" . }}
{{- $newWebhook = append $newWebhook (merge (omit $webhook "namespaceSelector") (dict "namespaceSelector" $newNamespaceSelector)) }} {{- $newWebhook = append $newWebhook (merge (omit $webhook "namespaceSelector") (dict "namespaceSelector" $newNamespaceSelector)) }}
{{- end }} {{- end }}
{{- $newWebhook | toJson }} {{- $newWebhook | toJson }}
{{- end }} {{- end -}}
{{- define "kyverno.config.imagePullSecret" -}}
{{- printf "{\"auths\":{\"%s\":{\"auth\":\"%s\"}}}" .registry (printf "%s:%s" .username .password | b64enc) | b64enc }}
{{- end -}}

View file

@ -6,8 +6,8 @@ metadata:
name: {{ $name }} name: {{ $name }}
namespace: {{ template "kyverno.namespace" $ }} namespace: {{ template "kyverno.namespace" $ }}
labels: labels:
{{- include "kyverno.labels" $ | nindent 4 }} {{- include "kyverno.config.labels" $ | nindent 4 }}
type: kubernetes.io/dockerconfigjson type: kubernetes.io/dockerconfigjson
data: data:
.dockerconfigjson: {{ template "kyverno.imagePullSecret" $secret }} .dockerconfigjson: {{ template "kyverno.config.imagePullSecret" $secret }}
{{ end }} {{ end }}

View file

@ -120,6 +120,22 @@ metricsConfig:
metricsRefreshInterval: ~ metricsRefreshInterval: ~
# metricsRefreshInterval: 24h # metricsRefreshInterval: 24h
# -- Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument
imagePullSecrets: {}
# regcred:
# registry: foo.example.com
# username: foobar
# password: secret
# regcred2:
# registry: bar.example.com
# username: barbaz
# password: secret2
# -- Existing Image pull secrets for image verification policies, this will define the `--imagePullSecrets` argument
existingImagePullSecrets: []
# - test-registry
# - other-test-registry
# -- Additional labels # -- Additional labels
customLabels: {} customLabels: {}
@ -301,29 +317,6 @@ extraContainers: []
# image: busybox # image: busybox
# command: ['sh', '-c', 'echo Hello && sleep 3600'] # command: ['sh', '-c', 'echo Hello && sleep 3600']
# -- Image pull secrets for image verify and imageData policies.
# This will define the `--imagePullSecrets` Kyverno argument.
imagePullSecrets: {}
# Define two image pull secrets
# imagePullSecrets:
# regcred:
# registry: foo.example.com
# username: foobar
# password: secret
# regcred2:
# registry: bar.example.com
# username: barbaz
# password: secret2
# -- Existing Image pull secrets for image verify and imageData policies.
# This will define the `--imagePullSecrets` Kyverno argument.
existingImagePullSecrets: []
# Define an existing image pull secret
# existingImagePullSecrets:
# - test-registry
# - other-test-registry
resources: resources:
# -- Pod resource limits # -- Pod resource limits
limits: limits: