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

Use CAPI operator to manage providers #224

Merged
merged 8 commits into from
Aug 28, 2024

Conversation

eromanova
Copy link
Member

@eromanova eromanova commented Aug 22, 2024

This PR introduces the following changes:

  1. Add CAPI operator sub chart to HMC. The CAPI operator requires the cert-manager to be installed, thus, this subchart is disabled by default and will be enabled by the HMC controller once the cert-manager is ready. It's also allowed to disable the CAPI operator shipped with HMC to support an external CAPI operator installation.
  2. Rework cluster API, cluster API provider AWS, and k0smotron templates to use CAPI operator resources.
  3. Change AWS credentials secret data to follow the format required by the CAPI operator.
  4. Allow passing providers configuration options in the secret.
  5. Change docs accordingly.
  6. Added CAPZ template (enabled by default).

Providers configuration

The CAPI operator allows passing configSecret with all the configuration variables: https://doc.crds.dev/github.com/kubernetes-sigs/cluster-api-operator/operator.cluster.x-k8s.io/InfrastructureProvider/[email protected]#spec-configSecret

HMC provider templates were adapted to either pass a pre-created configuration secret name and namespace or receive the configuration parameters as helm chart values (the secret with the provided configuration will be automatically created). This PR introduces the common structure for passing providers' additional parameters.

Examples:

  1. To pass the pre-created configuration secret, set:
configSecret:
  name: variables-secret-name
  namespace: variables-secret-namespace // optional. Defaults to `hmc-system`
  1. To pass the configuration as a helm value and create a secret with the configuration automatically, set:
configSecret:
  create: true
  name: variables-secret-name // required 
  namespace: variables-secret-namespace // optional. Defaults to `hmc-system`
config:
  CAPI_INSECURE_DIAGNOSTICS: "true"
  1. If no overrides for the provider are required and the configSecret configuration is unset, the provider will be deployed with the defaults.

Closes #214
Closes #215

@eromanova eromanova marked this pull request as draft August 23, 2024 07:51
@eromanova eromanova marked this pull request as ready for review August 23, 2024 09:41
@eromanova eromanova self-assigned this Aug 23, 2024
internal/controller/management_controller.go Show resolved Hide resolved
templates/cluster-api/values.yaml Outdated Show resolved Hide resolved
@eromanova eromanova marked this pull request as draft August 23, 2024 13:23
@eromanova eromanova force-pushed the capi-operator branch 2 times, most recently from 826cb13 to 844cb44 Compare August 26, 2024 12:08
@eromanova eromanova marked this pull request as ready for review August 26, 2024 12:11
@eromanova eromanova requested a review from Kshatrix August 27, 2024 08:33
Disabled by default. It'll be enabled later
by the hmc controller once the cert manager is ready.

Also, overwride the default controller resource requests
and limits since default values are not enough and the pod
gets OOMKilled when creating the provider with manifestPatches.

Closes Mirantis#215
Since CAPA requires exactly AWS_B64ENCODED_CREDENTIALS key
@Kshatrix Kshatrix merged commit 182e369 into Mirantis:main Aug 28, 2024
1 check passed
@eromanova eromanova deleted the capi-operator branch October 29, 2024 14:06
bnallapeta pushed a commit to bnallapeta/hmc that referenced this pull request Nov 15, 2024
Use CAPI operator to manage providers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Install CAPI Operator as part of the HMC chart Use CAPI Operator to manage providers
3 participants