-
Notifications
You must be signed in to change notification settings - Fork 70
Add a new 'library' for k8s/openshift providers. #712
Conversation
028c3e2 to
22d3269
Compare
986f017 to
538dc65
Compare
4f17d71 to
69b1ed0
Compare
720074d to
fcda016
Compare
|
Functional tests failing due to: https://github.com/projectatomic/adb-tests/pull/32/files |
9774d95 to
5f07c13
Compare
I think anything that is referencing an object of the |
|
@dustymabe ahhhh, that's what you meant! I was getting confused between @rtnpro 's refactor and |
|
I tested this on Kubernetes running on AWS When authenticating using token, everything works fine. When using Then there are two another options for user to authenticate:
But those things are probably candidates for another PR. |
|
@kadel |
|
@cdrage I don't think that this is edge case, this is how authentication for If you have config with both client-certificate/key and token for one user, you have to decide which one to use, it doesn't make sense to use both, even if in this case it is technically possible. Examples of
|
|
@kadel thank you for posting them! I'm going to go through each-one and figure out how we can work this in. |
|
@kadel how did we do |
|
@cdrage yes it was part of old PR with cert auth. Here is example how we handled that https://github.com/kadel/atomicapp/blob/bdc3a2bd3cc953ea1436392367a3f92a1b532b8d/atomicapp/providers/lib/kubeconfig.py#L116,L119 |
858de3b to
ea14d6d
Compare
| ''' | ||
|
|
||
| # If it starts with /, we assume it's a filename so we just return that. | ||
| if data.startswith('/'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it can be related path to .kube/config and than it is not starting with /
ea14d6d to
c848bda
Compare
|
@kadel updated the PR with your feedback on the |
|
Sorry, but It is not working like this :-( Look at this example: https://gist.github.com/kadel/29df1fee245627ed90e53b44cdb7c2e7 |
c848bda to
4cadf1b
Compare
|
There are still some missing features to properly handle Kubernetes config file.
👍 LGTM |
|
Thanks man! 👯 I'll add the |
This is the first commit and first initialization into refactoring the OpenShift provider in order to create a library that is both compatible with OpenShift as well as Kubernetes. With this 'library', the *ONLY* thing that is passed in is an object of the .kube/config configuration. After passing the configuration, you may make API calls such as .create(object) and .delete(object).
4cadf1b to
69875f6
Compare
|
@dustymabe I think this may be good to go! I've updated kubebase to reflect the wording change on self.config to self.kubeconfig This may be ready for mergin' 👍 |
|
#dotests |
|
@cdrage - I haven't looked at this but from what I reviewed a week ago everything looked good. Since Tomas gave +1 I'm +1. Merge if you can get all tests passing. |
|
WOOO! Kubernetes tests pass! 🎉 Merging away :) |
|
Thanks everyone for helping me out with this! It's been exciting to finally get this in. |
|
haha openshift tests failed - thoughts about that? |
|
@dustymabe false alarm, tests passed locally for OpenShift on my system :) Seems the previous issue is occuring again with the latest update to OpenShift: |
|
Let me test one more thing ^^ updated my OpenShift image and it failed. |
|
@dustymabe should be fine, no need to revert or anything. i knew I didn't touch the openshift integration (didn't change any underlying code) I've opened up projectatomic/adb-tests#33 to fix this. |
| raise KubeKubernetesError("Kubernetes API URL does not include HTTP or HTTPS") | ||
|
|
||
| # Gather what end-points we will be using | ||
| self.k8s_api = urljoin(url, "api/v1/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are there plans to support the other groups of APIS accessible via the /apis endpoint (e.g. - apps, autoscaling, batch, extensions, policy, etc.)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khrisrichardson We hope so. Any changes to https://github.com/projectatomic/nulecule will reflect in atomic app in terms of providing support for autoscaling, batch commands, extensions, policies, etc. If the spec changes we'll reflect that as features in Atomic App :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @cdrage
Is there a timeline in mind, because by restricting to api/v1, the behavior may be a regression for some?
ERROR :: No kind by that name: Deployment
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/cli/main.py", line 130, in cli_func_exec
cli_func(cli_func_args)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/cli/main.py", line 84, in cli_run
nm.run(**argdict)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/nulecule/main.py", line 320, in run
nulecule.run(cli_provider, dryrun)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/nulecule/base.py", line 224, in run
provider.run()
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/providers/kubernetes.py", line 268, in run
self.api.create(artifact, self.namespace)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/providers/lib/kubeshift/client.py", line 49, in create
self.connection.create(obj, namespace)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/providers/lib/kubeshift/kubernetes.py", line 62, in create
kind, url = self._generate_kurl(obj, namespace)
File "/usr/local/lib/python2.7/dist-packages/atomicapp-0.5.2-py2.7.egg/atomicapp/providers/lib/kubeshift/kubernetes.py", line 142, in _generate_kurl
raise KubeKubernetesError("No kind by that name: %s" % kind)
KubeKubernetesError: No kind by that name: Deployment
I was testing kubernetes v1.3.0-alpha.5, and prior to pulling this commit, I was able to create objects belonging to the extensions/v1beta1 API, such as DaemonSet and Deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@khrisrichardson Ah! That's what you meant. I'm going to open up an issue for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a patch to support API groups. Will fork and create PR.
This is the first commit and first initialization into refactoring the
OpenShift provider in order to create a library that is both compatible
with OpenShift as well as Kubernetes.
With this 'library', the ONLY thing that is passed in is an object of
the .kube/config configuration. After passing the configuration, you may
make API calls such as .create(object) and .delete(object).
This commit integrates the library as well as converts the current Kubernetes provider from cmd-line (using kubectl) to using the API.