Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
164 commits
Select commit Hold shift + click to select a range
ce08273
docs/user/customization: Fix 'clusterNetworks' -> 'clusterNetwork'
wking Jan 21, 2020
67abd26
hack/update-rhcos-bootimage: Drop the f-string
wking Jan 24, 2020
85270dd
gcp: Flag RHCOS with SECURE_BOOT and UEFI_COMPATIBLE
cgwalters Jan 14, 2020
6ec1d00
ovirt - fix the credentials folder permissions
rgolangh Mar 29, 2020
db2da14
Bump cluster-api-provider-openstack
Fedosin Mar 24, 2020
1d69bee
Merge pull request #3369 from rgolangh/fix-ovirt-dir-perms
openshift-merge-robot Apr 3, 2020
2affb3d
OWNERS: include component for image tracking by ART
abhinavdahiya Apr 3, 2020
0485384
Merge pull request #2921 from cgwalters/gcp-secureboot
openshift-merge-robot Apr 3, 2020
ec5a50e
Bug 1810840 : Quote user and password values for good UX and avoid co…
Mar 30, 2020
e2cf269
Fix indentation on a UPI Playbook task
MaysaMacedo Apr 3, 2020
c34adc5
OpenStack: Link to GH issue for glance image import
mandre Apr 3, 2020
75f61e3
Merge pull request #3402 from MaysaMacedo/fix-identation-playbook
openshift-merge-robot Apr 3, 2020
f29364c
pkg/destroy/aws: delete versioned objects from s3 buckets
jhixson74 Apr 2, 2020
de0bdab
Merge pull request #3400 from abhinavdahiya/owners_component
openshift-merge-robot Apr 3, 2020
5654769
Allow to specify additional networks and security groups
Fedosin Mar 24, 2020
0399625
Document additionalNetworks and additional_security_group parameters
Fedosin Mar 17, 2020
c1329de
Add type validations
Fedosin Apr 1, 2020
73aa2d7
Merge pull request #3373 from pdvian/wip-bug-1810840
openshift-merge-robot Apr 3, 2020
8cf1fe8
Merge pull request #3393 from jhixson74/master_aws_bz_1815518
openshift-merge-robot Apr 3, 2020
97dfe4d
pkg/types/validation: Drop internal ClusterDomain
wking Apr 2, 2020
bf4f811
Merge pull request #3404 from mandre/clarify_image_import_disable
openshift-merge-robot Apr 4, 2020
32ed681
uninstall: allow for azure uninstall to succeed for missing rg
staebler Apr 6, 2020
c57c680
libvirt: Bump bootstrap memory to 5G for ppc64le
Prashanth684 Apr 2, 2020
7073901
Fix playbooks names
MaysaMacedo Apr 3, 2020
14c9e88
Merge pull request #3411 from MaysaMacedo/fix-playbooks-name
openshift-merge-robot Apr 7, 2020
c6f4c29
baremetal: validate platform hosts amount
andfasano Apr 6, 2020
a30fe87
Fix LB deletion for lbs with same or status pending
MaysaMacedo Apr 7, 2020
b5bbde6
Merge pull request #3392 from andfasano/validate-hosts-number
openshift-merge-robot Apr 7, 2020
fcbdfea
script: Printing time in console.
rna-afk Mar 9, 2020
c9f8f4e
docs(README): README build steps don't require clone to GOPATH
Apr 7, 2020
32dd0f3
Merge pull request #3396 from Prashanth684/libvirt-bootstrap
openshift-merge-robot Apr 8, 2020
37bc473
Merge pull request #3423 from angelofdeauth/master
openshift-merge-robot Apr 8, 2020
c7d9d4f
Merge pull request #3401 from wking/drop-validation-cluster-domain
openshift-merge-robot Apr 8, 2020
ecf8a2c
custom API and Ingress vip addresses
Mar 27, 2020
5639efa
Validate Azure regions
fabianofranz Apr 7, 2020
52b01dc
Merge pull request #3419 from MaysaMacedo/fix-destroy-lb
openshift-merge-robot Apr 8, 2020
1e34185
Merge pull request #3263 from rna-afk/time_printing
openshift-merge-robot Apr 8, 2020
5e597cc
Merge pull request #3366 from iamemilio/custom_vips
openshift-merge-robot Apr 8, 2020
e11c2b8
Merge pull request #3291 from Fedosin/secondary_vnics
openshift-merge-robot Apr 8, 2020
4fd854e
Merge pull request #3421 from fabianofranz/bz-1819461-region-w-uppercase
openshift-merge-robot Apr 9, 2020
38fe2fa
Bug 1822701: OpenStack: Set port instead of vrrp protocol name
Fedosin Apr 9, 2020
a766c38
pkg/asset: include a installer created SSH for bootstrap-host
abhinavdahiya Apr 9, 2020
b91707e
always atleast use the default SSH key for gathering
abhinavdahiya Apr 9, 2020
5fb1833
pkg/types/config: Remove unused directory
wking Apr 9, 2020
c64dc6c
Merge pull request #3438 from wking/drop-empty-openstack-directory
openshift-merge-robot Apr 10, 2020
2cb9aef
OpenStack: Docs: Fix a typo in the property name
Fedosin Apr 10, 2020
03e7c9c
Merge pull request #3439 from Fedosin/param_typo_2
openshift-merge-robot Apr 10, 2020
74d049f
Updates to fix DNS error for compact cluster worker nodes
varungur Apr 7, 2020
fd431c8
Azure TF: move machine CIDRs to top-level var
patrickdillon Apr 13, 2020
8f2169f
data/config.tf: fix tf-fmt issue on master
patrickdillon Apr 13, 2020
64191ad
Bug-1802526: update AWS TF to use all IPv4 machine CIDRs
patrickdillon Apr 13, 2020
0cc9f43
vsphere ipi: tag virtual machine created when importing ova
jcpowermac Apr 13, 2020
cca02e2
Merge pull request #3443 from jcpowermac/BZ1822858
openshift-merge-robot Apr 13, 2020
7b4020d
update permissions list to cover new installer functionality
Apr 13, 2020
0294aa0
Terraform: update GCP, libvirt, & OpenStack to use machine_v4_cidrs[0]
patrickdillon Apr 13, 2020
0b3070c
tfvars: remove unused DeprecatedMachineCIDR/machine_cidr variable
patrickdillon Apr 13, 2020
79bd68d
docs/user/aws: update docs to include BYO subnets example
patrickdillon Apr 7, 2020
7e2b0ad
handle the posibility that CCO will have no static pod definition
Apr 8, 2020
75738a3
Merge pull request #3427 from joelddiaz/handle-empty-cco-dir
openshift-merge-robot Apr 13, 2020
d947a58
pkg/destroy/ovirt: Cleanup VM logging
wking Apr 13, 2020
c144c10
Merge pull request #3445 from wking/ovirt-vm-logging-cleanup
openshift-merge-robot Apr 14, 2020
47887c9
Merge pull request #3444 from joelddiaz/new-permissions
openshift-merge-robot Apr 14, 2020
cfc6f92
Bug 1823659: os: Mention the bootstrap FIP
pierreprinetti Apr 14, 2020
208c777
openstack: Mention Server group requirement
pierreprinetti Apr 14, 2020
cec5e74
Bug 1820434: OpenStack: Allow Booting bootstrap node from volume
mandre Apr 9, 2020
1f589d4
OpenStack: Add note about bootstrap use of master machine pool
mandre Apr 14, 2020
b11ecfc
Merge pull request #3446 from shiftstack/bug1823659
openshift-merge-robot Apr 14, 2020
1f9fd8e
Merge pull request #3425 from varungur/compact-metal-cluster
openshift-merge-robot Apr 14, 2020
952883f
cmd/openshift-install/migrate: tool for migrating azure legacy privat…
jhixson74 Feb 21, 2020
003dfb8
pkg/asset/installconfig/gcp: fix imports
patrickdillon Apr 14, 2020
affba54
RFE-592: Tightening IAM roles for master/worker nodes to match cloud-…
cuppett Apr 14, 2020
f3831e1
Merge pull request #3416 from staebler/successive_azure_uninstall
openshift-merge-robot Apr 14, 2020
8ba8835
Merge pull request #2957 from wking/clusterNetworks-typo
openshift-merge-robot Apr 14, 2020
6faec84
Merge pull request #2972 from wking/drop-rhcos-update-f-string
openshift-merge-robot Apr 14, 2020
39b912a
Merge pull request #3343 from jhixson74/master_azure_migrate_dns_subc…
openshift-merge-robot Apr 14, 2020
cfecc2c
Merge pull request #3424 from patrickdillon/aws-byo-cidrs-bz-1802526
openshift-merge-robot Apr 14, 2020
3fb6f15
Merge pull request #3437 from abhinavdahiya/local_ssh_key
openshift-merge-robot Apr 15, 2020
8ba1754
Merge pull request #3451 from cuppett/cuppett/fit-iam-roles
openshift-merge-robot Apr 15, 2020
f67d61a
baremetal: send full ignition to masters
kirankt Apr 3, 2020
8c821d2
vendor: updated terraform-provider-ironic version. The new TF provide…
kirankt Apr 8, 2020
cae6c6d
Correcting the instructions to refresh a CA cert
Apr 15, 2020
90e77a3
OpenStack: Replace remote_group_id with remote_ip_prefix
mandre Apr 15, 2020
e2a2342
Merge pull request #3459 from iamemilio/sscCorrection
openshift-merge-robot Apr 15, 2020
12decdb
vsphere ipi: align with baremetal and remove DNSVIP
jcpowermac Apr 15, 2020
6571ce1
Dockerfile.upi.ci: Combine yum install calls.
jstuever Apr 15, 2020
259f415
baremetal IPI: Document Virtual Router IDs
celebdor Apr 15, 2020
87ee724
Bug 1819746: Add a note on slow installations
pierreprinetti Apr 15, 2020
47e5ce5
Dockerfile.upi.ci: Add GCP UPI binaries to the CI Docker file.
jstuever Apr 15, 2020
ffd7f46
Merge pull request #3463 from celebdor/vr-ids-doc
openshift-merge-robot Apr 16, 2020
dae4ef3
Merge pull request #3464 from shiftstack/bug1819746
openshift-merge-robot Apr 16, 2020
8bd5cfb
baremetal: validate no overlap between provisioning and machine nets
stbenjam Mar 27, 2020
883bb3a
Merge pull request #3276 from kirankt/baremetal-full-ignition
openshift-merge-robot Apr 16, 2020
48cc11e
pkg/asset/installconfig: add vSphere TUI wizard
patrickdillon Apr 15, 2020
7c1a274
data/data/azure: Unify cloud LB and kube-apiserver LB
smarterclayton Apr 11, 2020
19d22e6
Merge pull request #3467 from patrickdillon/vsphere-tui-cors-1415
openshift-merge-robot Apr 17, 2020
6decc16
Merge pull request #3461 from mandre/openstack-sg
openshift-merge-robot Apr 17, 2020
4ee0155
baremetal: enhance documentation to include the description of the va…
andfasano Apr 17, 2020
46f7843
openstack UPI: Replace remote_group_id in SGs
pierreprinetti Apr 17, 2020
588d5da
Add feature to enable users to pass custom subnets to use as the node…
Mar 30, 2020
9ca048e
pkg/types/aws: add service endpoints to aws platform
abhinavdahiya Mar 10, 2020
6e32f0d
asset/installconfig/aws/session.go: allow creating session with regio…
abhinavdahiya Mar 11, 2020
5c621c0
asset: Use common session when fetching public zone ID for AWS
abhinavdahiya Mar 11, 2020
915c773
aws: configure terraform with service endpoints
abhinavdahiya Mar 11, 2020
e035875
destroy/aws: use the service overrides for AWS apis
abhinavdahiya Mar 11, 2020
d28c3af
data/aws/main.tf: load sts service endpoint override
abhinavdahiya Mar 11, 2020
805a108
platformtests: drop aws as no longer required
abhinavdahiya Mar 12, 2020
ce9dd4d
aws: use SDK and rhcos AMIs to calculate known regions
abhinavdahiya Mar 12, 2020
92cfcd7
asset/installconfig/aws/platform.go: use the known regions for region…
abhinavdahiya Mar 12, 2020
3e5f419
aws/validation/platform.go: drop region validation from install-config
abhinavdahiya Mar 12, 2020
cf79a75
asset/installconfig/aws: add validation to require endpoints for cert…
abhinavdahiya Mar 12, 2020
0ac6cb1
aws: copy AMI from us-east-1 for SDK regions when not available
abhinavdahiya Mar 13, 2020
982bd2f
vendor: update the openshift/api
abhinavdahiya Mar 16, 2020
204413d
manifests/infrastructure.go: aws: update the config/v1 Infra with ser…
abhinavdahiya Mar 17, 2020
2b4fed0
data/data/aws: skip region validation for custom regions
abhinavdahiya Apr 16, 2020
2ef70a9
aws: add missing endpoints for aws china route53
abhinavdahiya Apr 16, 2020
61ea70e
FIXUP: terraform formatting
abhinavdahiya Apr 17, 2020
6ced6ad
FIXUP: drop shadowing withing range in isAWSRegion
abhinavdahiya Apr 17, 2020
c190126
Merge pull request #3471 from andfasano/validation-doc
openshift-merge-robot Apr 17, 2020
cc49f17
Add instructions for UPI install on Power
bpradipt Apr 15, 2020
7fa45a9
update cloud provider to use folder from platform
dav1x Apr 17, 2020
7b4dbc2
Merge pull request #3398 from iamemilio/customSubnets
openshift-merge-robot Apr 17, 2020
3eccc34
assets/ovirt: clean up prompts
crawford Apr 17, 2020
d751151
Merge pull request #3472 from shiftstack/openstack-sg-upi
openshift-merge-robot Apr 17, 2020
95590cf
destroy/ovirt: clean up logging
crawford Apr 17, 2020
2ce679c
Merge pull request #3474 from crawford/ovirt-logging
openshift-merge-robot Apr 18, 2020
a126ecc
Merge pull request #3435 from Fedosin/vrrp
openshift-merge-robot Apr 18, 2020
35bc7b7
Merge pull request #3447 from shiftstack/os_require_servergroup
openshift-merge-robot Apr 18, 2020
2ed701a
Merge pull request #3473 from dav1x/vmw-platform-folder
openshift-merge-robot Apr 18, 2020
274bb3c
Merge pull request #3358 from stbenjam/validate-netcidr
openshift-merge-robot Apr 18, 2020
3051be9
Merge pull request #3470 from jcpowermac/cors-1409
openshift-merge-robot Apr 18, 2020
70447fe
Merge pull request #3277 from abhinavdahiya/aws_service_endpoints
openshift-merge-robot Apr 18, 2020
ab42046
Merge pull request #3434 from mandre/bootstrap-bfv
openshift-merge-robot Apr 18, 2020
848b08c
installconfig/ovirt: fix CA prompt and add warning
crawford Apr 18, 2020
afff10c
Merge pull request #3479 from crawford/ovirt-ca
openshift-merge-robot Apr 18, 2020
27c03c8
vsphere upi: terraform update, general updates and reorg
jcpowermac Apr 8, 2020
26b2d2a
upi/metal: Terraform 0.12.x syntax updates
LorbusChris Mar 5, 2020
62baf0d
Update matchbox provider version
jcpowermac Apr 16, 2020
d7ed044
Merge pull request #3454 from bpradipt/master
openshift-merge-robot Apr 20, 2020
bc4e6d0
Merge pull request #3462 from jstuever/cors1405
openshift-merge-robot Apr 21, 2020
83213bd
Merge pull request #3429 from jcpowermac/vsphere_upi_tf_012
openshift-merge-robot Apr 21, 2020
00b7678
cmd/openshift-install/gather: clarify location of log bundle
jhixson74 Apr 21, 2020
6054567
openstack UPI: Fix step name
pierreprinetti Apr 22, 2020
c1b6d06
Merge pull request #3495 from shiftstack/fix_upi_step_name
openshift-merge-robot Apr 22, 2020
6035d38
GCP: Fixed error message for Invalid Project ID entry
rna-afk Apr 20, 2020
aa8452b
Merge pull request #3489 from jhixson74/master_log_bundle_bz_1821932
openshift-merge-robot Apr 22, 2020
93a0531
baremetal: update provisioning CR to quote strings
stbenjam Apr 22, 2020
bdf803f
Merge pull request #3484 from rna-afk/gcp_project_basenames_validation
openshift-merge-robot Apr 22, 2020
0982bdc
openstack: Explain why awscli in the CI image
pierreprinetti Apr 23, 2020
0a2a492
openstack UPI: Server group name to match IPI
pierreprinetti Apr 23, 2020
b8a19b2
Bug 1824426: tag primary openstack network
Fedosin Apr 20, 2020
49d6ef9
Merge pull request #3501 from shiftstack/os_explain_awscli
openshift-merge-robot Apr 23, 2020
2c9bb22
Merge pull request #3483 from Fedosin/network_tags
openshift-merge-robot Apr 24, 2020
0cff735
Merge pull request #3496 from stbenjam/fix-external-dhcp
openshift-merge-robot Apr 24, 2020
c4194aa
Merge pull request #3500 from shiftstack/os_upi_fix_server_group_name
openshift-merge-robot Apr 24, 2020
f32e206
rhcos: bump RHCOS boot image to 44.81.202004250133-0
ashcrow Apr 25, 2020
afc6983
Merge pull request #3509 from ashcrow/4.5-bootimg-update-crio
openshift-merge-robot Apr 25, 2020
4eca2ef
Merge pull request #3440 from smarterclayton/azure_lb_2
openshift-merge-robot Apr 29, 2020
a35d912
openstack: Add jq to the CI image
pierreprinetti Apr 24, 2020
c9bcfa1
openstack docs: Add tagging as a requirement
pierreprinetti Apr 29, 2020
d627928
Merge pull request #3503 from shiftstack/os_dockerfile_jq
openshift-merge-robot Apr 29, 2020
6f9a0b8
Merge pull request #3522 from shiftstack/bug1826317
openshift-merge-robot Apr 29, 2020
d2610da
Update vsphere machine api to beta
Apr 14, 2020
730d986
Revendor after updating MAO
Apr 29, 2020
1a0bf0a
Merge pull request #3523 from alexander-demichev/revendormao
openshift-merge-robot Apr 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions OWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ approvers:
- installer-approvers
reviewers:
- installer-reviewers
component: Installer
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

First, install all [build dependencies](docs/dev/dependencies.md).

Clone this repository to `src/github.com/openshift/installer` in your [GOPATH](https://golang.org/cmd/go/#hdr-GOPATH_environment_variable). Then build the `openshift-install` binary with:
Clone this repository. Then build the `openshift-install` binary with:

```sh
hack/build.sh
Expand Down
18 changes: 17 additions & 1 deletion cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
assetstore "github.com/openshift/installer/pkg/asset/store"
targetassets "github.com/openshift/installer/pkg/asset/targets"
destroybootstrap "github.com/openshift/installer/pkg/destroy/bootstrap"
timer "github.com/openshift/installer/pkg/metrics/timer"
"github.com/openshift/installer/pkg/types/baremetal"
cov1helpers "github.com/openshift/library-go/pkg/config/clusteroperator/v1helpers"
)
Expand Down Expand Up @@ -96,6 +97,7 @@ var (
logrus.Fatal(errors.Wrap(err, "loading kubeconfig"))
}

timer.StartTimer("Bootstrap Complete")
err = waitForBootstrapComplete(ctx, config, rootOpts.dir)
if err != nil {
if err2 := logClusterOperatorConditions(ctx, config); err2 != nil {
Expand All @@ -106,6 +108,8 @@ var (
}
logrus.Fatal("Bootstrap failed to complete: ", err)
}
timer.StopTimer("Bootstrap Complete")
timer.StartTimer("Bootstrap Destroy")

if oi, ok := os.LookupEnv("OPENSHIFT_INSTALL_PRESERVE_BOOTSTRAP"); ok && oi != "" {
logrus.Warn("OPENSHIFT_INSTALL_PRESERVE_BOOTSTRAP is set, not destroying bootstrap resources. " +
Expand All @@ -117,6 +121,7 @@ var (
logrus.Fatal(err)
}
}
timer.StopTimer("Bootstrap Destroy")

err = waitForInstallComplete(ctx, config, rootOpts.dir)
if err != nil {
Expand All @@ -125,6 +130,8 @@ var (
}
logrus.Fatal(err)
}
timer.StopTimer(timer.TotalTimeElapsed)
timer.LogSummary()
},
},
assets: targetassets.Cluster,
Expand Down Expand Up @@ -181,6 +188,8 @@ func runTargetCmd(targets ...asset.WritableAsset) func(cmd *cobra.Command, args
}

return func(cmd *cobra.Command, args []string) {
timer.StartTimer(timer.TotalTimeElapsed)

cleanup := setupFileHook(rootOpts.dir)
defer cleanup()

Expand Down Expand Up @@ -249,6 +258,7 @@ func waitForBootstrapComplete(ctx context.Context, config *rest.Config, director

apiTimeout := 20 * time.Minute
logrus.Infof("Waiting up to %v for the Kubernetes API at %s...", apiTimeout, config.Host)

apiContext, cancel := context.WithTimeout(ctx, apiTimeout)
defer cancel()
// Poll quickly so we notice changes, but only log when the response
Expand All @@ -257,10 +267,12 @@ func waitForBootstrapComplete(ctx context.Context, config *rest.Config, director
logDownsample := 15
silenceRemaining := logDownsample
previousErrorSuffix := ""
timer.StartTimer("API")
wait.Until(func() {
version, err := discovery.ServerVersion()
if err == nil {
logrus.Infof("API %s up", version)
timer.StopTimer("API")
cancel()
} else {
silenceRemaining--
Expand Down Expand Up @@ -347,6 +359,7 @@ func waitForInitializedCluster(ctx context.Context, config *rest.Config) error {
defer cancel()

failing := configv1.ClusterStatusConditionType("Failing")
timer.StartTimer("Cluster Operators")
var lastError string
_, err = clientwatch.UntilWithSync(
clusterVersionContext,
Expand All @@ -362,6 +375,7 @@ func waitForInitializedCluster(ctx context.Context, config *rest.Config) error {
return false, nil
}
if cov1helpers.IsStatusConditionTrue(cv.Status.Conditions, configv1.OperatorAvailable) {
timer.StopTimer("Cluster Operators")
return true, nil
}
if cov1helpers.IsStatusConditionTrue(cv.Status.Conditions, failing) {
Expand Down Expand Up @@ -413,6 +427,7 @@ func waitForConsole(ctx context.Context, config *rest.Config, directory string)
// no route in a row (to show we're still alive).
logDownsample := 15
silenceRemaining := logDownsample
timer.StartTimer("Console")
wait.Until(func() {
consoleRoutes, err := rc.RouteV1().Routes(consoleNamespace).List(metav1.ListOptions{})
if err == nil && len(consoleRoutes.Items) > 0 {
Expand Down Expand Up @@ -445,6 +460,7 @@ func waitForConsole(ctx context.Context, config *rest.Config, directory string)
if url == "" {
return url, errors.New("could not get openshift-console URL")
}
timer.StopTimer("Console")
return url, nil
}

Expand All @@ -463,7 +479,7 @@ func logComplete(directory, consoleURL string) error {
logrus.Info("Install complete!")
logrus.Infof("To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=%s'", kubeconfig)
logrus.Infof("Access the OpenShift web-console here: %s", consoleURL)
logrus.Infof("Login to the console with user: kubeadmin, password: %s", pw)
logrus.Infof("Login to the console with user: %q, and password: %q", "kubeadmin", pw)
return nil
}

Expand Down
7 changes: 7 additions & 0 deletions cmd/openshift-install/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
_ "github.com/openshift/installer/pkg/destroy/openstack"
_ "github.com/openshift/installer/pkg/destroy/ovirt"
_ "github.com/openshift/installer/pkg/destroy/vsphere"
timer "github.com/openshift/installer/pkg/metrics/timer"
"github.com/openshift/installer/pkg/terraform"
)

Expand Down Expand Up @@ -54,6 +55,7 @@ func newDestroyClusterCmd() *cobra.Command {
}

func runDestroyCmd(directory string) error {
timer.StartTimer(timer.TotalTimeElapsed)
destroyer, err := destroy.New(logrus.StandardLogger(), directory)
if err != nil {
return errors.Wrap(err, "Failed while preparing to destroy cluster")
Expand Down Expand Up @@ -82,6 +84,8 @@ func runDestroyCmd(directory string) error {
if err != nil && !os.IsNotExist(err) {
return errors.Wrap(err, "failed to remove Terraform state")
}
timer.StopTimer(timer.TotalTimeElapsed)
timer.LogSummary()

return nil
}
Expand All @@ -95,10 +99,13 @@ func newDestroyBootstrapCmd() *cobra.Command {
cleanup := setupFileHook(rootOpts.dir)
defer cleanup()

timer.StartTimer(timer.TotalTimeElapsed)
err := bootstrap.Destroy(rootOpts.dir)
if err != nil {
logrus.Fatal(err)
}
timer.StopTimer(timer.TotalTimeElapsed)
timer.LogSummary()
},
}
}
37 changes: 30 additions & 7 deletions cmd/openshift-install/gather.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"io/ioutil"
"net"
"os"
"path/filepath"
Expand All @@ -20,6 +21,7 @@ import (

"github.com/openshift/installer/pkg/asset/installconfig"
assetstore "github.com/openshift/installer/pkg/asset/store"
"github.com/openshift/installer/pkg/asset/tls"
"github.com/openshift/installer/pkg/gather/ssh"
"github.com/openshift/installer/pkg/terraform"
gatheraws "github.com/openshift/installer/pkg/terraform/gather/aws"
Expand Down Expand Up @@ -85,18 +87,35 @@ func newGatherBootstrapCmd() *cobra.Command {
}

func runGatherBootstrapCmd(directory string) error {
tfStateFilePath := filepath.Join(directory, terraform.StateFileName)
_, err := os.Stat(tfStateFilePath)
if os.IsNotExist(err) {
return unSupportedPlatformGather(directory)
assetStore, err := assetstore.NewStore(directory)
if err != nil {
return errors.Wrap(err, "failed to create asset store")
}
// add the default bootstrap key pair to the sshKeys list
bootstrapSSHKeyPair := &tls.BootstrapSSHKeyPair{}
if err := assetStore.Fetch(bootstrapSSHKeyPair); err != nil {
return errors.Wrapf(err, "failed to fetch %s", bootstrapSSHKeyPair.Name())
}
tmpfile, err := ioutil.TempFile("", "bootstrap-ssh")
if err != nil {
return err
}
defer os.Remove(tmpfile.Name())
if _, err := tmpfile.Write(bootstrapSSHKeyPair.Private()); err != nil {
return err
}
if err := tmpfile.Close(); err != nil {
return err
}
gatherBootstrapOpts.sshKeys = append(gatherBootstrapOpts.sshKeys, tmpfile.Name())

assetStore, err := assetstore.NewStore(directory)
tfStateFilePath := filepath.Join(directory, terraform.StateFileName)
_, err = os.Stat(tfStateFilePath)
if os.IsNotExist(err) {
return unSupportedPlatformGather(directory)
}
if err != nil {
return errors.Wrap(err, "failed to create asset store")
return err
}

config := &installconfig.InstallConfig{}
Expand Down Expand Up @@ -136,7 +155,11 @@ func logGatherBootstrap(bootstrap string, port int, masters []string, directory
if err := ssh.PullFileTo(client, fmt.Sprintf("/home/core/log-bundle-%s.tar.gz", gatherID), file); err != nil {
return errors.Wrap(err, "failed to pull log file from remote")
}
logrus.Infof("Bootstrap gather logs captured here %q", file)
path, err := filepath.Abs(file)
if err != nil {
return errors.Wrap(err, "failed to stat log file")
}
logrus.Infof("Bootstrap gather logs captured here %q", path)
return nil
}

Expand Down
1 change: 1 addition & 0 deletions cmd/openshift-install/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func installerMain() {
newVersionCmd(),
newGraphCmd(),
newCompletionCmd(),
newMigrateCmd(),
} {
rootCmd.AddCommand(subCmd)
}
Expand Down
23 changes: 23 additions & 0 deletions cmd/openshift-install/migrate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"github.com/spf13/cobra"

azure "github.com/openshift/installer/cmd/openshift-install/migrate/azure"
)

func newMigrateCmd() *cobra.Command {
migrateCmd := &cobra.Command{
Use: "migrate",
Short: "Do a migration",
Args: cobra.ExactArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
return cmd.Help()
},
}

migrateCmd.AddCommand(azure.NewMigrateAzurePrivateDNSEligibleCmd())
migrateCmd.AddCommand(azure.NewMigrateAzurePrivateDNSMigrateCmd())

return migrateCmd
}
23 changes: 23 additions & 0 deletions cmd/openshift-install/migrate/azure/eligible.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package azure

import (
"github.com/spf13/cobra"

azmigrate "github.com/openshift/installer/pkg/migrate/azure"
)

func runMigrateAzurePrivateDNSEligibleCmd(cmd *cobra.Command, args []string) error {
return azmigrate.Eligible()
}

// NewMigrateAzurePrivateDNSEligibleCmd adds the eligble command to openshift-install
func NewMigrateAzurePrivateDNSEligibleCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "azure-privatedns-eligible",
Short: "Show legacy Azure zones that are eligible to be migrated",
Long: "This will show legacy Azure private zones that can be migrated to new private zones.",
RunE: runMigrateAzurePrivateDNSEligibleCmd,
}

return cmd
}
53 changes: 53 additions & 0 deletions cmd/openshift-install/migrate/azure/migrate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package azure

import (
"github.com/pkg/errors"
"github.com/spf13/cobra"

azmigrate "github.com/openshift/installer/pkg/migrate/azure"
)

var (
azureMigrateOpts struct {
zone string
resourceGroup string
virtualNetwork string
vnetResourceGroup string
link bool
}
)

func runMigrateAzurePrivateDNSMigrateCmd(cmd *cobra.Command, args []string) error {
if azureMigrateOpts.zone == "" {
return errors.New("zone is a required argument")
}
if azureMigrateOpts.resourceGroup == "" {
return errors.New("resource-group is a required argument")
}
if azureMigrateOpts.link == true && azureMigrateOpts.virtualNetwork == "" {
return errors.New("link requires virtual-network to be set")
}
if azureMigrateOpts.virtualNetwork != "" && azureMigrateOpts.vnetResourceGroup == "" {
return errors.New("virtual-network requires virtual-network-resource-group to be set")
}

return azmigrate.Migrate(azureMigrateOpts.resourceGroup, azureMigrateOpts.zone, azureMigrateOpts.virtualNetwork, azureMigrateOpts.vnetResourceGroup, azureMigrateOpts.link)
}

// NewMigrateAzurePrivateDNSMigrateCmd adds the migrate command to openshift-install
func NewMigrateAzurePrivateDNSMigrateCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "azure-privatedns",
Short: "Migrate a legacy Azure zone",
Long: "This will migrate a legacy Azure private zone to a new style private zone.",
RunE: runMigrateAzurePrivateDNSMigrateCmd,
}

cmd.PersistentFlags().StringVar(&azureMigrateOpts.zone, "zone", "", "The zone to migrate")
cmd.PersistentFlags().StringVar(&azureMigrateOpts.resourceGroup, "resource-group", "", "The resource group of the zone")
cmd.PersistentFlags().StringVar(&azureMigrateOpts.virtualNetwork, "virtual-network", "", "The virtual network to create the private zone in")
cmd.PersistentFlags().StringVar(&azureMigrateOpts.vnetResourceGroup, "virtual-network-resource-group", "", "The resource group the virtual network is in")
cmd.PersistentFlags().BoolVar(&azureMigrateOpts.link, "link", false, "Link the newly created private zone to the virtual network")

return cmd
}
10 changes: 9 additions & 1 deletion cmd/openshift-install/waitfor.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"path/filepath"

timer "github.com/openshift/installer/pkg/metrics/timer"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -34,6 +35,7 @@ func newWaitForBootstrapCompleteCmd() *cobra.Command {
Short: "Wait until cluster bootstrapping has completed",
Args: cobra.ExactArgs(0),
Run: func(_ *cobra.Command, _ []string) {
timer.StartTimer(timer.TotalTimeElapsed)
ctx := context.Background()

cleanup := setupFileHook(rootOpts.dir)
Expand All @@ -43,7 +45,7 @@ func newWaitForBootstrapCompleteCmd() *cobra.Command {
if err != nil {
logrus.Fatal(errors.Wrap(err, "loading kubeconfig"))
}

timer.StartTimer("Bootstrap Complete")
err = waitForBootstrapComplete(ctx, config, rootOpts.dir)
if err != nil {
if err2 := logClusterOperatorConditions(ctx, config); err2 != nil {
Expand All @@ -56,6 +58,9 @@ func newWaitForBootstrapCompleteCmd() *cobra.Command {
}

logrus.Info("It is now safe to remove the bootstrap resources")
timer.StopTimer("Bootstrap Complete")
timer.StopTimer(timer.TotalTimeElapsed)
timer.LogSummary()
},
}
}
Expand All @@ -66,6 +71,7 @@ func newWaitForInstallCompleteCmd() *cobra.Command {
Short: "Wait until the cluster is ready",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
timer.StartTimer(timer.TotalTimeElapsed)
ctx := context.Background()

cleanup := setupFileHook(rootOpts.dir)
Expand All @@ -84,6 +90,8 @@ func newWaitForInstallCompleteCmd() *cobra.Command {

logrus.Fatal(err)
}
timer.StopTimer(timer.TotalTimeElapsed)
timer.LogSummary()
},
}
}
Loading