Commit Graph

95 Commits

Author SHA1 Message Date
murali allada f09f314da4 k8s coreos bay driver
This patch moves k8s-coreos specific templates and
template_definition class to the new drivers folder.

It also deletes the /magnum/templates folder
as everything has been moved to the drivers directory.

Change-Id: I6b2ca49e4d7d5fcfb96d0abc373d6476fd907358
Paritially-Implements: blueprint bay-drivers
2016-07-11 12:35:06 -05:00
Vijendar Komalla a5ae8b37aa Bay driver: k8s Fedora Atomic
Change-Id: I1fae89e902ef73fe18ef78733a18e3690b67f312
Paritially-Implements: blueprint bay-drivers
2016-07-11 10:50:06 -05:00
Jenkins f8fa49d144 Merge "Allow k8s cluster without LBaaS" 2016-07-08 15:50:18 +00:00
Drago Rosson 2ea72d739d Allow k8s cluster without LBaaS
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
2016-07-06 15:01:00 -05:00
Spyros Trigazis 242cbe00da Mesos-Ubuntu bay driver implementation
Moves templates and template_definitions to the new
directory structure.

Change-Id: I42e4d2bd056f3d8082ef51ef599d917f2fe82960
Paritially-Implements: blueprint bay-drivers
2016-07-06 21:50:14 +02:00
Murali Allada 4080d4a84c Bay driver implementation
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>
2016-07-05 22:30:31 +02:00
Jenkins 4d1d73b90e Merge "Validate discovery url when create a bay" 2016-06-30 01:19:50 +00:00
Jenkins f11c5a3bde Merge "Modify mesos template to support removal policy" 2016-06-30 00:42:09 +00:00
PanFengyun 253f0ce48c Validate discovery url when create a bay
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
2016-06-29 12:03:55 +08:00
Drago Rosson db61da3f8f Allow Bay templates to include Heat environments
Change-Id: I96ebd1687654193ea8cfbcfb816d9276594400ac
Partially-Implements: blueprint decouple-lbaas
Partially-Implements: blueprint allow-user-softwareconfig
2016-06-28 08:41:41 +00:00
Wenzhi Yu b456cf7a91 Modify mesos template to support removal policy
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
2016-06-23 16:47:42 +08:00
PanFengyun a482ce8179 First check whether output_value is None
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
2016-06-09 00:03:06 +08:00
Jenkins d12433a49a Merge "Support trustee_domain_name in config file" 2016-06-06 11:09:04 +00:00
OTSUKA, Yuanying 1d74849193 Support trustee_domain_name in config file
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
2016-06-06 08:23:43 +09:00
Spyros Trigazis dec85b538f Add docker-storage-driver attribute to baymodel
* 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
2016-06-01 10:42:19 +02:00
Eli Qiao 9641afd305 Support using insecure registry for k8s COE
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
2016-05-30 08:38:11 +08:00
wangqun 3bd8d5eb8b Add mesos_slave_executor_env_variables validate
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
2016-05-20 08:23:25 +00:00
Hongbin Lu bb05385b58 Enable TLS support for k8s CoreOS
* 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
2016-05-09 18:03:43 -04:00
Jenkins 391614e7bf Merge "Add docker registry support for swarm" 2016-05-05 00:57:02 +00:00
Hua Wang 7d8d090a46 Add docker registry support for swarm
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
2016-05-03 09:49:05 +08:00
Jenkins b5068b59ed Merge "Enable Mesos Bay export more slave flags" 2016-04-20 10:11:33 +00:00
wangqun 84e724edee Enable Mesos Bay export more slave flags
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
2016-04-19 06:48:38 +00:00
Hua Wang 970c9a2d18 Add support for docker registry
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
2016-04-13 16:17:20 +08:00
Hua Wang 5ecf71aabc Use trust for tls cert generation in swarm
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
2016-04-05 10:27:02 +08:00
Jenkins ee059477be Merge "Add Container Volume Model into Kubernetes Heat Templates" 2016-04-04 20:39:27 +00:00
wangqun bc56f286d4 Add Container Volume Model into Kubernetes Heat Templates
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
2016-03-31 07:43:25 +00:00
Angus Lees 14909f0944 Add flannel's host-gw backend option
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
2016-03-18 04:53:24 +00:00
Hua Wang b79203aa98 Add auth_url
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
2016-03-03 15:24:29 +08:00
wangqun c932d5fab9 Add Container Volume Model into Mesos Heat Templates
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
2016-03-02 05:05:51 +00:00
Hua Wang 1d2db245b7 Add trust info into heat params
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
2016-02-22 11:58:53 +08:00
Hongbin Lu 3f9b930a65 Removed unused config coreos_discovery_token_url
Change-Id: I849fe6eb3c0a0544401a93443547603d652a7c57
2016-01-31 21:01:06 -05:00
OTSUKA, Yuanying cb211c165e Revert "fixed_network should be fixed_network_cidr"
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
2016-01-25 11:31:57 +09:00
Hongbin Lu 3509dbcbd5 Fix the CoreOS template definition
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
2016-01-20 11:16:46 -05:00
space f0d3a93e30 Use bay name as Mesos cluster name
Add bay's name as cluster name
Unit test error

Change-Id: I52a07657ff09a5df675538904b3c985bc314d777
Closes-Bug: #1523180
2016-01-13 20:10:19 +08:00
Jenkins f75c6caa60 Merge "Raise exception when failed to get discovery_url" 2015-12-29 07:56:02 +00:00
Hua Wang c249660f5e Raise exception when failed to get discovery_url
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
2015-12-28 09:20:33 +08:00
Arun prasath 7a0d43f82c Separate flavor between master and agent node
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
2015-12-22 20:42:24 +00:00
Hongbin Lu 29e73e3fa1 Handle the case that stack has no "outputs"
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
2015-12-14 18:53:29 -05:00
Hua Wang c5fc62ed28 The type of number_of_masters should be int not string
number_of_masters, number_of_minions and number_of_nodes
should be number, not string.

Change-Id: Iac20023f0448aab313302c174e3743b95cd42d7a
Closes-Bug: #1524236
2015-12-10 10:41:21 +00:00
Hongbin Lu a82b098664 Enable HA mode for mesos bay in Magnum
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
2015-12-07 11:47:32 -05:00
Eli Qiao 80df1e3ecc Share get_discovery_url in templates
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
2015-12-04 11:40:03 +08:00
Eli Qiao 353ae9b87d Swarm: Split swarm.yaml to swarmcluster.yaml and swarmmaster.yaml
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
2015-11-27 14:06:11 +08:00
Jenkins 0472fa8173 Merge "Refactor Mesos templates" 2015-11-23 12:09:58 +00:00
Hongbin Lu e4b10d1f13 Refactor Mesos templates
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
2015-11-19 17:40:28 -05:00
Daneyon Hansen 00b6cd9953 Adds Magnum Container Network Model to Swarm
1. Updates network-driver API validation.
2. Updates AtomicSwarm template definition for swarm, flannel and
   labels.
3. Adds initial unit test.

Partially-Implements: blueprint extend-baymodel-net-attributes
Partially-Implements: blueprint conductor-template-net-update

Change-Id: Ia80f239bcbd29ae14de25ae3e915a49d9b9bafd1
2015-11-19 06:20:14 +00:00
Daneyon Hansen de1edaec40 Changes Swarm Bootstrapping from Public to Etcd
Previously, Swarm leveraged Docker's public discovery mechanism
for bootstrapping a cluster. Etcd bootstrapping is supported by
Swarm and is preferred for production use for the following reasons:

1. Required for HA.
2. Is more secure.
3. Required for the Flannel network-driver.

Partially-Implements: blueprint extend-baymodel-net-attributes
Partially-Implements: blueprint conductor-template-net-update

Change-Id: Iab844c03ed7cf8bbee69b72ff71c219f0a5ab1dd
2015-11-19 05:59:03 +00:00
Daneyon Hansen 4a2c71c4c4 Adds Cinder Volume Support to Swarm Bay Type
Previously, the swarm bay type did not support using a cinder
volume for docker.

Implements: blueprint swarm-cinder

Change-Id: I8acaf60caab52a5e5a234e4c5f89ce3dd155759c
2015-11-16 20:28:05 +00:00
Hua Wang 37b731b510 Rename heat-kubernetes, heat-mesos, docker-swarm
Rename heat-kubernetes to kubernetes, heat-mesos to mesos,
docker-swarm to swarm in templates.  We use heat templates and
no other methods, so I think it is unnecessary to add heat before
coe. kubernetes, mesos, swarm are better than
heat-kubernetes, heat-mesos, docker-swarm.

Change-Id: I257b35c1c4ef55d3172095736f550f2c55c8d81f
Closes-Bug: #1514682
2015-11-11 16:29:33 -05:00
Eli Qiao e36911f429 Swarm: Map master address to api_address based on TLS
api_address is a API address instead of master node's IP address.
This patch fix it by adding a new OutputMapping, it will help to handle
the mapping from master address to api_address.

Also test cases added.

Closes-Bug: #1514311
Change-Id: I47baf92dd466150adbd75746d0cb804d108f7d5f
2015-11-10 11:53:49 +08:00
Hongbin Lu 1b928008bd Unify common output keys across Heat templates
After this commit, all Heat templates have five common outputs:
* api_address: API endpoint of specific COE.
* kube_masters/swarm_master/mesos_master: Public IP address(es) of
  master node(s).
* kube_masters_private/swarm_master_private/mesos_master_private:
  Private IP address(es) of master node(s).
* kube_minions/swarm_nodes/mesos_slaves: List of public IP addresses
  of worker nodes.
* kube_minions_private/swarm_nodes_private/mesos_slaves_private:
  List of private IP addresses of worker nodes.

Change-Id: Ie44136dafa326db598a5f17978d89adce8e69801
Closes-Bug: #1514252
2015-11-09 17:42:32 -05:00