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

asset/manifests: bootstrap manifest generation #286

Merged
merged 1 commit into from
Sep 20, 2018

Conversation

rajatchopra
Copy link

@rajatchopra rajatchopra commented Sep 19, 2018

asset/manifests: bootstrap manifest generation

All manifest files required for bootstrap operations are generated. The operators covered include:
1. network-operator
2. kube-core-operator
3. kube-addon-operator
4. machine-api-operator
The config files are generated in the root directory. And the manifest files go in <root>/manifests/ directory.

This PR supersedes #198

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Sep 19, 2018
TectonicNetworkOperatorImage: "quay.io/coreos/tectonic-network-operator-dev:3b6952f5a1ba89bb32dd0630faddeaf2779c9a85",
WorkerIgnConfig: "", // FIXME: this means that depending on ignition assets (risk of cyclical dependencies)
}

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: We can loop it?

Copy link
Author

Choose a reason for hiding this comment

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

Didn't grasp what could be looped. Could do if they were all of one type, but the templates have them mixed. And more could be coming.

@abhinavdahiya
Copy link
Contributor

This looks good. Its missing tectonic/resource/manifests.

/cc @crawford

@@ -13,6 +13,7 @@ import (
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.

Use "manifests" instead.

}

func (kao *kubeAddonOperator) manifest() (string, error) {
return "", nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need a body?

Copy link
Author

Choose a reason for hiding this comment

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

currently all in operators.go. The ones marked for kube-addon will be moved here. So, its a TODO really. Removing it for the time being then.


tectonicnetwork "github.com/coreos/tectonic-config/config/tectonic-network"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
//"github.com/openshift/openshift-network-operator/pkg/apis/networkoperator"
Copy link
Contributor

Choose a reason for hiding this comment

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

Drop

Copy link
Author

Choose a reason for hiding this comment

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

ack

tncoConfig.ControllerConfig.ClusterDNSIP = ip.String()

tncoConfig.ControllerConfig.Platform = tectonicCloudProvider(tnco.installConfig.Platform)
tncoConfig.ControllerConfig.CloudProviderConfig = "" // TODO(yifan): Get CloudProviderConfig.
Copy link
Contributor

Choose a reason for hiding this comment

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

Do these need to be implemented?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah. I still have to figure this one out. The cloudproviderconfig especially.

@@ -0,0 +1,95 @@
package operators
Copy link
Contributor

Choose a reason for hiding this comment

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

@rajatchopra can you drop this file. This is not required.

kubeSys, err := configMap("kube-system", "cluster-config-v1", genericData{
"kco-config": string(kco.Data),
"network-config": string(no.Data),
"tnco-config": string(tnco.Data),
Copy link
Contributor

Choose a reason for hiding this comment

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

drop this not required.

@@ -13,6 +13,7 @@ import (
var (
installConfigCommand = kingpin.Command("install-config", "Generate the Install Config asset")
ignitionConfigsCommand = kingpin.Command("ignition-configs", "Generate the Ignition Config assets")
manifestsCommand = kingpin.Command("manifests", "Generate the 'manifests' assets")
Copy link
Contributor

Choose a reason for hiding this comment

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

"Generate the Kubernetes manifests"

@@ -33,6 +34,10 @@ func main() {
assetStock.MasterIgnition(),
assetStock.WorkerIgnition(),
}
case manifestsCommand.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.

Manifests

Copy link
Author

Choose a reason for hiding this comment

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

Just change the top level function call or the entire package naming?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer the entire package be renamed.

Copy link
Author

Choose a reason for hiding this comment

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

@crawford Done. If this all looks good to you, I can squash the commits once more for the merge.

Copy link
Contributor

@abhinavdahiya abhinavdahiya left a comment

Choose a reason for hiding this comment

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

/lgtm

/hold
@rajatchopra /hold cancel when @crawford has /lgtmd as he has some requests.

@openshift-ci-robot openshift-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Sep 19, 2018
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 19, 2018
@rajatchopra rajatchopra force-pushed the operators_wip branch 3 times, most recently from 35a0632 to ec6cba5 Compare September 20, 2018 19:04
@rajatchopra rajatchopra changed the title Operators wip Bootstrap manifests target for installer Sep 20, 2018
@abhinavdahiya
Copy link
Contributor

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2018
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Sep 20, 2018
@rajatchopra rajatchopra changed the title Bootstrap manifests target for installer bootstrap manifest generation Sep 20, 2018
All manifest files required for bootstrap operations are generated. The operators covered include:
1. network-operator
2. kube-core-operator
3. kube-addon-operator
4. machine-api-operator
The config files are generated in the root directory. And the manifest files go in <root>/manifests/ directory.

asset/cluster:

Added the BUILD.bazel file

asset/stock:

Changed stock to call manifests as well. Modified the BUILD.bazel file

cmd/openshift-install:

'manifests' is the new target to get all operator configs and manifests
@crawford crawford changed the title bootstrap manifest generation asset/manifests: bootstrap manifest generation Sep 20, 2018
@crawford
Copy link
Contributor

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: abhinavdahiya, crawford, rajatchopra

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 [abhinavdahiya,crawford,rajatchopra]

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

@crawford
Copy link
Contributor

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2018
@openshift-merge-robot openshift-merge-robot merged commit 39865b7 into openshift:master Sep 20, 2018
wking added a commit to wking/openshift-installer that referenced this pull request Oct 24, 2018
We'd added this in 4d636d3 (asset/manifests: bootstrap manifest
generation, 2018-08-31, openshift#286) to support the machine-API operator
which had been generating worker machine-sets.  But since e2dc955
(pkg/asset: add ClusterK8sIO, machines.Worker assets, 2018-10-15, openshift#468),
we've been creating those machine-sets ourselves.  And the machine-API
operator dropped their consuming code in
openshift/machine-api-operator@c59151f6 (delete machine/cluster object
loops, 2018-10-22, openshift/machine-api-operator#286).

Dropping this dependency fixes bootstrap Ignition config edits during
a multi-step deploy.  For example, with:

  $ openshift-install --dir=wking create ignition-configs
  $ tree wking
  wking
  ├── bootstrap.ign
  ├── master-0.ign
  └── worker.ign

before this commit, any edits to bootstrap.ign were clobbered in a
subsequent 'create cluster' call, because:

1. The bootstrap Ignition config depends on the manifests.
2. The manifests depended on the worker Ignition config.
3. The worker Ignition config is on disk, so it gets marked dirty.
@wking wking mentioned this pull request Oct 29, 2018
wking added a commit to wking/openshift-installer that referenced this pull request Oct 29, 2018
We set this in both kube-apiserver-secret.go and
openshift-apiserver-secret.go, and we started setting this in db65ea2
(modules/tls: modularize TLS provisioning, 2017-09-13,
coreos/tectonic-installer#1811).  But we have been using the kube-ca
value for it since at least 4d636d3 (asset/manifests: bootstrap
manifest generation, 2018-08-31, openshift#286) and I see no other OpenShift
consumers [1].

[1]: https://github.com/search?q=org%3Aopenshift+oidc-ca.crt&type=Code
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants