Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Capi machines #31

Merged
merged 4 commits into from
Jan 11, 2021
Merged

Capi machines #31

merged 4 commits into from
Jan 11, 2021

Conversation

enxebre
Copy link
Contributor

@enxebre enxebre commented Dec 11, 2020

This drops openshift machine API in favour of capi machine management.
Move guestInfraCluster to externalInfraCluster to satisfy kubernetes-sigs/cluster-api-provider-aws#2124
Run capa controller manager
Enable automation for creating a secret with aws credentials for the guest cluster/machine controller.

Copy link
Contributor

@csrwng csrwng left a comment

Choose a reason for hiding this comment

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

@enxebre looks awesome. Some comments.

hypershift-operator/controllers/nodepool_controller.go Outdated Show resolved Hide resolved
UncompressedUserData: k8sutilspointer.BoolPtr(true),
CloudInit: capiaws.CloudInit{
InsecureSkipSecretsManager: true,
SecureSecretsBackend: "secrets-manager",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, what does this do?

config/example-cluster/cluster.yaml Outdated Show resolved Hide resolved
config/example-cluster/kustomization.yaml Outdated Show resolved Hide resolved
README.md Outdated
@@ -27,7 +27,8 @@ $ make uninstall
First, create the following files containing secrets used by the example cluster:

- `config/example-cluster/pull-secret` a valid pull secret for image pulls.
- `config/example-cluster/ssh-key` an SSH public key for guest node access
- `config/example-cluster/ssh-key` an SSH public key for guest node access.
- `config/example-cluster/aws-creds` a base64 encoded [aws credentials file](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html).
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is the right place for this secret. It's a secret required by the capa controller deployment, but these secrets are created along with an example cluster, so you won't get a running capa controller until you create the example cluster.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, I don't think it needs to be base64 encoded. Kustomize should base64 encode it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the capa controller down to the operator control. Also the secret is copied now into the target ns similar to what we do with the pull-secret.

This drops openshift machine API in favour of capi machine management. It moves guestInfraCluster to externalInfraCluster to satisfy kubernetes-sigs/cluster-api-provider-aws#2124
Copy link
Contributor

@csrwng csrwng left a comment

Choose a reason for hiding this comment

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

@enxebre looking good... gave it another pass. Just thinking about the name ExternalInfraCluster ... should we not name it something more specific to AWS ? like 'HostedAWSInfra' or something like that?
Also, since you already made the change upstream to decouple things, and we get the node linking for free with this, I don't see a reason not to merge this when ready. @ironcladlou do you agree?

@@ -0,0 +1,2158 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

This file is not needed anymore

}
providerCredsData, hasProviderCredsData := providerCredsSecret.Data["credentials"]
if !hasProviderCredsData {
return fmt.Errorf("pull secret %s is missing the .dockerconfigjson key", hcp.Spec.PullSecret.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong error message

@@ -5,21 +5,20 @@ import (
"fmt"
Copy link
Contributor

Choose a reason for hiding this comment

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

@@ -24,18 +24,18 @@ import (
"sigs.k8s.io/controller-runtime/pkg/reconcile"
)

type GuestClusterReconciler struct {
type ExternalInfraClusterReconciler struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

@derekwaynecarr
Copy link
Contributor

just capturing follow-up from our discussion this morning:

  • do we use the version field on machine spec/status?
  • is decoupling for providers other than aws in flight?

@enxebre
Copy link
Contributor Author

enxebre commented Jan 11, 2021

do we use the version field on machine spec/status?

The version field is purely an option to override the bootstrap provider value if any https://github.com/kubernetes-sigs/cluster-api/blob/f5939fd5246e7f1682399e8004e5fd[…]65240/bootstrap/kubeadm/controllers/kubeadmconfig_controller.go

We don't use it atm, since we generate static ignition which is then injected as a secret into the machineSpec. If we ever have a bootstrap provider for this we might want to use it.

@ironcladlou ironcladlou merged commit d12d2f5 into openshift-hive:main Jan 11, 2021
@ironcladlou
Copy link
Contributor

@enxebre thanks for all this work!

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

Successfully merging this pull request may close these issues.

4 participants