kubernetes-client has patched this [1]. To retain backwards
compatibility, we can use **kwargs to handle async/async_req arguments
[1]: b10c7b6a17
Change-Id: I8e738b4f99091786dd76e081bffa36ef5ab70085
Calling Kubernetes native API to update the cluster health status
so that it can used for cluster auto healing.
Task: 24593
Story: 2002742
Change-Id: Ia76eeeb2f1734dff38d9660c804d7d2d0f65b9fb
After [1] jobs are return false(SUCCESS) status due
to wrong EXIT_CODE.
After [2] kubernetes client is updated to v4.0.0 and
no longer contains ConfiugrationObject so we need create
instance of Configuration class.
Also don't use local to create variable as local
can only be used in a function.
[1] https://review.openstack.org/#/c/526618/
[2] https://review.openstack.org/#/c/528406
Change-Id: Ida5aac40b234a358b2a13b2e51a41d0242031ebb
For a really long time, we generated and maintained our very own python
client generated from kubernetes swagger json files. Now in Kubernetes
Community there is a concerted effort to organize an official python
client (also generated from swagger) for everyone to use. So let us
please switch over from our python-k8sclient and use the community
driven python client. I have ported all of our end-to-end tests and got
them working in kubernetes client-python project upstream so we should
be protected from regressions.
Implements: blueprint replace-k8sclient-with-upstream-kubernetes-client
Depends-On: I72359f2b811392008eb5267812bf343797b1553a
Change-Id: Ib81a69cfdc25198e259e3b3d4081c92c01fd1bc5
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
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.
http://docs.openstack.org/developer/hacking/#imports
Closes-Bug: #1620161
Change-Id: I7ec9022a6b1cec36c678a2cec2a1856e70a51c68
Added i18n translation to all log messages. Also added
hacking check for this to ensure in future all log
messages are translated.
Change-Id: I77fbb18ffe47b12232125cc1fa7aae97ea9b1214
Closes-Bug: #1603759
When an exception was caught and rethrown, it should call 'raise'
without any arguments because it shows the place where an exception
occured initially instead of place where the exception re-raised.
Change-Id: If180215bda5592c0cba92cb2c9b3a61c13d62ccf
This patch removes redundant method create_certificate_files defined in
magnum/conductor/k8s_api.py and uses the one defined in
magnum/conductor/handlers/common/cert_manager.py
Change-Id: I509fd24b3a6febd1b621321c380f38afdfaccec2
Closes-bug: #1505085
In Ia400b5b6919753d6241233a6666a2c30c7618bc9, we are
adding a new library to global requirements. This
python-k8sclient library essentially has the same
code that was in Magnum so it's a straight replace.
Change-Id: Ib85bcf532e4163d5c1ac95ef701a1ec3133b69eb
This patch aimed to reduce db call count when we invode k8sAPI.
For those user using bay name to do pod/rc/service operations, we
can saving a db call.
Change-Id: I1488d0526e1d444cb681b408f8a13ce25b4aee6f
There are files containing string format arguments inside logging
messages. Using logging function parameters should be preferred.
Change-Id: Id558f66de13146f6ae76a7a69f49721b6c3d6257
Closes-Bug: #1321274
Make kubernetes API client generic. Right now each k8s object has
a way to create k8s API client. This was needed to make sure the
tests passed. Now since all the objects-from-bay patches are merged
in its better to make the client creation logic generic.
Change-Id: Ic2a9b16bbd4c13794c7ef95309bd260366ec872e
Closes-Bug: #1502367
Conductor has a utility to manage bay specific certificates.
This patch changes to use it.
And also this patch fixes temporary place holder classes related
to bp:objects-from-bay.
Change-Id: I55d7fe33d7a910b9ba76bcbb4c39353fe7fac2f4
Closes-Bug: #1523843
Currently k8s objects (pod/rc/service) are read from the
database. In order for native clients to work, they must
be read from the ReST bay endpoint. To execute native
clients, we must have one truth of the state of the
system, not two as we do now. This patch proposes the
change to the Pod object.
Also, please refer to the related-bug as to the temporary changes
done to make the test work for other objects namely rc,
service. These changes will be removed when the object from bay
patches for all the k8s objects are merged as part of a seperate
patch.
Partially-Implements: bp objects-from-bay
Related-Bug: #1502367
Related-Bug: #1504379
Change-Id: Id5be7fba2eb8622fcfeb48068728e440a0af3f5e
Currently k8s objects (pod/rc/service) are read from the
database. In order for native clients to work, they must
be read from the ReST bay endpoint. To execute native
clients, we must have one truth of the state of the
system, not two as we do now. This patch proposes the
change to the Service object.
Also, please refer to the related-bug as to the temporary changes
done to make the test work for other objects namely pod, rc. These
changes will be removed when the object from bay patches for
all the k8s objects are merged as part of a seperate patch.
Partially-Implements: bp objects-from-bay
Related-Bug: #1502367
Related-Bug: #1504379
Change-Id: I05177944a693710c70a22cae57f521b0fe738e9e
Currently objects (pod/rc/service) are read from the
database. In order for native clients to work, they
must be read from the ReST bay endpoint. To execute
native clients, we must have one truth of the state
of the system, not two as we do now. This patch adds
changes for Replication Controller.
Also, please refer to the related-bug as to the temporary changes
done to make the test work for other objects namely pod,
service. These changes will be removed when the object from bay
patches for all the k8s objects are merged as part of a seperate
patch.
Partially-Implements: bp objects-from-bay
Related-Bug: #1502367
Related-Bug: #1504379
Change-Id: I7905af9e22f47b16d92043cc1fdcb1cdf72ebc48
Fix the failure to scale-down k8s cluster. We were getting this
failure because as part of scaling, Bay needs to be retrieved for
the respective k8s obj. But if the object passed is a Bay itself
we need not retrieve the Bay. At present even for Bay object the
code proceeds ahead to retrieve bay and cannot find bay_uuid
attribute. This patch fixes this problem.
We might need to backport this fix to stable/liberty as well.
Change-Id: I7ed03af8bdbb8647851751bb550d9529d96b5cb4
Closes-Bug: #1509439
This patch makes API call to Kubernetes secure using the certificate
and key.
Co-Authored-By: Madhuri Kumari<madhuri.kumari@intel.com>
Co-Authored-By: OTSUKA, Yuanying<yuanying@fraction.jp>
Depends-On: I76b0f91f0c44f9880980e35c6b8856ea48ed3ce1
Change-Id: Id4dceb83f67b80f5b39e3047011f9e34e840359d
Partially-Implements: blueprint secure-kubernetes
This patch modifies template to generate certificates and configure TLS
settings for kube-apiserver/kubelet/kube-proxy.
Co-Authored-By: Andrew Melton <andrew.melton@rackspace.com>
Partially-Implements: bp secure-kubernetes
Change-Id: I76b0f91f0c44f9880980e35c6b8856ea48ed3ce1
Kubernetes Release 1.0 was announced at OSCON
A new Fedora Atomic image has been built with version 1.0.4 and
this series of patches will update the templates, scripts, documents
to work with the new image.
The api has also been changed from v1beta3 to v1 and the beta
api is no longer available, so the interface between Magnum and
Kubernetes master are updated as well in this series of patches.
This particular patch will bring up a V1 cluster with the
bay-create command. Because the switch to the V1 API requires
all the code changes to be applied at once, this patch pulls
in portion of 3 patches together. The changes include:
1. devstack plugin downloads the new image.
2. k8s conductor and other code calls the new V1 client and
k8s methods.
3. Configuration for k8s services and docker updated with
new parameters.
4. Minion registration and example code updated to V1.
5. Functional tests updated to V1.
6. Gate test setup points to the new image.
Co-Authored-By: Hongbin Lu <hongbin.lu@huawei.com>
Change-Id: I046931ad491e8b7ee45943852901eac5c3df913e
Partially-Implements: blueprint kubernetes-v1
Currently, our python k8sclient uses the IP address of the master node
as the API endpoint. As we are going to have multiple master nodes,
we need to use IP address of the load balancer instead.
Change-Id: I4da0a80f489f634afc154e8b3626b8c12cc50e86
Partially-Implements: blueprint make-master-ha
As k8s ha masters have been refined in [1], rename "k8s_master_url" to
a better name "k8s_api_endpoint".
[1]: https://review.openstack.org/#/c/204261
Change-Id: Iecdfda410b6c82a5ae4fa575eeb222f91f21ef5a
Closes-Bug: #1477301
This allows common implementations to be reused later. Below is
the list of methods that were moved and renamed:
* handlers.k8s_conductor._retrieve_bay -> utils.retrieve_bay
* handlers.bay_conductor._get_baymodel -> utils.retrieve_bay
* handlers.k8s_conductor._retrieve_baymodel -> utils.retrieve_baymodel
* handlers.k8s_conductor._object_has_stack -> utils.object_has_stack
* handlers.k8s_conductor._retrieve_k8s_master_url ->
k8s_api._retrieve_k8s_master_url
* handlers.k8s_conductor.Handler.k8s_api -> k8s_api.create_k8s_api
Change-Id: Ia10625f35667fd9309dc3627e2f2d31455dd19be
Partially-Implements: blueprint magnum-smart-bay-scale-down