Skip to content

Conversation

@rajatchopra
Copy link

Just the scaffolding and some skeleton for the kubecore operator.
Follow up commits will fill up kubecore and figure out what to do with clusterversion operator etc.

@wking @staebler @yifan-gu @abhinavdahiya Feedback please. I still have less grasp about the order of operators (or even the list of them all).

Signed-off-by: Rajat Chopra [email protected]

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rajatchopra

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

The pull request process is described here

Details 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 approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 31, 2018
@wking
Copy link
Member

wking commented Aug 31, 2018

/lint

Copy link
Contributor

@openshift-ci-robot openshift-ci-robot left a comment

Choose a reason for hiding this comment

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

@wking: 11 warnings.

Details

In response to this:

/lint

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported type StockImpl should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method StockImpl.EstablishStock should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method StockImpl.Operators should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method StockImpl.ClusterVersionOperator should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported method StockImpl.NetworkOperator should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: exported type Stock should have comment or be unexported. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

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

Golint errors: error strings should not be capitalized or end with punctuation or a newline. More info.

Copy link
Member

@wking wking left a comment

Choose a reason for hiding this comment

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

Sorry for the nit-level review :p, but I thought I'd comment on these while I was wrapping my head around where you were going.

I'm personally not clear on how much of this is going to get stubbed into the asset graph (as you have here) to be set up pre-Terraform (although there are hints of this approach in some stale docs). I'm working on internalizing the existing discussion on this, and then I'll give this PR another look.

Copy link
Member

Choose a reason for hiding this comment

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

nit: you can use GetInstallConfig (new in #160) for this.

Copy link
Member

Choose a reason for hiding this comment

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

nit: I'd rather pass the *InstallConfig through as an argument here, instead of holding a copy in the kubeCoreOperator struct itself.

@rajatchopra rajatchopra force-pushed the operators branch 2 times, most recently from 4e1d28d to 85e32be Compare September 11, 2018 23:28
@openshift-ci-robot openshift-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 11, 2018
Copy link
Contributor

Choose a reason for hiding this comment

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

can you rename the file to kube_addon_operator.go seems like other files follow that convention.

Copy link
Contributor

Choose a reason for hiding this comment

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

can you pass installconfig to the func rather than implicit through kao? eg: https://github.com/openshift/installer/blob/master/pkg/asset/ignition/bootstrap.go#L131

Copy link
Contributor

Choose a reason for hiding this comment

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

tectonicCloudProvider like functions should be part of installconfig package.

Copy link
Contributor

Choose a reason for hiding this comment

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

getAPIServerURL: tls package might have required something similar too, maybe some common package?(installconfig)

Copy link
Contributor

@abhinavdahiya abhinavdahiya Sep 15, 2018

Choose a reason for hiding this comment

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

all these functions seem like will be used by multiple assets. there should be a common source of finding these.

Copy link
Contributor

Choose a reason for hiding this comment

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

This asset generate seems to be just cluster config, Can we have these configs be separate assets?

Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be a function that us already present in some common package?

Copy link
Author

Choose a reason for hiding this comment

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

Ack.
Maybe all of this file's contents can be moved out. This is the common utils package being born.

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 15, 2018
@rajatchopra rajatchopra force-pushed the operators branch 3 times, most recently from 4b51486 to 1312e0a Compare September 17, 2018 21:46
@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 17, 2018
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't install TNCO anymore. Please use MCO instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please use consistent names.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

This name isn't very accurate. It's two different configs that really should be separate assets.

Copy link
Author

Choose a reason for hiding this comment

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

I didn't get this. Explain? Its the parent (gathering asset) and the dependent assets.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, that comment was supposed to be on the StockImpl in pkg/asset/operators/stock.go.

Copy link
Contributor

Choose a reason for hiding this comment

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

Without this populated, the asset store panics.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed that. The main.go has an operators command. It runs and dumps the config.yaml.

Rajat Chopra added 2 commits September 17, 2018 20:35
operator config and manifests for:
1. tnco (to be replaced by mco)
2. network-operator
3. kube-core-operator
4. kube-addon-operator
var (
installConfigCommand = kingpin.Command("install-config", "Generate the Install Config asset")
ignitionConfigsCommand = kingpin.Command("ignition-configs", "Generate the Ignition Config assets")
operatorsCommand = kingpin.Command("operators", "Generate the Operator assets")
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be called "manifests".

}
case operatorsCommand.FullCommand():
targetAssets = []asset.Asset{
assetStock.Operators(),
Copy link
Contributor

Choose a reason for hiding this comment

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

What about all of the other manifests? This only renders openshift-config.yaml and cluster-config.yaml (which is very confusing given the name of this asset.

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// kubeAddonOperator generates the network-operator-*.yml files
Copy link
Contributor

Choose a reason for hiding this comment

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

Use yaml instead of yml.

Data: addonConfig,
},
{
Name: filepath.Join(kao.directory, "kube-addon-operator-manifests.yml"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Singular manifest.

}

func (kao *kubeAddonOperator) getAPIServerURL() string {
return fmt.Sprintf("https://%s-api.%s:6443", kao.installConfig.ClusterName, kao.installConfig.BaseDomain)
Copy link
Contributor

Choose a reason for hiding this comment

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

This ends up as https://-api.base.domain:6443 on my system.

}
addonConfig.CloudProvider = tectonicCloudProvider(kao.installConfig.Platform)
addonConfig.ClusterConfig.APIServerURL = kao.getAPIServerURL()
registrySecret, err := generateRandomID(16)
Copy link
Contributor

Choose a reason for hiding this comment

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

Just use

instead.

@wking
Copy link
Member

wking commented Sep 19, 2018

Replaced by #286.

@wking wking closed this Sep 19, 2018
@rajatchopra rajatchopra deleted the operators branch October 11, 2018 20:11
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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants