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
The 2 k8s atomic drivers we currently support are added to the
same driver. This breaks ironic support with the stevedore
work I'm currently doing.
With stevedore, we can choose only one driver based on the
server_type, os and coe. We won't be able to pick a driver and
then choose an implementation bases on server_type.
Partially-Implements: blueprint magnum-baremetal-full-support
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
Change-Id: Ic1b8103551f48f85baa2ed9ff32d5b70b1fab84e
This is patch 3 of 3 to change the internal usage of the terms
Bay and BayModel. This patch updates Bay to Cluster in DB and
Object as well as all the usages. No functionality should be
changed by this patch, just naming and db updates.
Change-Id: Ife04b0f944ded03ca932d70e09e6766d09cf5d9f
Implements: blueprint rename-bay-to-cluster
Factor Out common kubernetes template definitions and address mapping
from Fedora Atomic, CoreOS and Suse drivers.
Partially-Implements: bp bay-drivers
Change-Id: Ib172c19acc1303041f7d8d9249df2d9ca1e4ff6f
Moves magnum.drivers from using Baymodel to ClusterTemplate naming to align
with bay to cluster blueprint.
First part of the rest of magnum.drivers update, with the next part renaming
Bay to Cluster.
Change-Id: I34c5a8bb2b2617b9a057cf7063d4749fa5a39f58
Implements: blueprint rename-bay-to-cluster
Currently bay-show operation does not return bay/cluster
version information. This change contain changes to return
bay/cluster version and container version info.
Change-Id: Ie12b6583e6d85faa3607f87295c04d72698034a5
Closes-Bug: #1613413
"../../common/templates/environments/" path seems to be redundant
in each drivers.
So it should be const variable.
Change-Id: I5cbd30e350c861b611b327a4dda3f92a6316e45b
Closes-Bug: #1616259
This patch adds an environment file and a couple of template resources
to allow the Floating IP resources to be conditionally enabled/disabled.
Change-Id: I95025d39443165e8463a81f8f75e78f5aa3809a1
Partially-Implements: blueprint bay-with-no-floating-ips
This reverts commit 748cf13182.
This commit breaks to setup.py install phase.
Closes-Bug: #1615026
Change-Id: Ie29a723319775e1becff5a6099cb58e3541e399c
This patch establishes a convention of using a symlink named "common" in
drivers/{driver}/templates/ that points to drivers/common/templates/.
This has two benefits. First, it lowers the burden of forking a driver
by allowing drivers/common/templates/ to be copied over the symlink,
rather than having to update all of the paths in the templates and
driver code. Second, it shortens the paths used, which makes things
cleaner.
Change-Id: I9176ec03905d0a87a43ba6bedf1f768b2b316125
Partially-implements: blueprint bay-drivers
This is workaround fix to support baremetal.
Following items are remained to support.
* Documents
* Functional test
To test this template, there are some requirements and problem as below.
Requirements:
* `ephemeral_disk` on ironic baremetal flavor
`ephemeral_disk` is used for docker storage instead of cinder volume.
* `fixed_subnet` must be setup with dns_nameservers like following.
* `neutron subnet-update private-subnet --dns-nameserver 8.8.8.8`
* `fixed_subnet` must be IP version 4.
if you use devstack, please add following configuration.
* `IP_VERSION=4`
* Fedora 23 image including kubernetes, etcd, flannel.
Problem:
Ironic stores `instance_info` about nova instance.
`instance_info` contains config_drive data, but this data can be
too large to store ironic.nodes table.
Magnum uses large config drive data to setup k8s.
It means, we can not start ironic instance by Magnum.
Workaround fix is changing column type of ironic.nodes.instance_info.
Following sql will help you.
`alter table ironic.nodes modify instance_info LONGTEXT;`
Partial-Implements: blueprint magnum-baremetal-full-support
Change-Id: Ica87610b9114bff4277b492de8fe528fe2860108
Closes-Bug: #1454895
Closes-Bug: #1472938
Co-Authored-By: Spyros Trigazis <strigazi@gmail.com>
The ApiGatewaySwitcher child template and the environment files that
enable/disable the master load balancer are identical across the bay
drivers that use them. This patch pulls them into the common directory.
Change-Id: I3c34df57f3c6487747ad896444075bf6a22725e5
Partially-Implements: blueprint decouple-lbaas
In scale manager, we get host ip address from COEs, these ip address are
all private ip address, so passing a private ip address of host of nodes
to scale manager to let it decide which nodes to be removed.
Related-Bug: #1600125
Change-Id: I1a396f55b564f1b3ca59d5f73d264ef0eb948201
This patch adds an environment file and a couple of template resources
to allow the LBaaS resources to be conditionally enabled/disabled.
Change-Id: I40ef0839dca84f398efb02022fa7c1de821fb1a3
Partially-Implements: blueprint decouple-lbaas
Partially-Implements: blueprint bay-with-no-floating-ips
Moves templates and template_definitions to the new
directory structure.
Change-Id: I42e4d2bd056f3d8082ef51ef599d917f2fe82960
Paritially-Implements: blueprint bay-drivers
Moved all the swarm templates and template_definition code
to the magnum/drivers folder.
Moved base template_definition classes to drivers/common
folder
Change-Id: Ieff57f0f47835c35d9f17c3d7d1b7e6a40907462
Partially-Implements: blueprint bay-drivers
Co-Authored-by: Spyros Trigazis <strigazi@gmail.com>
Currently when we create a Bay, magnum is not enough to prevent bay creation failure,
due to Invalid discovery url can be referenced and there're no check toward it. We
should check the discovery url before creating bay, a 400 Invalid will be raised if
the discovery url is invalid:
1.the discovery url should be a correct url of etcd cluster.
2.the discovery url should have suitable cluster size.
Change-Id: Ib75f9f2aade18b16dd46035efe139311faf93e1e
Add a parameter 'slaves_to_remove' that lists resources to be
removed on stack update. The value will be passed to
removal_policies of the 'mesos_slaves' resource group.
Change-Id: I18fcd0be962dd7414329dcfcad8bb4c79958ee9a
Partially-Implements: blueprint mesos-smart-bay-scale-down
1.when self.get_output_value() return None, K8sApiAddressOutputMapping's
set_output() and SwarmApiAddressOutputMapping's set_output() should
checks whether output_value is None at first.
2.'output_value = "%(protocol)s://%(address)s:%(port)s" % params'
certainly not is None, So 'if output_value is not None' is useless.
Change-Id: I637ee0793e966ef46bfee6e51fbda2a15032979e
To setup magnum easier, name based configuration is important.
This patch makes config file support trustee_domain_name and
trustee_domain_admin_name in trust section.
If name and id of trustee domain are provided by user, both
values are passed through into keystone.
Closes-Bug: #1581372
Change-Id: Ia691aca7c29a471f6ba36a1a371ec1edf830b365
* This parameter will be optional and users will be able to select
a supported driver, otherwise the default configuration will be
used.
* Add docker storage driver enum field to baymodel
* Add db upgrade file
* Update heat templates for kubernetes and swarm allowing only
devicemapper and overlay as docker_storage_driver values.
* Add configuration for OverlayFS on Fedora Atomic, if overlay is
incompatible bay creation will result a CREATE_FAILED status.
* Factor out configuration of docker storage drivers
* Update tests
* Add Release Notes
Partially-Implements: blueprint support-for-different-docker-storage-driver
Change-Id: Ib58cb734c4e9c90d5d83574852213d2e97359e92
This path adds supporting to using insecure registry for k8s COE when
deploy a k8s COE.
Partially-Implements: blueprint support-insecure-registry
Change-Id: I384358b1419085ed42d96239f97292fa32db9aed
mesos_slave_executor_env_variables is mesos executor
environment variables, and it should be a json form.
(1) validate mesos_slave_executor_env_variables
if matching the json form.
(2) modify the mesos slave configure file
(3) unit test
Partially-Implements:blueprint mesos-slave-flags
Change-Id: I35e56515f321b0df52b3ba0e8aba48d7dd421d58
* Add cloud-init to generate TLS certificates in each node.
* Modify coreos fragments to point to the path of certificates.
* Add support for "--tls-disabled" to turn off TLS.
* Use Keystone trust to retrieve TLS certificates.
Implements: blueprint tls-for-coreos-bay
Change-Id: I66842f9374abe5a9bbf275fa130c0eae3e6065ab
Add docker registry support for swarm in heat template. After this
patch is merged, we can use docker registry in swarm bay.
Change-Id: I5161a4c0259a2df89dfc8591453aebc6f037d40d
Partially-Implements: blueprint registryv2-in-master
The Mesos slave has many different flags and different user have
different requirement for different parameters, add isolation,
work_dir, image_providers parameters for slave in mesos bay to
give end user more choice. for example Set the parameters to
support Container Images in Mesos Containerizer
Note: support Container Images in Mesos Containerizer needs mesos
version >= 0.28
Partially-Implements:blueprint mesos-slave-flags
Change-Id: Ib4fd7076704a3266f0cf2addf08896729ec6062f
After this patch is merged, docker registry will be available.
We can push docker images into local repo on a bay node.
Change-Id: I1245bde7ef3173226617e60e6436759f433eb464
Partially-Implements: blueprint registryv2-in-master
Currently, we use the users auth token, which expires after a while.
We need to use a trust instead.
Remove user_token at the same time.
Change-Id: Id1d34c59eccd70be24c5b9e00cd921b5a9d59860
Partially-Implements: blueprint use-trust-for-tls-cert-generation
Previously,the kubernetes bay type did not support the Magnum Container
Volume Model. This patch adds support for volume through the following:
1. Add volume_driver, region_name to
kubernetes bay type.
2. Update kubernetes unit tests to support container volume.
3. Update kubernetes heat templates for container volume model.
Note: The Container Volume Model of Kubernetes need the
kubernetes Version >= 1.1.1 and docker version >= 1.8.3
Change-Id: I8f568087f8e8254cb14a81edb526e596da33abcc
Partially-Implements: blueprint magnum-integrate-with-cinder
Allow configuring Flannel with 3 different backends
Magnum deploys k8s/swarm over a dedicated neutron private network,
possibly using flannel. Flannel's `host-gw` backend gives the best
performance in this topopolgy (private layer2): no packet processing
overhead, no reduction to MTU, scales to many hosts as well as the
alternatives. The performance difference is significant, see bug for
performance numbers for the 3 backend options.
Note that part of this change involves relaxing the minion IP spoofing
rules to allow traffic from all dynamically-allocated flannel subnets.
This is morally equivalent to what we were doing previously with
encapsulation - only now neutron is able to see the inner IP header
directly.
This patch repurposes the label "flannel_use_vxlan" when the network
driver is flannel.
1. Rename the label flannel_use_vxlan to flannel_backend
2. Redefine the value of this label from "yes/no"
to "udp/vxlan/host-gw"
For example, to create a bay model with flannel as network driver:
--network-driver flannel --labels flannel_backend=host-gw
Other backend options are udp and vxlan.
Co-Authored-By: Ton Ngo <ton@us.ibm.com>
Partial-Bug: #1518605
Closes-Bug: #1516789
Change-Id: I6d2441664ad1baaca14d0e6ff4bcddbe75bee094
Url for keystone is needed by trust and other services, such as k8s
and docker registry.
Change-Id: I269332b5736b6c5a9bc85d843f0d03f1a4d059ee
Partially-Implements: blueprint create-trustee-user-for-each-bay
Previously,the mesos bay type did not support the Magnum Container
Volume Model. This patch adds support for volume through the following:
1. Add username, tenant_name, preempt, region_name, domain_name to
mesos bay type.
2. Add get_parameter to mesos.
3. Update mesos unit tests to support container volume.
4. Update mesos heat templates for container volume model
Change-Id: Icf7cb9fc38c7facb2d49904b6e52bbce974948f7
Partially-Implements: blueprint magnum-integrate-with-cinder
Add trust info into heat params. If any service wants to use the
trust, it can get the info from the heat params.
Change-Id: I406a80d0d4fc92c6045b902945198a0d765f1123
Partially-Implements: blueprint create-trustee-user-for-each-bay
Originally BayModel#fixed_network was used for setting which
fixed_network was set to Bay [1].
But this attribute changed to setting fixed_network_cidr [2].
This patch removes mapping for fixed_network_cidr.
And also, fixed_network_cidr attribute will be add to
baymodel [3].
Magnum user want to specify fixed_network for bay, so I'll add
a mapping to template definition to set fixed_network
next patch.
[1]: bc3bc6190d/magnum/conductor/handlers/bay_k8s_heat.py (L101)
[2]: I624b95930f9eb506abfb2e29beea8d83878ea142
[3]: Ia74ed924b3058b4891775f34f1b9624774c02ddb
Change-Id: Ia9820213bcc0e2a451450dd014e774843b881fd1
Closes-Bug: #1536484
The CoreOS template has been fixed [1]. This patch is for updating
the CoreOS template definition.
[1] https://review.openstack.org/#/c/262628/
Partial-Implements: blueprint coreos-k8s-bay
Change-Id: I19660bfa702f8349090fd66d098bd037f2316f0d
If discovery endpoint is not accessible, magnum returns "ERROR: Timed
out waiting for a reply to message ID a74fe7ec63b34f298c46c9f6659257d7
(HTTP 500)" when we create a bay. The response is misleading.
So we should raise exception when magnum fails to get discovery_url
and make the response easy to understand.
Change-Id: Ia649e55de0878160f42fecf1647d9da7fc954d72
Closes-Bug: #1529200
Swarm agent has been moved out of master node in the depending patch,
so it is appropriate to separate the flavor now
Co-Authored-By: Hongbin Lu <hongbin.lu@huawei.com>
Closes-Bug: #1498570
Change-Id: I6f5f15274a10f503a2554ec554e5c822f47a39dc
Object "stack" returned by Heat doesn't necessary have the "outputs"
attribute. This could happen when a stack is in failure state. Magnum
needs to handle this case robustly.
Closes-Bug: #1525678
Change-Id: I288af63bd9e2704f9869f3eaf8d8d4c6495a7973
number_of_masters, number_of_minions and number_of_nodes
should be number, not string.
Change-Id: Iac20023f0448aab313302c174e3743b95cd42d7a
Closes-Bug: #1524236
To create a HA mesos bay, users need to specify at least 3 master
nodes. For example:
magnum bay-create --name mesosbay --baymodel mesosbaymodel \
--master-count 3
Change-Id: I85c2113fec0fd743cc3b142e6a490bdfb3b896e6
Implements: blueprint mesos-multi-master-node
Move get_discovery_url to BaseTemplateDefinition so swarm and k8s template
can share it.
Behavior changes
Change swarm's discovery member number from 1 to bay.master_count
Partially implements: blueprint swarm-high-availability
Change-Id: I2617bc81daf68b45148987190a2f04820ad18bfd
Would like to make swarm much more similar with k8s.
This patch is the preparation of supporting Swarm HA mode:
1. Refactor swarm.yaml to swarmcluster.yaml and swarmmaster.yaml
2. Add api_pool, LB in front of swarm master node.
3. Add etcd_pool
After this change:
Swarm bay will update the fileds of 'master_addresses'.
P.S. notes Swarm HA is not supported yet, master_addresses will be only 1
ip address.
Partially implements: blueprint swarm-high-availability
Change-Id: Ib6346bfd5a7ad0ef2226a6e6bc98b0ad46e577cb
Move Mesos master into its own nested template. This will make the
style consistent with k8s templates.
Change-Id: Icfb0df1b486febacc08f34ca86a58a80dc83f812
Partial-Implements: blueprint heat-network-refactor