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

UPSTREAM: 89885: revert: allow to read openstack cloud provider config from a secret #1389

Closed

Conversation

mandre
Copy link
Member

@mandre mandre commented Oct 11, 2022

This reverts commit 452539b as it is no longer needed after OCP 4.12, where the OpenStack platform switched to the out-of-tree cloud provider.

This patch brings back the downstream changes that were introduced to allow reading openstack cloud provider config from a secret. They are available in release-4.4, but were reverted in master with openshift/origin#24719

This change includes:

  • Ability to read metadata values for kubelet. Since the service does not have access to the secret to read the configuration, but it needs data to download (e.g. hostname or flavor), we are trying to get it from the metadata server.

  • Deprecation of kubeConfig parameter. Now we read the file that was provided with --kubeconfig option.

Origin-commit: f95edc26155a29769b3c5b80c03755a01a87b5fc

UPSTREAM: 89885: legacy-cloud-provider/openstack: include / prefix in instance ID output

When we want to read an instance ID from the metadata service, cloud provider doesn't include "/" prefix, which is required for successful parsing of provider the ID later.
This commit adds the missing "/" prefix to the output.

UPSTREAM: 89885: SQUASH: Fix Cinder provisioning crashing on nil cloud provider

OpenStack cloud provider must not use nil when provisioning a Cinder volume.

UPSTREAM: 89885: SQUASH: Report OpenStack cloud initialization errors

openshift-rebase(v1.24):source=dbe70e455ee

UPSTREAM: : Set informer for openstack

Set informer for the openstack cloud provider to ensure it is properly initialized when reading config from a secret.

Upstream 89885 was closed in favor of 96750.

Co-authored-by: Hemant Kumar hekumar@redhat.com

openshift-rebase(v1.24):source=d7ecbd903e2

UPSTREAM: 89885: SQUASH: Retry fetching clouds.conf

The OpenStack secret is not guaranteed to be present at the time kube-controller-manager is initialised.

Co-authored-by: Martin André m.andre@redhat.com
Co-authored-by: Pierre Prinetti pierreprinetti@redhat.com

openshift-rebase(v1.24):source=8bc9dd29ef0

UPSTREAM: 89885: Fix panic in openstack.InstanceExistsByProviderID()

... when provider is uninitialised.

This is a fix to downstream-only code which was originally proposed upstream as kubernetes#89885 but did not merge. It is therefore not relevant upstream. Given that we will replace the openstack legacy cloud provider in 4.12 we will not re-propose kubernetes#89885 or this fix to it.

Causes all openstack.Instances() methods which require more than the local metadata service to return NotImplemented instead of crashing if the provider is not initialised.

…g from a secret"

This patch brings back the downstream changes that were introduced
to allow reading openstack cloud provider config from a secret.
They are available in release-4.4, but were reverted in master with
openshift/origin#24719

This change includes:

- Ability to read metadata values for kubelet. Since the service
does not have access to the secret to read the configuration, but
it needs data to download (e.g. hostname or flavor), we are trying
to get it from the metadata server.

- Deprecation of kubeConfig parameter. Now we read the file that
was provided with --kubeconfig option.

Origin-commit: f95edc26155a29769b3c5b80c03755a01a87b5fc

UPSTREAM: 89885: legacy-cloud-provider/openstack: include / prefix in instance ID output

When we want to read an instance ID from the metadata service, cloud provider
doesn't include "/" prefix, which is required for successful parsing of
provider the ID later.
This commit adds the missing "/" prefix to the output.

UPSTREAM: 89885: SQUASH: Fix Cinder provisioning crashing on nil cloud provider

OpenStack cloud provider must not use nil when provisioning a Cinder
volume.

UPSTREAM: 89885: SQUASH: Report OpenStack cloud initialization errors

openshift-rebase(v1.24):source=dbe70e455ee

UPSTREAM: <carry>: Set informer for openstack

Set informer for the openstack cloud provider to ensure it is properly
initialized when reading config from a secret.

Upstream 89885 was closed in favor of 96750.

Co-authored-by: Hemant Kumar <hekumar@redhat.com>

openshift-rebase(v1.24):source=d7ecbd903e2

UPSTREAM: 89885: SQUASH: Retry fetching clouds.conf

The OpenStack secret is not guaranteed to be present at the time
kube-controller-manager is initialised.

Co-authored-by: Martin André <m.andre@redhat.com>
Co-authored-by: Pierre Prinetti <pierreprinetti@redhat.com>

openshift-rebase(v1.24):source=8bc9dd29ef0

UPSTREAM: 89885: Fix panic in openstack.InstanceExistsByProviderID()

... when provider is uninitialised.

This is a fix to downstream-only code which was originally proposed
upstream as kubernetes#89885 but did
not merge. It is therefore not relevant upstream. Given that we will
replace the openstack legacy cloud provider in 4.12 we will not
re-propose kubernetes#89885 or this fix to it.

Causes all openstack.Instances() methods which require more than the
local metadata service to return NotImplemented instead of crashing if
the provider is not initialised.
@openshift-ci-robot openshift-ci-robot added the backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. label Oct 11, 2022
@openshift-ci-robot
Copy link

@mandre: the contents of this pull request could not be automatically validated.

The following commits could not be validated and must be approved by a top-level approver:

Comment /validate-backports to re-evaluate validity of the upstream PRs, for example when they are merged upstream.

@openshift-ci openshift-ci bot added the vendor-update Touching vendor dir or related files label Oct 11, 2022
@JoelSpeed
Copy link

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 11, 2022
@openshift-ci
Copy link

openshift-ci bot commented Oct 11, 2022

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: JoelSpeed, mandre
Once this PR has been reviewed and has the lgtm label, please assign sttts for approval by writing /assign @sttts in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@EmilienM
Copy link
Member

/retest

1 similar comment
@mandre
Copy link
Member Author

mandre commented Oct 12, 2022

/retest

@soltysh
Copy link
Member

soltysh commented Oct 12, 2022

@JoelSpeed @mandre can you ensure the ci/prow/e2e-openstack is green to ensure we don't break anything?

@mandre
Copy link
Member Author

mandre commented Oct 12, 2022

/test e2e-openstack

1 similar comment
@mandre
Copy link
Member Author

mandre commented Oct 14, 2022

/test e2e-openstack

@mandre
Copy link
Member Author

mandre commented Oct 14, 2022

/hold

This might be too soon to revert the carry patch. KCM enters a crash loop:

I1014 08:47:40.838002       1 openstack.go:266] Creating kubernetes API client.
W1014 08:47:40.838022       1 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
W1014 08:47:40.838056       1 client_config.go:622] error creating inClusterConfig, falling back to default config: open /var/run/secrets/kubernetes.io/serviceaccount/token: no such file or directory
F1014 08:47:40.838266       1 controllermanager.go:245] error building controller context: cloud provider could not be initialized: could not init cloud provider \"openstack\": failed to get kubernetes client: invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable",

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 14, 2022
@mandre
Copy link
Member Author

mandre commented Dec 13, 2022

We need openshift/library-go#1443 that we'll revendor in KCMO.

@mandre
Copy link
Member Author

mandre commented Dec 15, 2022

/retest

@JoelSpeed
Copy link

Do we need to fix the vendor verify before this will pass the E2E?

@mandre
Copy link
Member Author

mandre commented Dec 15, 2022

I don't know about the vendor verify, perhaps this can be fixed by rebasing the PR.
However this time the deployment went through (yay!) and most of the failure, if not all, are from in-tree cinder tests that are removed by Dims' PR. I'm not sure how to proceed from there.

@mandre
Copy link
Member Author

mandre commented Dec 19, 2022

/retest

@openshift-ci
Copy link

openshift-ci bot commented Jan 6, 2023

@mandre: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/verify a2aedf1 link true /test verify
ci/prow/4.11-upgrade-from-stable-4.10-e2e-aws-ovn-upgrade a2aedf1 link false /test 4.11-upgrade-from-stable-4.10-e2e-aws-ovn-upgrade
ci/prow/e2e-azure-ovn-upgrade a2aedf1 link true /test e2e-azure-ovn-upgrade
ci/prow/e2e-aws-ovn-downgrade a2aedf1 link true /test e2e-aws-ovn-downgrade
ci/prow/e2e-aws-ovn-upgrade a2aedf1 link true /test e2e-aws-ovn-upgrade

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@mandre
Copy link
Member Author

mandre commented Mar 9, 2023

/close
This is no longer needed since the 1.26 rebase.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 9, 2023
@openshift-merge-robot
Copy link

PR needs rebase.

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.

@openshift-ci openshift-ci bot closed this Mar 9, 2023
@openshift-ci
Copy link

openshift-ci bot commented Mar 9, 2023

@mandre: Closed this PR.

In response to this:

/close
This is no longer needed since the 1.26 rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backports/unvalidated-commits Indicates that not all commits come to merged upstream PRs. 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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. vendor-update Touching vendor dir or related files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants