how the HelmCharts upgrade from apiextensions.k8s.io/v1beta1 to apiextensions.k8s.io/v1
oeular opened this issue · 11 comments
when change the apiextensions.k8s.io/v1beta1 to apiextensions.k8s.io/v1, errors occur——
error: error validating "helmchart.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): missing required field "versions" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
the original yaml is from https://github.com/k3s-io/helm-controller/blob/master/manifests/deploy-cluster-scoped.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: helmcharts.helm.cattle.io
namespace: kube-system
spec:
group: helm.cattle.io
version: v1
names:
kind: HelmChart
plural: helmcharts
singular: helmchart
scope: Cluster
So is the project still maintaining?
We don't really use that CRD, since the helm controller is usually deployed embedded in RKE2 or K3s, and it will create the CRDs itself using the correct version of the CRD API for whatever cluster it's running on. If you want to use those manifests, just change apiextensions.k8s.io/v1beta1
to apiextensions.k8s.io/v1
if deploying on a Kubernetes version that no longer supports v1beta1 of that API.
And to answer your other question, yes, this project is actively maintained, but only really as a subcomponent of other projects.
@brandond Thanks for your answer.
In fact ,I try to change the version from v1beta1 to v1, but error happens, just as the following:
error: error validating "helmchart.yaml": error validating data: [ValidationError(CustomResourceDefinition.spec): unknown field "version" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec, ValidationError(CustomResourceDefinition.spec): missing required field "versions" in io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1.CustomResourceDefinitionSpec]; if you choose to ignore these errors, turn validation off with --validate=false
the original yaml is from https://github.com/k3s-io/helm-controller/blob/master/manifests/deploy-cluster-scoped.yaml
Hmm, fair enough it may need some additional modifications for more recent versions of Kubernetes.
What are you trying to accomplish? If you run the controller it will generate and load the CRDs during startup; this is how it's usually used.
I want to install helm-controller for installing other helm chats resources in Kubernetes, and only need the helm-controller. So I want to install related CRDs of helm-controller and deploy helm-controller.
And I think helm-controller need to be install with this original method, just as a common controller.
You don't need to install the CRD to deploy the controller. As I said above, the CRD will be created by the controller when it first starts up. I'll leave this issue open so that we can track updating the CRD manifest checked in to this repo, but it should not block you from deploying the controller to your cluster.
I've opened a PR to add a CRD release artifact, in the mean time you can use this:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: helmcharts.helm.cattle.io
spec:
group: helm.cattle.io
names:
kind: HelmChart
plural: helmcharts
singular: helmchart
preserveUnknownFields: false
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.jobName
name: Job
type: string
- jsonPath: .spec.chart
name: Chart
type: string
- jsonPath: .spec.targetNamespace
name: TargetNamespace
type: string
- jsonPath: .spec.version
name: Version
type: string
- jsonPath: .spec.repo
name: Repo
type: string
- jsonPath: .spec.helmVersion
name: HelmVersion
type: string
- jsonPath: .spec.bootstrap
name: Bootstrap
type: string
name: v1
schema:
openAPIV3Schema:
properties:
spec:
properties:
bootstrap:
type: boolean
chart:
nullable: true
type: string
chartContent:
nullable: true
type: string
failurePolicy:
nullable: true
type: string
helmVersion:
nullable: true
type: string
jobImage:
nullable: true
type: string
repo:
nullable: true
type: string
repoCA:
nullable: true
type: string
set:
additionalProperties:
nullable: true
type: string
nullable: true
type: object
targetNamespace:
nullable: true
type: string
timeout:
nullable: true
type: string
valuesContent:
nullable: true
type: string
version:
nullable: true
type: string
type: object
status:
properties:
jobName:
nullable: true
type: string
type: object
type: object
served: true
storage: true
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: helmchartconfigs.helm.cattle.io
spec:
group: helm.cattle.io
names:
kind: HelmChartConfig
plural: helmchartconfigs
singular: helmchartconfig
preserveUnknownFields: false
scope: Namespaced
versions:
- name: v1
schema:
openAPIV3Schema:
properties:
spec:
properties:
failurePolicy:
nullable: true
type: string
valuesContent:
nullable: true
type: string
type: object
type: object
served: true
storage: true
When start the k3s-helm-controller, something is wrong, logs are here:
E0511 05:13:16.956238 1 reflector.go:126] github.com/rancher/helm-controller/pkg/generated/informers/externalversions/factory.go:117: Failed to list *v1.HelmChart: the server could not find the requested resource (get helmcharts.k3s.cattle.io)
here is my deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: k3s-helm-controller
namespace: kube-system
labels:
app: k3s-helm-controller
spec:
replicas: 1
selector:
matchLabels:
app: k3s-helm-controller
template:
metadata:
labels:
app: k3s-helm-controller
spec:
containers:
- name: k3s-helm-controller
image: rancher/helm-controller:v0.1.2
command: ["helm-controller"]
And when I use the crds from the above, also something is wrong, logs are here
The CustomResourceDefinition "helmcharts.helm.cattle.io" is invalid:
- spec.additionalPrinterColumns[3].JSONPath: Invalid value: "spec.version": must be a simple json path starting with .
- spec.additionalPrinterColumns[4].JSONPath: Invalid value: "spec.repo": must be a simple json path starting with .
- spec.additionalPrinterColumns[5].JSONPath: Invalid value: "spec.helmVersion": must be a simple json path starting with .
- spec.additionalPrinterColumns[6].JSONPath: Invalid value: "spec.bootstrap": must be a simple json path starting with .
Sorry, couple typos in there. Updated the comment, please try again.