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

✨ Ability to add provider specific featureGates with Helm #448

Merged
merged 5 commits into from
Apr 8, 2024

Conversation

oprinmarius
Copy link
Member

@oprinmarius oprinmarius commented Mar 6, 2024

What this PR does / why we need it:
Ability to add provider specific featureGates.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #447

I used the following values:

image:
  manager:
    tag: v0.9.0
cert-manager:
  enabled: false
  installCRDs: false
addon: helm
infrastructure: "aws:v2.4.0"
core: "cluster-api:v1.6.2"
configSecret: 
  name: aws-variables
  namespace: default
manager:
  featureGates:
    core:
      ClusterTopology: true
      MachinePool: true     
    aws:
      EKSEnableIAM: true
      EKSAllowAddRoles: true
      ClusterTopology: true
      MachinePool: true

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 6, 2024
Copy link

netlify bot commented Mar 6, 2024

Deploy Preview for kubernetes-sigs-cluster-api-operator ready!

Name Link
🔨 Latest commit ea3ba4c
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-operator/deploys/6613d8aad4ce0e0008475543
😎 Deploy Preview https://deploy-preview-448--kubernetes-sigs-cluster-api-operator.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@oprinmarius oprinmarius changed the title ✨ Ability to add provider specific featureGates ✨ Ability to add provider specific featureGates with Helm Mar 6, 2024
@zioproto
Copy link
Contributor

zioproto commented Mar 6, 2024

How do you test this?

I tried:

cd cluster-api-operator/hack/charts
helm template --set infrastructure=azure:v1.13.2   \
                         --set addon=helm --set cert-manager.enabled=false \
                         --set image.manager.tag=v0.9.0 \
                         --set manager.featureGates.core.MachinePool=true  \
                         --set manager.featureGates.azure.MachinePool=true  \
                         --set manager.featureGates.azure.ClusterTopology=true \
                         --set manager.featureGates.azure.ClusterResourceSet=true \
                         --wait capi ./cluster-api-operator

But the template core.yaml is not rendered. However I don't pass additional --set values when I use the chart.

@oprinmarius
Copy link
Member Author

How do you test this?

I tried:

cd cluster-api-operator/hack/charts
helm template --set infrastructure=azure:v1.13.2   \
                         --set addon=helm --set cert-manager.enabled=false \
                         --set image.manager.tag=v0.9.0 \
                         --set manager.featureGates.core.MachinePool=true  \
                         --set manager.featureGates.azure.MachinePool=true  \
                         --set manager.featureGates.azure.ClusterTopology=true \
                         --set manager.featureGates.azure.ClusterResourceSet=true \
                         --wait capi ./cluster-api-operator

But the template core.yaml is not rendered. However I don't pass additional --set values when I use the chart.

I used the following values:

image:
  manager:
    tag: v0.9.0
cert-manager:
  enabled: false
  installCRDs: false
addon: helm
infrastructure: "aws:v2.4.0"
core: "cluster-api:v1.6.2"
configSecret: 
  name: aws-variables
  namespace: default
manager:
  featureGates:
    core:
      ClusterTopology: true
      MachinePool: true     
    aws:
      EKSEnableIAM: true
      EKSAllowAddRoles: true
      ClusterTopology: true
      MachinePool: true

@oprinmarius
Copy link
Member Author

oprinmarius commented Mar 6, 2024

@zioproto I think you need to specify core provider version or a secret for the template to be rendered:

{{- if or $coreVersion $.Values.configSecret.name }}

@alexander-demicev
Copy link
Contributor

Hi, thanks for working on this. We have a set of e2e tests for ensuring helm chart works as expected https://github.com/kubernetes-sigs/cluster-api-operator/blob/main/test/e2e/helm_test.go. Can you add some tests for feature gates there?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 8, 2024
@zioproto
Copy link
Contributor

zioproto commented Apr 8, 2024

@alexander-demicev could you please review the implemented test ?

What I want you to double check is this comparison:

Expect(manifests).To(Equal(string(expectedManifests)))

It seems manifests generated with the helmChart.Run() function, is missing the capi-cluster-api-operator Deployment. This Deployment is actually there when using helm from command line.

For this reason I had to drop the deployment from expectedManifests:

35e6d85

I don't understand why the Deployment capi-cluster-api-operator is missing, please clarify if what is implemented here is correct. Thanks

@alexander-demicev
Copy link
Contributor

@zioproto by default helmChart.Run(...) will only print resources that helm hooks, that's why only providers are in the output.

Copy link
Contributor

@alexander-demicev alexander-demicev left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2024
@jackfrancis
Copy link
Contributor

Apologies for the blast

@Danil-Grigorev @Fedosin @alexander-demicev @damdo @furkatgofurov7 could we get an lgtm to land this fix and unblock some provider workflows that use cluster-api-operator?

Thank you!

Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexander-demicev, Danil-Grigorev

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Danil-Grigorev,alexander-demicev]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@Danil-Grigorev Danil-Grigorev left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 8, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 25d10c2517dbaa24ae69dcb1153bdc6688cdd466

@k8s-ci-robot k8s-ci-robot merged commit cea7b52 into kubernetes-sigs:main Apr 8, 2024
14 checks passed
@jackfrancis
Copy link
Contributor

/cherrypick release-0.9

@k8s-infra-cherrypick-robot

@jackfrancis: new pull request created: #484

In response to this:

/cherrypick release-0.9

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

zioproto added a commit to Azure-Samples/aks-platform-engineering that referenced this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to add provider specific featureGates with Helm
7 participants