Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8s kind tests #61466

Open
wants to merge 3 commits into
base: devel
from

Conversation

@fabianvf
Copy link
Contributor

commented Aug 28, 2019

SUMMARY

Updates the k8s module tests to use the bsycorp/kind container instead of the openshift API server, which should allow full integration tests to run instead of just verifying that we're properly communicating with the API.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

k8s

Additional Information

CI won't pass until #61493 merges

@ansibot

This comment has been minimized.

@fabianvf fabianvf force-pushed the fabianvf:k8s-kind-tests branch from 0ce0846 to 7749ad0 Aug 28, 2019

@ansibot ansibot added the small_patch label Aug 28, 2019

@fabianvf fabianvf force-pushed the fabianvf:k8s-kind-tests branch from 7749ad0 to 8924164 Aug 28, 2019

@ansibot ansibot removed the small_patch label Aug 28, 2019

@tao12345666333

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

Can we use another Kind(Kubernetes In Docker) https://landscape.cncf.io/selected=kind to do this?
It can create multi-node cluster for testing.
And it is a CNCF certified conformant Kubernetes installer.

@willthames

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

@tao12345666333 interestingly that was the kind I meant when I suggested to @fabianvf that we use kind - however, the problem with the cncf kind is that it seems to rely on using custom tools, which doesn't really work as well with the ansible test suite (it's a lot easier to spin up a container than install and then use a tool, particularly if you're doing this on a CI farm that you don't control)

Do you have specific concerns that this approach isn't valid? I'm happy with any reasonably conformant solution that improves our testability on CI.

@@ -248,31 +266,6 @@
- deploy.result.status.availableReplicas == deploy.result.status.replicas
- updated_deploy_pods.resources[0].spec.containers[0].image.endswith(":2")

- name: pause a deployment

This comment has been minimized.

Copy link
@willthames

willthames Aug 29, 2019

Contributor

any particular reason for deleting this test?

This comment has been minimized.

Copy link
@fabianvf

fabianvf Aug 29, 2019

Author Contributor

Yeah, the status wasn't being set on the deployment as expected, possibly a result of the change in kubernetes version. I replaced it with the Job condition test.

@ansibot ansibot removed the needs_triage label Aug 29, 2019

@fabianvf

This comment has been minimized.

Copy link
Contributor Author

commented Aug 29, 2019

@tao12345666333 the kubernetes/kind project does a lot more than we need for CI here, the bsycorp/kind image is a minikube cluster that runs in a container, so all you need to do is pull and run it instead of needing to make any modifications to the host.

@tao12345666333

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

Thanks for your reply. @willthames @fabianvf

the problem with the cncf kind is that it seems to rely on using custom tools, which doesn't really work as well with the ansible test suite

Yes, cncf kind need the kind tool to create a cluster or do other things. Hear has some examples for using it. https://github.com/kind-ci/examples

Do you have specific concerns that this approach isn't valid? I'm happy with any reasonably conformant solution that improves our testability on CI.

Yes, cncf kind has been used for Kubernetes, kubeadm and other upstream projects. Plus CNCF conformance certification, I think it is reliable enough.

I am very happy to try using cncf kind as an ansible test tool, I want to try to modify it based on the current PR if you don't mind. ❤️

all you need to do is pull and run it instead of needing to make any modifications to the host.

Yes. bsycorp/kind is more simpler. But I think with the development of Ansible, maybe we need some multi-node test environment later? 🤔

@fabianvf

This comment has been minimized.

Copy link
Contributor Author

commented Aug 29, 2019

I am very happy to try using cncf kind as an ansible test tool, I want to try to modify it based on the current PR if you don't mind. heart

Yeah, I'm totally open to using the official kind, but in this case I wanted to keep the changes as simple/minimal as possible while letting us test against a more real Kubernetes cluster. I actually opened an issue for implementing a kind driver for molecule, which I think would be really cool and would make it super easy to test Ansible against Kubernetes generally.

Yes. bsycorp/kind is more simpler. But I think with the development of Ansible, maybe we need some multi-node test environment later?

Well we don't really have any features that would benefit from multi-node testing, and in the medium to long-term the k8s modules will likely move to a collection and have their own CI, so I'm not convinced the complexity is worth it right now, but in the long-term I do agree that a multi-node testing environment is ideal.

@tao12345666333

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2019

I actually opened an issue for implementing a kind driver for molecule

Wow, cool 👍

I'm totally open to using the official kind, but in this case I wanted to keep the changes as simple/minimal as possible while letting us test against a more real Kubernetes cluster.

I agree with you. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.