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

pkg/asset: Add asset for Master machines #491

Merged
merged 1 commit into from
Oct 19, 2018

Conversation

csrwng
Copy link
Contributor

@csrwng csrwng commented Oct 18, 2018

Generate resources for master machines that can be adopted by the Cluster API machine controller.

@csrwng
Copy link
Contributor Author

csrwng commented Oct 18, 2018

@abhinavdahiya as promised
Needs testing, particularly the libvirt and openstack bits

ClusterName string
AMIID string
Tags map[string]string
Region string
Copy link
Member

@wking wking Oct 18, 2018

Choose a reason for hiding this comment

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

I think populating this will be more straightforward if we just add an AWSPlatform property. You could even use DefaultMachinePlatform instead of your current Machine.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could even use DefaultMachinePlatform instead of your current Machine

that opens up the api to vpc, vpccidr block, which might not be ideal

You could even use DefaultMachinePlatform instead of your current Machine.

I don't think that would be correct, we need to account for 3 sources to create the machine.

  • installer defaults for unfilled values in install config
  • defaultmachineplatform
  • machinepoolplatform

Copy link
Member

Choose a reason for hiding this comment

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

that opens up the api to vpc, vpccidr block, which might not be ideal

So create a new type for the shared fields (region and tags, maybe also the AMI?)? You could also push tags and the AMI down into AWSMachinePoolPlatform, although you'd want to leave a tags entry on AWSPlatform for tagging non-machine resources. But I'd like to minimize the number of slightly-different phrasings of types in this space if possible.

You could even use DefaultMachinePlatform instead of your current Machine.

I don't think that would be correct, we need to account for 3 sources to create the machine.

  • installer defaults for unfilled values in install config
  • defaultmachineplatform
  • machinepoolplatform

Sorry, I was trying to suggest using the DefaultMachinePlatform property on a local instance of the AWSPlatform type. You could fill in that information using all of the usual install-config sources. I agree you don't want to use the install-config AWSPlatform.DefaultMachinePlatform instance directly.

"github.com/aws/aws-sdk-go/service/ec2"
)

// AvailabilityZones retrieves a list of availability zones for the given region
Copy link
Member

Choose a reason for hiding this comment

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

nit: this is missing a trailing period (docs).

resourceVersion: ""
selfLink: ""
items:
{{- range $index,$instance := .Instances}}
Copy link
Contributor

Choose a reason for hiding this comment

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

$c.Instances


func ec2Client(region string) (*ec2.EC2, error) {
awsConfig := &aws.Config{Region: aws.String(region)}
s, err := session.NewSession(awsConfig)
Copy link
Member

Choose a reason for hiding this comment

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

I think we should follow this pattern to create AWS sessions. For example, I can't see the govcloud-us region or its availability zones.

Copy link
Contributor

@abhinavdahiya abhinavdahiya Oct 18, 2018

Choose a reason for hiding this comment

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

+1 for session.

@abhinavdahiya
Copy link
Contributor

/cc @flaper87
can you see if the Machine object for Openstack is correct..?

@tomassedovic
Copy link
Contributor

@abhinavdahiya @flaper87 I've checked this for OpenStack and it looks good to me. The deployment works just as it did before too so there's no breakage as far as I can see.

@openshift-ci-robot openshift-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 19, 2018
@csrwng
Copy link
Contributor Author

csrwng commented Oct 19, 2018

/test golint

@csrwng csrwng changed the title WIP: pkg/asset: Add asset for Master machines pkg/asset: Add asset for Master machines Oct 19, 2018
@csrwng
Copy link
Contributor Author

csrwng commented Oct 19, 2018

@abhinavdahiya @wking thank you for the review. Comments addressed.

@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 19, 2018
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, csrwng

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:

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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 19, 2018
@openshift-merge-robot openshift-merge-robot merged commit f6477cc into openshift:master Oct 19, 2018
wking added a commit to wking/openshift-installer that referenced this pull request Oct 20, 2018
Adds ClusterK8sIO from e2dc955 (pkg/asset: add ClusterK8sIO,
machines.Worker assets, 2018-10-15, openshift#468) and Master from 586ad45
(pkg/asset: Add asset for Master machines, 2018-10-18, openshift#491).  Removes
KubeCoreOperator from c9b0e2f (manifests: stop using kube core
operator, 2018-10-08, openshift#420).

Generated with:

  $ openshift-install graph | dot -Tsvg >docs/design/resource_dep.svg

using:

  $ dot -V
  dot - graphviz version 2.30.1 (20170916.1124)
enxebre added a commit to enxebre/installer that referenced this pull request Apr 29, 2019
Master machine assets were introduced by openshift#491 to adopt instances generated by tf. There was never a follow up to leverage adoption for fatrther addon features. Unless there's a good reason to keep the adoption, this PR removes the machine API master awareness and assets generation
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. lgtm 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.

6 participants