Commit Graph

50 Commits

Author SHA1 Message Date
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
justinsb 50776a7e92 Refactor ForAPIServer
We instead return a list of the services we are supporting.

We can in future split out internal and external apiserver services.
2024-01-12 15:53:41 -05: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 76c932ddb5 OpenStack: Use interface attach when reconciling server ports
This makes use of the interface attach method when reconciling server
ports.

The difference between just setting the `DeviceID` on the Port and this
is that with the attachment process the server is also validated. Which
means for example that a Port cannot be attached to a server in `ERROR`
state.
2023-05-23 21:32:29 +02: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 9f828259ba Remove unused wait for status active func 2023-02-24 01:28:39 +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
John Gardiner Myers f7383b29da Move Cloud into CloudupSubContext 2022-12-18 13:40:02 -08:00
John Gardiner Myers 7c3e32369a Refactor Context into separate cloudup and nodeup types 2022-12-17 17:42:46 -08:00
Ciprian Hacman d29812fc6e Replace fi.Bool/Float*/Int*/StringValue() with fi.ValueOf 2022-11-19 03:45:23 +02:00
Ciprian Hacman 8f79c9bd68 Replace fi.Bool/Float*/Int*/String() with fi.PtrTo() 2022-11-19 03:45:22 +02:00
Nagaraju Akkina bb934447fd Fix openstack tag limitation
Openstack is not allowing object tag size of more than 60 characters, as
we can not rename a cluster we have to truncate and limit length to 42
for the tag value.
2022-08-30 10:03:30 +02:00
ederst 40a0a7ebab Be more specific when filtering OS instance ports
This adds an additional filter for ports attached to an instance, so
that only ports tagged with the cluster name will be considered.

Basically, this enables adding ports to the server independent from the
provisioning process.

To not break clusters provisioned with older kOps versions, when there
are no tagged ports found it will still consider all the ports of an
instance.
2022-06-29 11:02:18 +02:00
Ciprian Hacman 2f8154692f Allow returning multiple addresses for API 2022-05-09 14:14:15 +03:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
burntcarrot 208ae1eebd Update instance.go
Signed-off-by: burntcarrot <aadhav.n1@gmail.com>
2021-08-30 09:18:02 +05:30
burntcarrot 7a6e1c1e68 Fix new staticcheck errors
Signed-off-by: burntcarrot <aadhav.n1@gmail.com>
2021-08-28 19:48:17 +05:30
ederst bb59f762a1 Add config drive option for Openstack instances
This enables to use config drives instead of the metadata service as a
source for the user data (cloudinit).
2021-06-16 13:32:50 +02:00
John Gardiner Myers 7c9e7e9286 Make Lifecycle field non-pointer 2021-06-02 23:02:16 -07:00
Jesse Haka 1bc330b0bb nameprefix -> groupname 2021-01-13 11:54:07 +02:00
Jesse Haka 185ccba246 Use random instance names in OpenStack 2021-01-12 14:52:39 +02:00
Jesse Haka 46de9f145e update gophercloud dependency 2021-01-11 14:48:22 +02:00
Justin SB 1c11f1a094 Openstack: Prevent data race in servergroup member list
We were adding to the ServerGroup without a mutex, so we introduce a mutex.

Also introduce some defense against the member list changing once
we've observed it, though this is already enforced by GetDependencies.
2021-01-10 11:11:11 -05:00
Justin SB 45d11ba12c Replace (some) deprecated ResourceHolder with Resource
This removes more of the deprecated type, but it also simplifies
refactoring the GCE InstanceTemplate.
2020-12-19 09:51:43 -05:00
Jesse Haka e3bbe25bc9 Reset deviceID status if needed 2020-11-06 11:07:30 +02:00
Ole Markus With d2127d8981 Reconsile floating ips to instances 2020-08-26 14:17:24 +02:00
Ole Markus With 0ae88cde8a Support reconsiling server ports 2020-08-26 14:17:24 +02:00
Ole Markus With 8e4f3b1458 Tags are never used 2020-08-26 14:17:24 +02:00
Ole Markus With 36fb150105 Migrate floating IP to server association to neutron 2020-08-24 06:44:27 +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
Ole Markus With 29682700c7 Don't use nova for glance mocks
Fetching images through nova is deprecated and removed in newer versions
of the compute API. Mocks now reflect this behavior.
2020-08-21 10:18:52 +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
John Gardiner Myers f72dac180d Switch to new fitasks marker 2020-07-28 11:48:08 -07:00
Ole Markus With 3931710d5e Remove unused function 2020-07-12 21:43:12 +02:00
Ole Markus With b508696cf2 Make Instance task depend on floating ip
Originally, floating ips depended on instances, but this causes a dependency cycle now that bootstrap scripts require all IPs for the API cert.
This also requires using networking API for creating floating ips instead of compute so that we can name (and later tag) the floating IPs, which is necessary to know which floating IP belongs to which instance prior to association
2020-07-12 21:08:13 +02:00
Kubernetes Prow Robot f9262b91e7
Merge pull request #9450 from johngmyers/refactor-apiserver-lb
Refactor how api-server addresses are exported from tasks
2020-06-28 22:08:15 -07:00
John Gardiner Myers 86f157fa27 Refactor how api-server addresses are exported from tasks 2020-06-26 21:38:39 -07:00
John Gardiner Myers 87446f8894 Make all users of userdata declare it as a dependency 2020-06-26 10:31:52 -07:00
Teodor Todorov 80015cc258
Remove unused struct 2019-09-27 14:44:57 +01:00
Teodor Todorov 8d28efb50f
Merge branch 'master' into master 2019-09-25 10:07:50 +01:00
Michael Wagner f6b6bc5e90 feat(openstack): propagate additional security groups
This uses the specified additional security groups and adds them to the
instance port
2019-09-24 13:39:29 +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
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04: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
Derek Lemon (delemon) 13271be655 Support for clusters with instance groups larger than 9 2019-03-20 09:56:27 -06:00
Jesse Haka 1b55c87b6f spread instances equally to all AZs 2019-02-27 18:44:06 +02: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
Jon Perritt 3064f6be15 server groups, lb, instance, and dns tasks, models and resources 2019-01-15 14:06:54 -07:00
Levi Blackstone 7aecce88a3
OpenStack: vendor schedulerhints 2018-08-30 16:53:07 -06:00