Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New manifests to get it working on Kubernetes 1.22 #139

Open
tboerger opened this issue Apr 5, 2022 · 3 comments
Open

New manifests to get it working on Kubernetes 1.22 #139

tboerger opened this issue Apr 5, 2022 · 3 comments

Comments

@tboerger
Copy link

tboerger commented Apr 5, 2022

I really had problems to get controller working on Kubernetes 1.22. I have written an entirely new manifest and I would like to get some feedback. If everything makes sense I could also create a PR, so far it seem to work correctly after updating the CRD. I also tried to embed the CRD similar to ibuildthecloud/klum, but failed with the dependencies:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: helmchartconfigs.helm.cattle.io
  namespace: kube-system
spec:
  group: helm.cattle.io
  names:
    categories:
    - helm
    kind: HelmChartConfig
    listKind: HelmChartConfigList
    plural: helmchartconfigs
    shortNames: []
    singular: helmchartconfig
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: null
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: Desired state of the HelmChartConfig resource.
            properties:
              failurePolicy:
                description: null
                type: string
              valuesContent:
                description: null
                type: string
            required: []
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: helmcharts.helm.cattle.io
  namespace: kube-system
spec:
  group: helm.cattle.io
  names:
    categories:
    - helm
    kind: HelmChart
    listKind: HelmChartList
    plural: helmcharts
    shortNames: []
    singular: helmchart
  scope: Namespaced
  versions:
  - name: v1
    schema:
      openAPIV3Schema:
        description: null
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: Desired state of the HelmChart resource.
            properties:
              bootstrap:
                description: null
                type: boolean
              chart:
                description: null
                type: string
              chartContent:
                description: null
                type: string
              failurePolicy:
                description: null
                type: string
              helmVersion:
                description: null
                type: string
              jobImage:
                description: null
                type: string
              repo:
                description: null
                type: string
              repoCA:
                description: null
                type: string
              set:
                description: null
                type: object
                x-kubernetes-preserve-unknown-fields: true
              targetNamespace:
                description: null
                type: string
              timeout:
                description: null
                type: string
              valuesContent:
                description: null
                type: string
              version:
                description: null
                type: string
            required: []
            type: object
        required:
        - spec
        type: object
    served: true
    storage: true
---
apiVersion: v1
kind: ServiceAccount
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: helm-controller
  name: helm-controller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: helm-controller
  name: helm-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: helm-controller
  namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/component: controller
    app.kubernetes.io/name: helm-controller
  name: helm-controller
  namespace: kube-system
spec:
  replicas: 1
  revisionHistoryLimit: 3
  selector:
    matchLabels:
      app.kubernetes.io/component: controller
      app.kubernetes.io/name: helm-controller
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app.kubernetes.io/component: controller
        app.kubernetes.io/name: helm-controller
    spec:
      containers:
      - command:
        - helm-controller
        image: rancher/helm-controller:v0.12.0
        imagePullPolicy: IfNotPresent
        name: server
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 100m
            memory: 64Mi
      enableServiceLinks: false
      serviceAccountName: helm-controller
@amilstead
Copy link

FWIW, @tboerger this manifest worked for me using kubernetes from Docker Desktop on 1.22.

@angelbarrera92
Copy link

It also worked for me in a kubeadm 1.23.5 kubernetes cluster.

@Enity
Copy link

Enity commented Mar 25, 2023

  • 1.23.15 it works. manifest from master produces rbac errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants