diff --git a/Makefile b/Makefile index 859da00c60..02c5efc80f 100644 --- a/Makefile +++ b/Makefile @@ -562,14 +562,12 @@ codegen-cli-all: codegen-cli-crds codegen-cli-docs codegen-cli-api-docs codegen- codegen-helm-crds: codegen-crds-all ## Generate helm CRDs @echo Generate helm crds... >&2 @cat $(CRDS_PATH)/* \ - | $(SED) -e '1i{{- if .Values.crds.install }}' \ - | $(SED) -e '$$a{{- end }}' \ | $(SED) -e '/^ annotations:/a \ \ \ \ {{- end }}' \ | $(SED) -e '/^ annotations:/a \ \ \ \ {{- toYaml . | nindent 4 }}' \ - | $(SED) -e '/^ annotations:/a \ \ \ \ {{- with .Values.crds.annotations }}' \ + | $(SED) -e '/^ annotations:/a \ \ \ \ {{- with .Values.annotations }}' \ | $(SED) -e '/^ annotations:/i \ \ labels:' \ | $(SED) -e '/^ labels:/a \ \ \ \ {{- include "kyverno.crds.labels" . | nindent 4 }}' \ - > ./charts/kyverno/templates/crds/crds.yaml + > ./charts/kyverno/charts/crds/templates/crds.yaml .PHONY: codegen-helm-all codegen-helm-all: codegen-helm-crds codegen-helm-docs ## Generate helm docs and CRDs diff --git a/charts/kyverno/Chart.yaml b/charts/kyverno/Chart.yaml index eebc82eb5e..8d5a4b22c0 100644 --- a/charts/kyverno/Chart.yaml +++ b/charts/kyverno/Chart.yaml @@ -74,3 +74,6 @@ dependencies: - name: grafana version: "0.0.0" condition: grafana.enabled + - name: crds + version: "0.0.0" + condition: crds.install diff --git a/charts/kyverno/README.md b/charts/kyverno/README.md index 2954a6fcf0..c0e2bfcdfd 100644 --- a/charts/kyverno/README.md +++ b/charts/kyverno/README.md @@ -254,6 +254,7 @@ The chart values are organised per component. |-----|------|---------|-------------| | crds.install | bool | `true` | Whether to have Helm install the Kyverno CRDs, if the CRDs are not installed by Helm, they must be added before policies can be created | | crds.annotations | object | `{}` | Additional CRDs annotations | +| crds.customLabels | object | `{}` | Additional CRDs labels | ### Config @@ -762,6 +763,7 @@ Kubernetes: `>=1.16.0-0` | Repository | Name | Version | |------------|------|---------| +| | crds | 0.0.0 | | | grafana | 0.0.0 | ## Maintainers diff --git a/charts/kyverno/charts/crds/Chart.yaml b/charts/kyverno/charts/crds/Chart.yaml new file mode 100644 index 0000000000..adb9e4a5d3 --- /dev/null +++ b/charts/kyverno/charts/crds/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: crds +version: 0.0.0 diff --git a/charts/kyverno/charts/crds/README.md b/charts/kyverno/charts/crds/README.md new file mode 100644 index 0000000000..2d3f1390c7 --- /dev/null +++ b/charts/kyverno/charts/crds/README.md @@ -0,0 +1,13 @@ +# crds + +![Version: 0.0.0](https://img.shields.io/badge/Version-0.0.0-informational?style=flat-square) + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| annotations | object | `{}` | This field can be overwritten by setting crds.annotations in the parent chart | +| customLabels | object | `{}` | This field can be overwritten by setting crds.labels in the parent chart | + +---------------------------------------------- +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) diff --git a/charts/kyverno/templates/crds/_helpers.tpl b/charts/kyverno/charts/crds/templates/_helpers.tpl similarity index 92% rename from charts/kyverno/templates/crds/_helpers.tpl rename to charts/kyverno/charts/crds/templates/_helpers.tpl index f09828b72a..5401de53e8 100644 --- a/charts/kyverno/templates/crds/_helpers.tpl +++ b/charts/kyverno/charts/crds/templates/_helpers.tpl @@ -4,6 +4,7 @@ {{- template "kyverno.labels.merge" (list (include "kyverno.labels.common" .) (include "kyverno.crds.matchLabels" .) + (toYaml .Values.customLabels) ) -}} {{- end -}} diff --git a/charts/kyverno/templates/crds/crds.yaml b/charts/kyverno/charts/crds/templates/crds.yaml similarity index 99% rename from charts/kyverno/templates/crds/crds.yaml rename to charts/kyverno/charts/crds/templates/crds.yaml index 0fe2534645..830776a15f 100644 --- a/charts/kyverno/templates/crds/crds.yaml +++ b/charts/kyverno/charts/crds/templates/crds.yaml @@ -1,4 +1,3 @@ -{{- if .Values.crds.install }} --- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition @@ -6,7 +5,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -343,7 +342,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -648,7 +647,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -1914,7 +1913,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -2252,7 +2251,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -2557,7 +2556,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -3823,7 +3822,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -21308,7 +21307,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -38796,7 +38795,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -39819,7 +39818,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -40223,7 +40222,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -40590,7 +40589,7 @@ metadata: labels: {{- include "kyverno.crds.labels" . | nindent 4 }} annotations: - {{- with .Values.crds.annotations }} + {{- with .Values.annotations }} {{- toYaml . | nindent 4 }} {{- end }} controller-gen.kubebuilder.io/version: v0.12.0 @@ -40949,4 +40948,3 @@ spec: served: true storage: true subresources: {} -{{- end }} diff --git a/charts/kyverno/charts/crds/values.yaml b/charts/kyverno/charts/crds/values.yaml new file mode 100644 index 0000000000..ef555b148c --- /dev/null +++ b/charts/kyverno/charts/crds/values.yaml @@ -0,0 +1,16 @@ +# -- Internal settings used with `helm template` to generate install manifest +# @ignored +templating: + enabled: false + debug: false + version: ~ + +# -- Additional CRDs annotations +# -- This field can be overwritten by setting crds.annotations in the parent chart +annotations: {} + # argocd.argoproj.io/sync-options: Replace=true + # strategy.spinnaker.io/replace: 'true' + +# -- Additional CRDs labels +# -- This field can be overwritten by setting crds.labels in the parent chart +customLabels: {} diff --git a/charts/kyverno/values.yaml b/charts/kyverno/values.yaml index 9139dad691..87921a0b15 100644 --- a/charts/kyverno/values.yaml +++ b/charts/kyverno/values.yaml @@ -35,6 +35,9 @@ crds: # argocd.argoproj.io/sync-options: Replace=true # strategy.spinnaker.io/replace: 'true' + # -- Additional CRDs labels + customLabels: {} + # Configuration config: diff --git a/config/install-latest-testing.yaml b/config/install-latest-testing.yaml index 2d290443d5..2fa3df1431 100644 --- a/config/install-latest-testing.yaml +++ b/config/install-latest-testing.yaml @@ -210,8 +210,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: admissionreports.kyverno.io @@ -547,8 +549,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: backgroundscanreports.kyverno.io @@ -852,8 +856,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: cleanuppolicies.kyverno.io @@ -2118,8 +2124,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: clusteradmissionreports.kyverno.io @@ -2456,8 +2464,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: clusterbackgroundscanreports.kyverno.io @@ -2761,8 +2771,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: clustercleanuppolicies.kyverno.io @@ -4027,8 +4039,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: clusterpolicies.kyverno.io @@ -21512,8 +21526,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: policies.kyverno.io @@ -39000,8 +39016,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: policyexceptions.kyverno.io @@ -40023,8 +40041,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: updaterequests.kyverno.io @@ -40427,8 +40447,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: clusterpolicyreports.wgpolicyk8s.io @@ -40794,8 +40816,10 @@ metadata: labels: app.kubernetes.io/component: crds app.kubernetes.io/instance: kyverno - app.kubernetes.io/part-of: kyverno - app.kubernetes.io/version: latest + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/part-of: kyverno-crds + app.kubernetes.io/version: 0.0.0 + helm.sh/chart: crds-0.0.0 annotations: controller-gen.kubebuilder.io/version: v0.12.0 name: policyreports.wgpolicyk8s.io