Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

feat: get helm config from a well known configmap #27

Merged
merged 15 commits into from
Apr 9, 2024

Conversation

faiq
Copy link

@faiq faiq commented Apr 4, 2024

This deploys a helm chart with our helm addon configuration for CAREN's configuration. Other components are not expected to interact with this on a per cluster basis. This also allows the user some flexibility/insight into what addons are deployed.

The config map contains information such as version, chart name, and repository url.

The next step would be adding a field under clusterConfig.addons called helmRegistry which would be used in conjunction with this configmap to support pulling helmCharts from private registries.

See this example below for examples of the configmap and it being used to generate helmchartproxy.

$ kubectl get cm default-helm-addons-config -o yaml
apiVersion: v1
data:
  aws-ccm-config: |
    defaultChartName: aws-cloud-controller-manager
    defaultChartVersion: ""
    defaultRepositoryUrl: https://kubernetes.github.io/cloud-provider-aws
  aws-ebs-csi-config: |
    defaultChartName: aws-ebs-csi-driver
    defaultChartVersion: v2.28.1
    defaultRepositoryUrl: https://kubernetes-sigs.github.io/aws-ebs-csi-driver
  cilium-config: |
    defaultChartName: cilium
    defaultChartVersion: 1.15.0
    defaultRepositoryUrl: https://helm.cilium.io/
  cluster-autoscaler-config: |
    defaultChartName: cluster-autoscaler
    defaultChartVersion: 9.35.0
    defaultRepositoryUrl: https://kubernetes.github.io/autoscaler
  nfd-config: |
    defaultChartName: node-feature-discovery
    defaultChartVersion: 0.15.2
    defaultRepositoryUrl: https://kubernetes-sigs.github.io/node-feature-discovery/charts
  nutanix-csi-config: |
    defaultChartName: nutanix-csi-storage
    defaultChartVersion: v2.6.6
    defaultRepositoryUrl: https://nutanix.github.io/helm/
  tigera-operator-config: |
    defaultChartName: tigera-operator
    defaultChartVersion: v3.26.4
    defaultRepositoryUrl: https://docs.tigera.io/calico/charts
kind: ConfigMap
metadata:
  annotations:
    meta.helm.sh/release-name: cluster-api-runtime-extensions-nutanix
    meta.helm.sh/release-namespace: default
  creationTimestamp: "2024-04-04T16:01:07Z"
  labels:
    app.kubernetes.io/managed-by: Helm
  name: default-helm-addons-config
  namespace: default
  resourceVersion: "3895"
  uid: f5726498-2a3b-4f5f-81df-0a55b7bd349d

here is an example of a generate helm chart proxy

- apiVersion: addons.cluster.x-k8s.io/v1alpha1
  kind: HelmChartProxy
  metadata:
    creationTimestamp: "2024-04-04T17:24:49Z"
    finalizers:
    - helmchartproxy.addons.cluster.x-k8s.io
    generation: 1
    name: node-feature-discovery-faiq-settings-from-cm-3
    namespace: default
    ownerReferences:
    - apiVersion: cluster.x-k8s.io/v1beta1
      kind: Cluster
      name: faiq-settings-from-cm-3
      uid: 94d04222-84ca-41e0-ba19-5e2696ec1206
    resourceVersion: "28667"
    uid: 054e16d1-3c23-4a5c-8a39-3e408b7d6c4d
  spec:
    chartName: node-feature-discovery
    clusterSelector:
      matchLabels:
        cluster.x-k8s.io/cluster-name: faiq-settings-from-cm-3
    namespace: node-feature-discovery
    options:
      enableClientCache: false
      install:
        createNamespace: true
      timeout: 10m0s
      upgrade:
        maxHistory: 10
    releaseName: node-feature-discovery
    repoURL: https://kubernetes-sigs.github.io/node-feature-discovery/charts
    valuesTemplate: |
      master:
        extraLabelNs:
          - nvidia.com
          - beta.amd.com
          - amd.com

      worker: ### <NFD-WORKER-CONF-START-DO-NOT-REMOVE>
        config:
          sources:
            pci:
              deviceLabelFields:
                - "class"
                - "vendor"
        tolerations:
          - effect: NoSchedule
            key: node-role.kubernetes.io/master
          - effect: NoSchedule
            key: node-role.kubernetes.io/control-plane
      ### <NFD-WORKER-CONF-END-DO-NOT-REMOVE>
      image:
        tag: v0.15.2-minimal
    version: 0.15.2

@faiq faiq self-assigned this Apr 4, 2024
@faiq faiq changed the title feat: get helm config from a wellknown configmap feat: get helm config from a well known configmap Apr 4, 2024
@github-actions github-actions bot added feature and removed feature labels Apr 4, 2024
@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch 2 times, most recently from 876157a to 5770b04 Compare April 4, 2024 17:55
@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch from 5770b04 to 2fca7f9 Compare April 4, 2024 18:18
@github-actions github-actions bot added feature and removed feature labels Apr 4, 2024
@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch from fdca540 to d2410f1 Compare April 5, 2024 18:35
@supershal
Copy link

Is there any consideration about how many versions (X-??) of an add-on helm chart CAREN should be supporting between creating cluster and upgrading it to next version?

@faiq
Copy link
Author

faiq commented Apr 8, 2024

Is there any consideration about how many versions (X-??) of an add-on helm chart CAREN should be supporting between creating cluster and upgrading it to next version?

No and there was none previously either. Each DKP release will have set addons that we support

@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch 2 times, most recently from 81efb0c to 7969d1b Compare April 8, 2024 17:44
Copy link
Collaborator

@dkoshkin dkoshkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great changes, just had a question on aws-ccm

@supershal
Copy link

a dev doc or readme about how a developer can change add-on helm configuration would be nice.

@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch from 7969d1b to ed362df Compare April 9, 2024 18:07
@faiq
Copy link
Author

faiq commented Apr 9, 2024

I added the warning. As far dev docs go, we don't really have a structure for using them and I don't really think its needed at this point either

@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch from 319d204 to d57fa75 Compare April 9, 2024 18:43
Copy link

@supershal supershal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the improvement.

@faiq faiq force-pushed the faiq/helm-addon-config-from-configmap branch from aa0f5de to eba2351 Compare April 9, 2024 19:13
@faiq faiq enabled auto-merge (squash) April 9, 2024 19:13
@faiq faiq merged commit 9b92854 into main Apr 9, 2024
16 checks passed
@faiq faiq deleted the faiq/helm-addon-config-from-configmap branch April 9, 2024 19:28
@github-actions github-actions bot mentioned this pull request Apr 9, 2024
jimmidyson pushed a commit that referenced this pull request Apr 11, 2024
* ci: adds tooling to create configmap

* feat: use a configmap to get helmchart info

* fix: precommit issues

* fix: typo in cilium

* fix: remove workspace files

* build: template name for configmap

* refactor: names for helm chart info getter

* refactor: use nutanix-storage name instead of nutnaix-csi

* refactor: move to globaloptions

* fix: adds snapshot to helm config

* fix: comments after review

* fix: adds a warning and removes ebs csi

* fix: typo

* fix: adds missing script file

* fix: precommit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants