1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-14 11:57:48 +00:00

feat: move crds to a subchart (#8623)

* feat: move crds to a subchart

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* update codegen

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update crd configs: annotations and install options

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update default crd installation configuration to true

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* reset annotations

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update chart readme

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* remove subchart crd install option

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update crd chart version

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* configure crds labels

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* fix chart yaml file

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* revert crd subchart version to 0.0.0

Signed-off-by: ShutingZhao <shuting@nirmata.com>

* update install.yaml

Signed-off-by: ShutingZhao <shuting@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
Signed-off-by: ShutingZhao <shuting@nirmata.com>
Co-authored-by: ShutingZhao <shuting@nirmata.com>
This commit is contained in:
Mariam Fahmy 2023-10-12 13:22:49 +03:00 committed by GitHub
parent 9c64b10cd2
commit 3d382e0e01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 103 additions and 42 deletions

View file

@ -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

View file

@ -74,3 +74,6 @@ dependencies:
- name: grafana
version: "0.0.0"
condition: grafana.enabled
- name: crds
version: "0.0.0"
condition: crds.install

View file

@ -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

View file

@ -0,0 +1,3 @@
apiVersion: v2
name: crds
version: 0.0.0

View file

@ -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)

View file

@ -4,6 +4,7 @@
{{- template "kyverno.labels.merge" (list
(include "kyverno.labels.common" .)
(include "kyverno.crds.matchLabels" .)
(toYaml .Values.customLabels)
) -}}
{{- end -}}

View file

@ -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 }}

View file

@ -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: {}

View file

@ -35,6 +35,9 @@ crds:
# argocd.argoproj.io/sync-options: Replace=true
# strategy.spinnaker.io/replace: 'true'
# -- Additional CRDs labels
customLabels: {}
# Configuration
config:

View file

@ -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