Commit Graph

77 Commits

Author SHA1 Message Date
guilhermesteinmuller d3d28594b3 Drop mesos driver
The coe mesos has not been maitenaned for quite some
time and hasn't got much attetion from the community
in general. As discussed in the mailing list [1] we
are dropping for now.

In this patch, we start by removing the mesos driver
and its test cases. This part of the code has no impact
for other drivers. Then we can clean up mesos references
that affect the API.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2021-December/026230.html

Conflicts:
	lower-constraints.txt
	tox.ini

Change-Id: Ied76095f1f1c57c6af93d1a6094baa6c7cc31c9b
2022-11-11 23:01:43 +11:00
Feilong Wang 946c1d67c7 Add master_lb_enabled to cluster
Adding the master_lb_enabled option when creating a cluster,
which will benefit both the cloud provider side and the end
user side. For cloud prodiver, they don't have to maintain
separate cluster templates with or w/o master_lb_enabled enabled.
For end user, they can easily use one single template to create
different clusters with different configs.

Task: 39680
Story: 2007634

Change-Id: I0b586f05168ece84fd340ef7493a56688191053d
2020-07-21 11:07:33 +12:00
Zuul 52690900a7 Merge "Fix label fixed_network_cidr" 2020-06-11 11:20:37 +00:00
Feilong Wang 001b9c6101 Fix label fixed_network_cidr
Now the label `fixed_network_cidr` is not handled correctly, no matter
if the label is set, the default value '10.0.0.0/24' is used for
fixed network anyway. This patch fixes it and renamed it as
`fixed_subnet_cidr` to make less confusion. The new behaviour will be:
1. If the label `fixed_subnet_cidr` is set but no fixed subnet passed
   in, then a new subnet will be created with the given CIDR.
2. If a fixed subnet is passed in by user, then label `fixed_subnet_cidr`
   will be override with the CIDR from the given subnet.

Task: 39847
Story: 2007712

Change-Id: Id05e36696bf85297a556fcd959ed897fe47b7354
2020-06-11 13:54:59 +12:00
Spyros Trigazis 9f4c63a0df resize: Send only nodes_to_remove and node_count
When resizing a NG we should strictly send the
desired node_count and the nodes_to_remove.
Otherwise the stack update operation may replace/rebuild
nodes or other resources.

This was the functionality with:
Id84e5d878b21c908021e631514c2c58b3fe8b8b0
But it was reverted with:
I725413e77f5a7bdb48131e8a10e5dc884b5e066a

Story: 2005266
task: 39860

Change-Id: Ib31b6801e0e2d954c31ac91e77ae9d3ef1afebd2
Signed-off-by: Spyros Trigazis <strigazi@gmail.com>
2020-06-05 08:47:53 +00:00
Theodoros Tsioutsias 37c61fa2f8 Docker volume size from nodegroups
Docker volume size as well as volume env files should be fetched
based on the nodegroup and not the cluster.

story: 2006701
task: 37008

Change-Id: Ia9e7f4612f36f4e57626b2e931b84898523e9ccb
2019-10-23 11:08:27 +00:00
Theodoros Tsioutsias 44631afbbf ng-10: Fix cluster template conditions
Removes the role heat param from all templates. Instead and only for
k8s templates adds the master_role and worker_role params. The new
worker_only condition should be true for all roles except for master.
Finally, adds the missing is_cluster_stack param to all templates.

Change-Id: Ie0799373fe492c2e0a0cad903ed6e8c93e6266b5
2019-10-16 11:53:44 +00:00
Spyros Trigazis 2f72fdfbf6 Pass ssh public key as string
* Fedora CoreOS need the key to be passed as
  a string.
* We can adopt in all drivers so that users in
  the same project can do cluster resize.

story: 2005201
task: 36934

Change-Id: I9a18ce4dcbd74f0dcd23274baed7c8c3d2029d50
Signed-off-by: Spyros Trigazis <spyridon.trigazis@cern.ch>
2019-10-08 07:56:52 +00:00
Theodoros Tsioutsias e52f77b299 ng-9: Driver for nodegroup operations
This adds the support for creating and deleting worker  nodegroups
using different stack per nodegroup. In order to be backwards
compatible, default nodegroups will remain in one stack.

Having this in mind cluster status is now calculated aggregating the
statuses of the underlying stacks.

Change-Id: I97839ab8495ed5d860785dff1f6e3cc59b6a9ff7
2019-09-26 08:45:57 +00:00
Theodoros Tsioutsias d4a52719f1 ng-7: Adapt parameter and output mappings
With this change parameter and output mappings can support multiple
stacks.

Change-Id: I45cf765977c7f5a92f28ae12c469b98435763163
2019-09-26 08:45:51 +00:00
Feilong Wang 32989b4f7b Allow setting network, subnet and FIP when creating cluster
When using a public cluster template, user still need the capability
to reuse their existing network/subnet, and they also need to be
able to turn of/off the floatingip to overwrite the setting in the
public template. This patch supports that by adding those three
items as parameters when creating cluster.

Story: 2006208
Task: 35797

Change-Id: I11579ff6b83d133c71c2cbf49ee4b20996dfb918
2019-07-31 20:41:20 +12:00
Spyros Trigazis (strigazi) 9b1bd5da54 Add cluster upgrade to the API
To enable the rolling upgrade ability of Kubernetes Cluster, this
patch is proposing a new API /upgrade to support upgrade the
base operating system of nodes and the version of Kubernetes, even
add-ons running on the k8s cluster:

POST <ClusterID>/actions/upgrade

And the post body will be:

{
    "cluster_template": 'dd9cc5ed-3a2b-11e9-9233-fa163e46bcc2',
    "max_batch_size": 1,
    "nodegroup": "production_group"
}

Co-Authored-By: Feilong Wang <flwang@catalyst.net.nz>

Task: 30168
Story: 2002210

Change-Id: Ia168877778aa0d473383eb06b1c8a16dc06b0576
2019-06-07 12:01:10 +12:00
huang.xiangdong 3cb6226ff0 Support multi DNS server
Using comma delimited ipv4 address list to specify multi dns server
"8.8.8.8,114.114.114.114".

Task: 29465
Story: 2004994

Change-Id: I031247b0cc2ae417f18b2a5b9b3832e78ed9dafd
2019-04-08 23:08:45 +00:00
Theodoros Tsioutsias ea95b0dc5c ng-3: Adapt existing drivers
The existing drivers are adapted to get node_count and master_count
information from the cluster's nodegroups. At the same time the
output mappings were updated to reflect the changes in the stack to
the nodegroups.

story: 2005266

Change-Id: I725413e77f5a7bdb48131e8a10e5dc884b5e066a
2019-03-28 10:31:01 +00:00
Zuul d1957c71dc Merge "Improve floating IP allocation" 2019-03-20 18:12:43 +00:00
Lingxian Kong c47fde0cbe Improve floating IP allocation
- Never allocate floating IP for etcd service.
- Introduce a new label `master_lb_floating_ip_enabled` which controls
  if Magnum allocates floating IP for the master load balancer. This
  label only takes effect when the `master_lb_enabled` is set. The
  default value is the same with `floating_ip_enabled`.
- The `floating_ip_enabled` property now only controls if Magnum
  should allocate the floating IPs for the master and worker nodes.

Change-Id: I0a232406deaf112b0cb9e445735d7b49206c676d
Story: #2005153
Task: #29868
2019-03-20 18:44:45 +13:00
Zuul 0cd35dbcca Merge "Support <ClusterID>/actions/resize API" 2019-03-19 22:16:15 +00:00
Feilong Wang 15ecdb8033 Support <ClusterID>/actions/resize API
Now an OpenStack driver for Kubernetes Cluster Autoscaler is being
proposed to support autoscaling when running k8s cluster on top of
OpenStack. However, currently there is no way in Magnum to let
the external consumer to control which node will be removed. The
alternative option is calling Heat API directly but obviously it
is not the best solution and it's confusing k8s community. So with
this patch, we're going to add a new API:

POST <ClusterID>/actions/resize

And the post body will be:

{
    "node_count": 3,
    "nodes_to_remove": ["dd9cc5ed-3a2b-11e9-9233-fa163e46bcc2"],
    "nodegroup": "production_group"
}

The API will be working in a declarative way. For example, there
are 3 nodes in the cluser now, user can propose an API request
like above. Magnum will call Heat to remove the node
dd9cc5ed-3a2b-11e9-9233-fa163e46bcc2 firstly, then bring the node
count back to 3 again.

Task: 29563
Story: 2005052

Change-Id: I7e36ce82c3f442976cc498153950b19c56a1759f
2019-03-19 20:13:17 +00:00
Guang Yee a47f5a3994 make sure to set node_affinity_policy for Mesos template definition
Fixes the problem with Mesos cluster creation where the
nodes_affinity_policy was not properly conveyed as it is required
in order to create the corresponding server group in Nova.

Change-Id: Ie8d73247ba95f20e24d6cae27963d18b35f8715a
story: 2005116
2019-03-01 15:49:06 -08:00
Feilong Wang 4f84c849f6 Add server group for cluster worker nodes
Now Magnums onlys has one server group for all master and worker nodes
per cluster, which is not very flexible for small cloud scale. For a
3+ master clusters, it's easily meeting the capacity when using hard
anti-affinity policy. This patch is proposing one server group for each
master and worker nodes group to have better flexibility.

story: 2004195

Change-Id: If11ba863a2aa538efe1e3e850084bdd33afd27d2
2019-02-27 09:09:20 +00:00
Jim Bach 8f4643d85c Make providing a keypair optional
A user may not rely on nova-keypairs to access their cluster
such as a preconfigured SSSD.

story: 2004402
task: 28035

Change-Id: I77fbdc174d3dddfd312fb8dac20516314d4c182e
2018-11-21 16:17:46 +00:00
Spyros Trigazis 3f773f1fd0 Use existing templates for cluster-update command
Cluster update was used for scaling operations only,
but if the heat-temaplates where changed for any reason
(eg upgrade of the magnum server), the stack update command
was destructive.

This patch uses the existing parameter in the stack update call.

story: 1722573
task: 21583

Change-Id: Id84e5d878b21c908021e631514c2c58b3fe8b8b0
2018-09-24 11:17:02 +02:00
Ricardo Rocha c57bc86384 Deprecate usage of tenant and user in context
Update usage of tenant to project_id and user to user_id when handling context
fields. This drops deprecation warnings.

Change-Id: I8001be34bcc25678ed99b6b6717ad170ae6d2d77
2018-02-06 14:00:43 +00:00
Feilong Wang be0609ce88 Support soft-anti-affinity policy for nodes
Currently, there is no guarantee to make sure all nodes of one cluster are
created on different compute hosts. So it would be nice if we can create
a server group and set it with anti-affinity policy to get a better HA
for cluster. This patch is proposing to create a server group for master
and minion nodes with soft-anti-affinity policy by default.

Closes-Bug: #1737802

Change-Id: Icc7a73ef55296a58bf00719ca4d1cdcc304fab86
2018-01-24 07:13:48 +13:00
Spyros Trigazis 65dfb2009f Add openstack_ca_file configuration option
In the drivers section of magnum.conf add openstack_ca_file.
This file is expected to be a CA Certificate OR CA bundle
which will be passed on every node and it will be installed
on the host's CA bundle.

Update devstack plugin to use the ssl bundle if tls-proxy is
enabled.

Install the CA for drivers:
k8s_coreos_v1
k8s_fedora_atomic_v1
k8s_fedora_ironic_v1
mesos_ubuntu_v1
swarm_fedora_atomic_v1
swarm_fedora_atomic_v2

Add doc in troubleshooting-guide.

Add release notes.

Closes-Bug: #1580704
Partially-Implements: blueprint heat-agent
Change-Id: Id48fbea187da667a5e7334694c3ec17c8e2504db
2018-01-17 14:58:56 +00:00
Ricardo Rocha 84006f63d7 Allow flavor_id on cluster create
Add flavor_id as an option during cluster create. If not given,
the default is taken from the cluster template.

Add flavor_id in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1699245
Change-Id: Ib60c05cce1cf2639ca4740abdd264403033433f9
2017-12-15 16:32:40 +00:00
Kirsten G b07b6f34d5 Add verify_ca configuration parameter
Added configuration parameter, verify_ca, to magnum.conf with default
value of True. This parameter is passed to the heat templates to
indicate whether the cluster nodes validate the Certificate Authority
when making requests to the OpenStack APIs (Keystone, Magnum, Heat).
This configuration parameter can be set to False to disable CA
validation.

Co-Authored-By: Vijendar Komalla <vijendar.komalla@rackspace.com>

Change-Id: Iab02cb1338b811dac0c147378dbd0e63c83f0413
Partial-Bug: #1663757
2017-11-21 10:25:32 -08:00
Ricardo Rocha 446b159349 Allow master_flavor_id on cluster create
Add master_flavor_id as an option during cluster create. If not given,
the default is taken from the cluster template.

Add master_flavor_id in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1699247
Change-Id: Id1d973167b381538121583a0a9691304b39e98de
2017-09-27 09:30:18 +00:00
Jenkins 04b4df0d74 Merge "Allow labels on cluster create" 2017-09-07 07:49:12 +00:00
Ricardo Rocha 3d04ed4cbb Allow labels on cluster create
Add labels as an option during cluster create. If not given,
the default is taken from the cluster template.

Add labels in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1697651
Implements: blueprint flatten-attributes
Change-Id: I8990c78433dcbbca5bc4aa121678b02636346802
2017-08-21 12:27:52 +00:00
Mohammed Naser 5153d912b2
Clean-up server names in drivers
The instance type of servers at the moment can become quite long
due to the Heat autogenerated names.  This patch cleans up the names
so that they are shorter yet contain all the info needed to be able
to know where they belong to.

Change-Id: I5bcbe73f08844242d049b8408221da40d22cd3dc
2017-08-13 14:03:55 -04:00
Ricardo Rocha 79039bb419 Allow docker_volume_size on cluster create
Add docker_volume_size as an option during cluster create. If not given,
the default is taken from the cluster template.

Add docker_volume_size in the Cluster object and use that instead
of the one from ClusterTemplate.

Update both magnum and magnum cli documentation to reflect the above changes.

Partial-Bug: #1697648
Implements: blueprint flatten-attributes
Change-Id: Ic6d77e6fdf5b068fa5319b238f4fd98b4d499be4
2017-06-23 11:31:27 +00:00
yatinkarel d93a813c39 Update Steps for creating dib images
diskimage-builder/bin/disk-image-create no longer exists.
So update steps for creating disk images.

Change-Id: Ieae16ac32641f7525feb6caa0c55caa29615df9e
Closes-Bug: #1675285
2017-05-17 12:13:38 +00:00
Anh Tran 9d689924a9 Remove unused logging import
Change-Id: If9e62a64f1cf1284030a4b5e43677e24c5bc7504
2017-03-15 20:10:50 +00:00
Johannes Grassler e93d82e8b3 Fix CVE-2016-7404
This commit addresses multiple potential vulnerabilities in
Magnum. It makes the following changes:

* Permissions for /etc/sysconfig/heat-params inside Magnum
  created instances are tightened to 0600 (used to be 0755).
* Certificate retrieval is modified to work without the need
  for a Keystone trust.
* The cluster's Keystone trust id is only passed into
  instances for clusters where that is actually needed. This
  prevents the trustee user from consuming the trust in cases
  where it is not needed.
* The configuration setting trust/cluster_user_trust (False by
  default) is introduced. It needs to be explicitely enabled
  by the cloud operator to allow clusters that need the
  trust_id to be passed into instances to work. Without this
  setting, attempts to create such clusters will fail.

Please note, that none of these changes apply to existing
clusters. They will have to be deleted and rebuilt to benefit
from these changes.

Change-Id: I643d408cde0d6e30812cf6429fb7118184793400
2017-02-09 16:44:27 +01:00
Spyros Trigazis 97d5e6ebe7 Move scale managers at driver level
Following up cluster drivers implementation, move the scale managers
at driver level. This change is needed to add the driver field
properly.

Change-Id: Ia854f2354c51b5fa47095bb4cb118416f3f01a33
Implements: blueprint bay-drivers
2017-01-23 17:16:32 +01:00
Spyros Trigazis f997a332da Move monitors at driver level
Following changes for cluster-drivers, move coe specific monitors
at driver level. This change is needed to add the driver field
properly.

Change-Id: Id4658b8f7400bf3c86c8ff81756fb33d1211a0b3
Implements: blueprint bay-drivers
2017-01-23 13:33:37 +01:00
ricolin 61b9bb4f29 [Mesos]Move software configs out of resource group
This patch move software configs out of resource group(mesosslave.yaml).
With this fix Mesos templates will no duplicate software configs.

Change-Id: I241acb6aa9389e01e5412d412f07adb0b318f835
Partial-Bug: #1646710
2017-01-18 16:04:13 +08:00
ricolin 4680fb40f7 [Mesos]Move wait condition out of resource group
This patch let mesos slave share same wait condition and wait condition
handler resource instead of create same function of resource for each
slave node.
Partial-Bug: #1646720

Change-Id: I4271e0bce1a0a9a5b9d5e4b29a53508fe529badd
2017-01-18 16:04:13 +08:00
Mathieu Velten 22fb89a6e1 Make private network optional
If a fixed_network and fixed_subnet is specified no private network
is created by the templates and the specified network is
used instead for VMs provisioning, like in the Ironic driver.

Currently missing is the code to handle the use case where you
specify a fixed_network but not a fixed_subnet, this will come
in a following patch.

Partially Implements: blueprint decouple-private-network
Change-Id: I2003eb709b22b905063d846eb71570fc5e033618
2017-01-09 20:14:44 +01:00
Rajiv Kumar 10e85ee6ce Consolidate heat network resources
Currently for each driver has following code
  1) Create a fixed Network.
  2) Create a fixed subnet in the network created at step 1.
  3) Create a router
  4) Attach subnet(created at step2) to router(created at step 3)

A new resource is created for above tasks in network.yaml file.
New resource does the above tasks and output the fixed network ID
and fixed subnet id, which is used by other parts of the heat
template.

Change-Id: Ib347ce5c54c6566300a43e05b277bf80351a2256
Closes-Bug: #1606912
2016-12-09 15:34:06 +01:00
Jenkins 5488f668e1 Merge "Refactor driver interface (pt 1)" 2016-12-09 12:20:29 +00:00
Jenkins c9b26f3c9b Merge "Factorize load balancer code into its own template" 2016-12-07 18:45:25 +00:00
Dirk Mueller 80fc5a2d42 Add bashate checks to pep8 step
Similarly to pep8 checks, this allows enforcing a consistent
style of the shell scripts accross modfications. For now
only the indentation is enforced to reduce code churn.

Closes-Bug: 1648099
Change-Id: Ie66cbe1aea4bd01a8bba8833ef6cbd2cff6a7c6a
2016-12-07 15:25:41 +01:00
Mathieu Velten ce3c68424a Factorize load balancer code into its own template
Heat types moved to lb.yaml:

Neutron::LBaaS::LoadBalancer
Neutron::LBaaS::Listener
Neutron::LBaaS::Pool
Neutron::LBaaS::HealthMonitor
FloatingIP on LBaaS

Closes-Bug: 1644454
Change-Id: I513b92c205ed97334033ba38ddf1d890ed61ff84
2016-12-06 11:18:27 +01:00
ricolin 5116948fe6 [mesos]remove redundant security group
This patch move security group out of mesos slave resource group.
Security group should only declear once, and use it for the rest part.
Closes-Bug: #1646676

Change-Id: I4ea5af1fda5eea452a21151daad5ec2815389824
2016-12-05 03:17:11 +00:00
Randall Burt 7890725c52 Refactor driver interface (pt 1)
Refactor driver interface to encapsulate the orchestration
strategy. This first patch only refactors the main driver
operations. A follow-on will handle the state synchronization
and removing the poller from the conductor.

1. Make driver interface abstract
2. Move external cluster operations into driver interface
3. Make Heat-based driver abstract and update based on
   driver interface changes
4. Move Heat driver code into its own module
5. Update existing Heat drivers based on interface changes

Change-Id: Icfa72e27dc496862d950ac608885567c911f47f2
Partial-Blueprint: bp-driver-consolodation
2016-12-01 09:23:46 -06:00
Mathieu Velten 004e0cd742 Remove underscores from Nova server names
It creates a mismatch between the generated Nova name
and its hostname which can lead to weird problems.

Closes-Bug: 1645730
Change-Id: I1c7dd459caefacaf41dd77e59c1a6e1df3ef0d42
2016-11-29 16:54:30 +01:00
Jenkins ba11900215 Merge "Cluster Drivers" 2016-10-10 17:18:26 +00:00
murali allada 104501cfe6 Cluster Drivers
- Dynamically load drivers using stevedore
- Changed the entry points to reference drivers instead of
  template definitions
- Implement Create and update driver operations

Change-Id: I5c3259404c796e1935c872cf3109ffecae3cee02
Partially-Implements: blueprint bay-drivers
2016-10-06 08:57:52 -05:00