diff --git a/charts/log-router/templates/crd.yaml b/charts/log-router/templates/crd.yaml new file mode 100644 index 00000000..e26cde73 --- /dev/null +++ b/charts/log-router/templates/crd.yaml @@ -0,0 +1,38 @@ +{{ if .Values.installCrd }} +{{- /* if we need the CRD, install it */ -}} + +{{/* + this CRD needs to live in the template directory because CRDs within the + chart crds/ directory are not processed as templates +*/}} + +# +# log-router CRD resource: +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: fluentdconfigs.logs.vdp.vmware.com +spec: + conversion: + strategy: None + group: logs.vdp.vmware.com + names: + kind: FluentdConfig + listKind: FluentdConfigList + plural: fluentdconfigs + singular: fluentdconfig + scope: Namespaced + versions: + - name: v1beta1 + schema: + openAPIV3Schema: + properties: + spec: + properties: + fluentconf: + type: string + type: object + type: object + served: true + storage: true +{{ end }} \ No newline at end of file diff --git a/charts/log-router/values.yaml b/charts/log-router/values.yaml index 882cc4ac..6ac76940 100755 --- a/charts/log-router/values.yaml +++ b/charts/log-router/values.yaml @@ -21,6 +21,9 @@ datasource: default # together with the specified legacy datasource to facilitate the migration process to CRDs. crdMigrationMode: false +# default to installing the CRD along with the helm chart +installCrd: true + defaultConfigmap: "fluentd-config" image: diff --git a/kubectl/crd.yaml b/kubectl/crd.yaml deleted file mode 100644 index c84a7bff..00000000 --- a/kubectl/crd.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# log-router CRD resource: -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: fluentdconfigs.logs.vdp.vmware.com - spec: - conversion: - strategy: None - group: logs.vdp.vmware.com - names: - kind: FluentdConfig - listKind: FluentdConfigList - plural: fluentdconfigs - singular: fluentdconfig - scope: Namespaced - versions: - - name: v1beta1 - schema: - openAPIV3Schema: - properties: - spec: - properties: - fluentconf: - type: string - type: object - type: object - served: true - storage: true diff --git a/kubectl/crd.yaml b/kubectl/crd.yaml new file mode 120000 index 00000000..c5c4b9c7 --- /dev/null +++ b/kubectl/crd.yaml @@ -0,0 +1 @@ +../charts/log-router/crds/crd.yaml \ No newline at end of file