Commit Graph

33 Commits

Author SHA1 Message Date
Takashi Kajinami 90a82c4b19 Drop dependency on pytz
... because the current usage can be easily re-implemented using
the built-in datetime library.

Change-Id: Ic0c7919f0288fd61dd5bfa402c99d7080ffd9083
2024-01-27 19:50:06 +09:00
Diogo Guerra 11bcc17568 Drop bay and baymodel from magnum
- Drop bay and baymodel tests
- Drop bay and baymodel from controllers

Depends-On: Ib85e4fda8e4ac467bd49590dc72ba5913bb9a19d

Story: 2009104
Task: 42957
Task: 42959

Signed-off-by: Diogo Guerra <diogo.filipe.tomas.guerra@cern.ch>
Change-Id: Ida2e42c86400438951d9804e3ce122c56a46b94f
2023-05-09 13:59:57 +00:00
Theodoros Tsioutsias 61648f7c7c Labels override
The post for both clusters and nodegroups is adapted to wait for a
boolean flag called merge_labels. Based on this flag the API will
either merge the provided with the parent labels or just use the
provided labels.

At the same time, the get methods of both clusters and nodegroups
are adapted to include new fields in the response called
"labels_overridden", "labels_added", "labels_skipped". The fields
contain the differnces with the parent labels.

story: 2007515
task: 39691
Change-Id: I1054c54da96005a49e874de6f4cf60b5db57fc02
2020-05-13 08:07:29 +00:00
Theodoros Tsioutsias 5027e0daf8 ng-8: APIs for nodegroup CRUD operations
This adds the changes needed in the API and conductor level to support
creating updating and deleting nodegroups.

Change-Id: I4ad60994ad6b4cb9cac18129557e1e87e61ae98c
2019-09-26 08:45:57 +00:00
Theodoros Tsioutsias 18119fb3d1 ng-5: APIs for listing and showing nodegroups
This adds all needed changes to support listing and showing
nodegroups in an existing cluster.

Change-Id: I5607c27eb0e84677acda29af006335374b60dd27
2019-03-29 10:31:48 +00:00
Theodoros Tsioutsias 3f80cbab06 ng-4: Adapt cluster object
This commit removes the fields node_addresses, master_addresses,
node_count and master_count from the cluster object since this info
will be stored in the nodegroups. At the same time, provides the way
to adapt existing clusters to the new schema.

story: 2005266

Change-Id: Iaf2cef3cc50b956c9b6d7bae13dbb716ae54eaf7
2019-03-29 10:31:48 +00:00
Clenimar Filemon ec950be894 federation api: api endpoints
this commit introduces a new '/federations'
endpoint to Magnum API, as well as its controllers,
entities and conductor handlers.

this corresponds to the first phase of the
federation-api spec. please refer to [1] for more
details.

[1] https://review.openstack.org/#/c/489609/

Change-Id: I662ac2d6ddec07b50712109541486fd26c5d21de
Partially-Implements: blueprint federation-api
2018-02-09 00:59:31 -03:00
Vijendar Komalla aa56874bfb Resource Quota - Adding quota API
Change-Id: I7d2da1f86edae002531a529c4ffb469ce9f1777b
Partially-Implements: blueprint resource-quota
2017-01-23 11:00:11 -06:00
Jenkins 5f78e2f33a Merge "Restrict magnum service name" 2016-09-16 08:09:15 +00:00
Jaycen Grant 729c2d0ab4 Rename Bay DB, Object, and internal usage to Cluster
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
2016-09-08 13:01:12 -07:00
Jaycen Grant 0b7c6401dd Rename BayModel DB, Object, and internal usage to ClusterTemplate
This patch is the first of 3 patches to change the internal
usage of the terms Bay and BayModel. This patch updates
BayModel to ClusterTemplate. No functionality should be
changed by this patch, just naming and db updates.

Change-Id: I0803e81be6482962be2878a8ea2c7480f89111ac
Implements: blueprint rename-bay-to-cluster
2016-09-01 14:47:39 -07:00
Jaycen Grant 8aed31a6a6 Add cluster to cert commands
This patch will update the certificate api to use the term Cluster
instead of Bay.  Bay will still be supported, but will be deprecated
and removed in a future release.

Change-Id: Ie169162a743320813e636597240941b5dd59ded3
Implements: blueprint rename-bay-to-cluster
2016-08-24 19:00:59 +00:00
Rajiv Kumar fd05c590a5 Restrict magnum service name
Magnum service binary name can be only conductor. Currently any
string having length less than 256 is allowed.

Change-Id: I03dad7a36a01e22e5fc63917f5e2919636f6ab2f
Closes-bug: #1615221
2016-08-22 09:30:31 +05:30
Jaycen Grant eaddb942fd Rename Bay to Cluster in api
This is the first of several patches to add new Cluster commands
that will replace the Bay terminalogy in Magnum. This patch adds
the new Cluster and ClusterTemplate commands in addition to the
Bay and Baymodel commands.  Additional patches will be created
for client, docs, and additional functional tests.

Change-Id: Ie686281a6f98a1a9931158d2a79eee6ac21ed9a1
Implements: blueprint rename-bay-to-cluster
2016-08-17 22:24:45 +00:00
Madhuri Kumari 303d14dde0 X509keypair cleanup
This patch does following:

* Removes X509keypair controller as there is already Certificate
  controller for same purpose.
* Removes X509keypair conductor.
* Removes name, ca_cert and bay_uuid from x509keypair model as
  Bay model already holds certificate references.
* Add intermediates and private_key_passphrase to x509keypair
  model.
* Remove related tests and changes.

Change-Id: I9271221cd1d07c672c4a380a4ae3593237fca66a
Partially-Implements: blueprint barbican-alternative-storeX
2016-05-30 12:02:26 +05:30
Tom Cammann 82f477bb90 Remove k8s APIs pod, rcs, svc and container API
Magnum supports multiple COEs however it contains APIs that only work
with certain COEs. To create a coherent service we will only support
APIs that work across all bay types. We will allow API extensions to bay
drivers to allow Magnum to manage containers, but we are not attempting
to create a unified abstraction for containers across COEs.

A follow up patch will continue this refactor by removing the objects
for the k8s specific objects and the CLI commands from
python-magnumclient.

Implements: blueprint delete-container-endpoint
Change-Id: I1f6f04a35dfbb39f217487fea104ded035b75569
2016-05-21 15:37:40 +00:00
Yang Hongyang cb1fde6e77 Return correct object type
In python3, type is more strict, compare str to int will report error.
The patch fix this.

Partially-Implements: blueprint magnum-python3

Change-Id: I66583113dd93425c2157dfa60a5325b1afd03f29
2016-02-29 14:33:07 +08:00
Jenkins e15a6421f1 Merge "Remove node object from Magnum" 2016-02-16 14:36:00 +00:00
Dinesh Bhor e7be462a24 Fix invalid import order
Updated import order as per the OpenStack import standards [1].
Modules under magnum/common/pythonk8sclient are not covered in
this patch because this code is generated via a third party
tool "swagger-codegen" which does not follows openstack
standards yet.

[1] http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: Ia87f3e797ee627bf3c04d2bae9639fd305b41b0d
2016-02-07 22:54:41 -08:00
Hua Wang 342e83f033 Remove node object from Magnum
The node object represents either a bare metal or virtual machine
node that is provisioned with an OS to run the containers, or
alternatively, run kubernetes. Magnum use Heat to deploy the nodes,
so it is unnecessary to maintain node object in Magnum. Heat can do
the work for us. The code about node object is useless now, so let's
remove it from Magnum.

Closes-Bug: #1540790
Change-Id: If8761b06a364127683099afb4dc51ea551be6f89
2016-02-04 14:02:49 +08:00
Jenkins 554af35b74 Merge "Performance: leverage dict comprehension in PEP-0274" 2015-12-04 15:00:34 +00:00
houming-wang 98875345c2 Performance: leverage dict comprehension in PEP-0274
PEP-0274 introduced dict comprehensions to replace dict constructor
with a sequence of length-2 sequences, these are benefits copied
from [1]:
  The dictionary constructor approach has two distinct disadvantages
  from the proposed syntax though.  First, it isn't as legible as a
  dict comprehension.  Second, it forces the programmer to create an
  in-core list object first, which could be expensive.
Magnum does not support python 2.6, we can leverage this.
There is deep dive about PEP-0274[2] and basic tests about
performance[3].
Note: This commit doesn't handle dict constructor with kwagrs.
This commit also adds a hacking rule.

[1]http://legacy.python.org/dev/peps/pep-0274/
[2]http://doughellmann.com/2012/11/12/the-performance-impact-of-using
-dict-instead-of-in-cpython-2-7-2.html
[3]http://paste.openstack.org/show/480757/

Change-Id: I61992fa428d6760449afe3754b02506336e8b421
2015-12-03 22:02:02 -05:00
Yang Hongyang f0749cc56c Add missing bay_create_timeout to bay object
Currently bay-show command always shows "0" in bay_create_timeout, this
is confusing for users, store bay_create_timeout into db so that bay-show
will return correct bay_create_timeout value.

Change-Id: Icaea11d7d298bd6245a50c464bff6ff20292e092
Closes-Bug: #1521146
2015-12-02 22:46:59 +08:00
Surojit Pathak e360cf0be2 Adding API support for magnum service
These changes implement the API level support for querying magnum
services.

Partially-Implements: blueprint magnum-service-list
Closes-bug: #1498158
Depends-On: Ia0c09222405c87cb61e5de4a43ba345ae3405b50
Change-Id: Ib816f595ba2edef29edaec40fa940570755b10aa
2015-09-29 18:45:49 +00:00
Madhuri cefc5a9ac3 Add Certificate controller for TLS support.
The Certificate controller has 2 operations:

1. POST

Generate X509 certificate using bay's CA cert.
Below is an example of Certificate POST API request using magnum command:

Example Request:

    curl -X POST -H 'Content-Type: application/json' \
        -d '{"bay_uuid": "<bay_uuid>", "csr": "<csr>"}' \
        http://localhost:9511/v1/certificates

This creates a X509 certificate signed by the given bay's CA and returns
it. No database information is stored in Magnum against it. For each POST
request, a new certificate is generated.

Example Response:

    {"bay_uuid": "<bay_uuid>", "csr": "<csr>",
     "pem": "<pem encoded certifiacte>"}

2. GET
Fetches the CA cert associated with a bay. Below is an example of CA GET
API request using magnum command:

Example Request:

    curl -X GET http://localhost:9511/v1/certificates/<bay_uuid>

This fetches stored CA cert for the given Bay, which can be used to validate
any client and node certificates signed by the Bay's CA. The value for each
is fetched from Barbican or Magnum db based on the different configuration
for storage of certificates.

Example Response:

    {"bay_uuid": "<bay_uuid>", "pem": "<pem encoded certifiacte>"}

Co-Authored-By: Andrew Melton <andrew.melton@rackspace.com>

Change-Id: I4b72cc1e1bddc7a7c7eeb0ab22d3769a666ccb2b
Partially-Implements: bp secure-kubernetes
2015-09-05 13:45:43 +00:00
Madhuri 4eb9425185 Add X509KeyPair controller and conductor.
This patch adds X509KeyPair controller and conductor to handle all
x509keypair related operation and also add test for it.

Change-Id: I5773fcd5bdf8a30fd195714e3e0fdc9d1b0c962d
Partially-Implements: bp secure-kubernetes
2015-08-17 17:56:19 +09:00
Tom Cammann 6e6af73789 Replace dict.iteritems() with dict.items()
Automated change to replace dict.iteritems() which is no longer present
in python 3 with dict.items(). The later can be very marginally slower
in python 2, however the alternative to this would be to use
six.iteritems(dict) which has a greater cognitive overhead and reduces
readability with little or no performance gain.

Refer to this mailing list thread for more on this issue
http://markmail.org/message/tx7776ewlutxitjx

Code under magnum/common/pythonk8sclient has been ignored as this is
autogenerated code expected to be pull out of Magnum.

Partially-Implements: blueprint magnum-python3
Change-Id: Ib7cd192b2be3776985963bdf7fa14e96a464d0ae
2015-06-25 16:19:38 +01:00
Jenkins f6746e3890 Merge "Update service manifest parsing according to v1beta3" 2015-05-10 20:52:36 +00:00
Madhuri Kumari 08a27f1c0f Update service manifest parsing according to v1beta3
Now that Kubernetes 0.15.0 release is supported and it has
v1beta3, the manifest structure has changed from v1beta1 to
v1beta3. This change implements the v1beta3 manifest parsing
logic for service resource of Kubernetes.

Change-Id: I1200473f91118eaa48b1cec386f30cf8a50708b5
Partially-Implements: blueprint python-k8sclient
2015-05-10 10:37:00 -07:00
Madhuri Kumari 4d7a38d3af Update rc manifest parsing according to v1beta3
Now that Kubernetes 0.15.0 release is supported and it has
v1beta3, the manifest structure has changed from v1beta1 to
v1beta3. This change implements the v1beta3 manifest parsing
logic for rc resource of Kubernetes.

Change-Id: I54aa0502c6d9a58652623800e02766ad5b09b159
Partially-Implements: blueprint python-k8sclient
2015-05-07 07:00:16 +00:00
Madhuri Kumari 8f66349168 Update pod manifest parsing according to v1beta3
Now that Kubernetes 0.15.0 release is supported and it has
v1beta3, the manifest structure has changed from v1beta1 to
v1beta3. This change implements the v1beta3 manifest parsing
logic.

Change-Id: Iaebe9fa29ba81d4f49a1b9fb1a547757b96520da
Partially-Implements: blueprint python-k8sclient
2015-04-28 17:14:17 +09:00
Jennifer Carlucci 1d358a8be3 Add timeout parameter to bay create
Add timeout parameter to bay create
Update test cases for the timeout parameter

Change-Id: If8603fc47ba3659eba145e91bcaa30095cabd094
Closes-bug: #1433109
2015-04-23 13:34:24 -05:00
Davanum Srinivas aa039bb011 Make room for functional tests
We need to consolidate the unit tests into a separate
directory so we can run just the unit tests in our py27
tox target. And we can in subsequent reviews add a parallel
directory with functional tests.

Related-Bug: #1439621
Change-Id: I8bf5af953fb31080096c371966f7dfda9edb1bf4
2015-04-02 12:25:43 -04:00