-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
asset/manifests: bootstrap manifest generation #286
Conversation
4e89514
to
ea0890a
Compare
pkg/asset/operators/operators.go
Outdated
TectonicNetworkOperatorImage: "quay.io/coreos/tectonic-network-operator-dev:3b6952f5a1ba89bb32dd0630faddeaf2779c9a85", | ||
WorkerIgnConfig: "", // FIXME: this means that depending on ignition assets (risk of cyclical dependencies) | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
This looks good. Its missing /cc @crawford |
ea0890a
to
8222476
Compare
cmd/openshift-install/main.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack
pkg/asset/operators/tnco.go
Outdated
tncoConfig.ControllerConfig.ClusterDNSIP = ip.String() | ||
|
||
tncoConfig.ControllerConfig.Platform = tectonicCloudProvider(tnco.installConfig.Platform) | ||
tncoConfig.ControllerConfig.CloudProviderConfig = "" // TODO(yifan): Get CloudProviderConfig. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
bd11735
to
63d7f6a
Compare
pkg/asset/operators/tnco.go
Outdated
@@ -0,0 +1,95 @@ | |||
package operators |
There was a problem hiding this comment.
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.
pkg/asset/operators/operators.go
Outdated
kubeSys, err := configMap("kube-system", "cluster-config-v1", genericData{ | ||
"kco-config": string(kco.Data), | ||
"network-config": string(no.Data), | ||
"tnco-config": string(tnco.Data), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
drop this not required.
cmd/openshift-install/main.go
Outdated
@@ -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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Generate the Kubernetes manifests"
cmd/openshift-install/main.go
Outdated
@@ -33,6 +34,10 @@ func main() { | |||
assetStock.MasterIgnition(), | |||
assetStock.WorkerIgnition(), | |||
} | |||
case manifestsCommand.FullCommand(): | |||
targetAssets = []asset.Asset{ | |||
assetStock.Operators(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Manifests
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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 /lgtm
d as he has some requests.
d7cacca
to
37c3d69
Compare
35a0632
to
ec6cba5
Compare
/lgtm |
ec6cba5
to
3858ec4
Compare
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
3858ec4
to
4d636d3
Compare
/lgtm |
[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:
Approvers can indicate their approval by writing |
/hold cancel |
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.
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
asset/manifests: bootstrap manifest generation
This PR supersedes #198