Commit Graph

35 Commits

Author SHA1 Message Date
Peter Rifel 669c47c4ed
Simplify boolean returns 2025-08-22 20:36:09 -05:00
Pierre Prinetti 1005dda58e
Upgrade to Gophercloud v2
Essentially:

* Add a context argument to Gophercloud functions
* Refactor scheduler hints for server creation
2024-10-23 12:33:34 +02:00
Arnaud Meukam cf3d7afce9
Use github.com/go-viper/mapstructure/v2
Update mapstructure with a maintained fork.

See:
  - https://github.com/mitchellh/mapstructure/issues/349

Signed-off-by: Arnaud Meukam <ameukam@gmail.com>
2024-03-12 13:49:07 +01:00
Jesse Haka e3bcb1f195
OpenStack: add server group name override annotation (#15735)
* OpenStack: add server group name override annotation

* use retries to listinstances

* add support for multiple clusters in same tenant

* run hack-expected.sh

* add test for serverGroupName annotation

* use retry
2023-08-03 00:04:20 -07:00
ederst 65dd16a301 OpenStack: Use task engine to retry failed servers
This will make use of the kOps taks engine to retry failed servers.

The former approach had the side effect of not making kOps fail when the
last retry failed:

Because there is now a server present - although in an erroneous state -
the "instance task" which the task engine retried reconciled the server
(port, floating ip) instead of recreating it again.

With the approach of letting the task engine retry the failed servers
this will be handled correctly.
2023-05-22 13:43:42 +02:00
ederst 37c2cf56d2 OpenStack: Allow setting allowed address pairs for ports 2023-03-23 15:01:10 +01:00
ederst 8434481557 Retry creating failed OpenStack servers
This aims to improve the experience when creating openstack servers and
they run into issues during scheduling, which is not covered by the
create API request.

So after creating the instance kops waits for it to become ACTIVE and if
not, tries to reprovision the instance by deleting the failed instance
and creating a new one.

If the last attempt was still not successful, erroneous instances will
persist to allow further investigation, and the task will fail, which
will ultimately fail the update call.
2023-02-24 01:26:06 +01:00
Ciprian Hacman 8f79c9bd68 Replace fi.Bool/Float*/Int*/String() with fi.PtrTo() 2022-11-19 03:45:22 +02:00
Jesse Haka e4162d2c8f fix member update when draining 2022-03-25 14:37:35 +02:00
Jesse Haka b88d110f58 Drain OpenStack loadbalancers 2021-12-31 13:16:02 +02:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
Michael Wagner e4a2a5b86c feat(openstack): enable configuration of servergroup affinities
This enables us to change the ServerGroup affinity policies using
annotations on instance groups.

The default affinity policy still is "anti-affinity".
2021-05-19 13:11:08 +02:00
Otto Sulin 24dcd840bb Fix OpenStack delete functions
This PR introduces two fixes:
1) Add missing RetryWithBackoff to DeleteInstanceWithID
2) Fix broken retry logic in all other delete functions. In the current implementation, as the first Delete request will almost certainly return nil, the function will return true and the retry will not try again, resulting in assets not getting deleted from OpenStack

Also, the current writeBackoff is pretty aggressive and I introduced a bit less hasty deleteBackoff.

The change has been tested with OpenStack. I verified that all APIs we are hitting will eventually return the 404 (type) we are looking for.
2021-02-17 11:02:12 +02:00
Jesse Haka e3bbe25bc9 Reset deviceID status if needed 2020-11-06 11:07:30 +02:00
Ole Markus With aa66c4f6d8 Add rolling upgrade to openstack 2020-10-01 20:07:44 +02:00
Ole Markus With 0ec71686b9 Refactor cloudinstancegroupmember in a more independent cloud instance representation
Apply suggestions from code review

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-30 21:37:03 +02:00
Ole Markus With 8c70787bab Upgrade gophercloud to v1.11.0
Update upup/pkg/fi/cloudup/openstacktasks/instance.go

Co-authored-by: Peter Rifel <rifelpet@users.noreply.github.com>
2020-08-23 16:45:00 +02:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
Peter Rifel 39ed56522c
Refactor openstackCloud to be mockable, add openstack.MockCloud
This is the first step towards an openstack implementation of cloudmock, allowing us to have openstack integration tests.
2020-07-28 23:29:41 -05:00
Peter Rifel 8734d5ff50
Use public client accessors within openstackCloud functions
This is minor cleanup before refactoring the openstackCloud functions to make them more mockable, similar to AWSCloud
2020-07-25 13:04:58 -05:00
John Gardiner Myers cc5b6f4b8f Add fi.Cloud.DetachInstance() 2020-01-27 20:15:11 -08:00
tanjunchen f01e8e4cdd upup/pkg/fi/cloudup/ staticcheck 2019-12-31 16:15:28 +08:00
Jesse Haka 282e82c232 increase retry count 2019-11-05 15:12:06 +02:00
Teodor Todorov fac5969001
Allow OS instances to boot from volume 2019-09-23 18:04:25 +01:00
Jesse Haka c0759525fc Use without external router 2019-09-21 11:21:21 +03:00
Jesse Haka ad3a14f994 move getserver floatingip to common function 2019-06-25 10:00:07 +03:00
Derek Lemon (delemon) 2f25db8abc Simple generation check to see if instance groups may need updated
Ignoring replace with no spec changes

Updating replace cancellation to only not set generation, instead of not performing the update

Bazel updates

Setting generation in common clientset code

Bazel updates
2019-05-28 12:42:13 -06:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Jesse Haka 1925a26887 implement delete instance, this is needed in rolling-update 2019-03-04 13:59:28 +02:00
Jesse Haka 98ad9126c5 implement delete cluster for openstack 2019-01-29 12:56:48 +02:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 025a255dd8 Adding ability to retrieve openstack server by ID 2019-01-18 13:42:21 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 4f0169bb79 codegen 2019-01-16 09:30:40 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 84e29d2a79 Remove duplicate headers 2019-01-15 16:33:23 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 4fc70b6d74 Update Headers 2019-01-15 16:29:25 -07:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) fb0939af9b Openstack Model, tasks, and cloud ops refactor 2019-01-15 14:16:08 -07:00