kubevirt / kubevirt-ansible

Set of Ansible roles & playbooks for KubeVirt deployment
Apache License 2.0
91 stars 72 forks source link

Replace kubevirt deploy tasks with the operator #536

Closed rthallisey closed 5 years ago

rthallisey commented 5 years ago

Use Ansible to orchestrate deployment while OLM continues to develop.

This PR will break CI until operator PRs merge.

Launch kubevirt and some components as operators
fabiand commented 5 years ago

For KubeVirt you need these lines to deploy kubevirt using the new operator: https://github.com/kubevirt/demo/pull/99/files#diff-04c6e90faac2675aa89e2176d2eec7d8R44

fabiand commented 5 years ago

xref kubevirt/demo#99

SchSeba commented 5 years ago

Hi @rthallisey Can we download the j2 files for kubevirt and cdi and don't put them here so it will be easier to update them (just change the version)

rthallisey commented 5 years ago

@SchSeba download caused lots of problems for us in the ansible code. We're only planning on doing this for one version of kubevirt-ansible, so including the files locally won't be an issue long term.

rthallisey commented 5 years ago

CI is failing on an rbac test where the edit role is expecting to have get permissions on the kubevirt subresource v1alpha2.subresources.kubevirt.io. I confirmed this is also happening locally.

After adding this ClusterRole to edit, it works. KubeVirt might be missing something...

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  annotations:
    rbac.authorization.kubernetes.io/autoupdate: "true"
  labels:
    kubernetes.io/bootstrapping: rbac-defaults
    kubevirt.io: ""
  name: test-subresource
rules:
- apiGroups:
  - apiregistration.k8s.io
  resources:
  - apiservices
  verbs:
  - get
  - create
  - update
fabiand commented 5 years ago

Please do not update to 0.13 yet.

AFAIK there was no official release announce yet

rthallisey commented 5 years ago

ci test please

rthallisey commented 5 years ago

Updating tests to use v1alpha3

gbenhaim commented 5 years ago

The last ci run failed on

"server could not find the requested resource (delete virtualmachines.kubevirt.io)"

the trigger was tests.BeforeTestCleanup() in BeforeEach of the tests.

rthallisey commented 5 years ago

@gbenhaim, what's odd is I've see it pass this test multiple times, then fail on a rbac test. I've also seen it show green once, but I'm not sure if there tests even ran. Do the tests always run?

gbenhaim commented 5 years ago

@rthallisey It the deployment went well the tests are being run.

gbenhaim commented 5 years ago

Failure summary:

  1. Hosts: localhost Play: Deploy kubevirt role Task: Wait until virt-operator is running Message: The task includes an option with an undefined variable. The error was: 'item' is undefined

           The error appears to have been in '/home/jenkins/workspace/kubevirt_kubevirt-ansible_standard-check-pr/kubevirt-ansible/roles/kubevirt/tasks/provision.yml': line 33, column 3, but may
           be elsewhere in the file depending on the exact syntax problem.
    
           The offending line appears to be:
    
           - name: Wait until virt-operator is running
             ^ here
rthallisey commented 5 years ago

@gbenhaim @slintes Passed CI. The wait for checks should stabilize this. I'm going to remove some debugging and we'll see if it passes again.

slintes commented 5 years ago

Hey @rthallisey, great to see CI issues are resolved :+1: But please update to KubeVirt v0.13.0. And there might be even a new release today with a small RBAC fix for the virtctl restart command, pending confirmation to backport it (see https://github.com/kubevirt/kubevirt/pull/1947).

fabiand commented 5 years ago

WRT new release: I'd not plan a new release right now, maybe a pre-release, but a release maybe in a week if more stuff piles up. I want to say: Don't wait for the release taking place today.

rthallisey commented 5 years ago

We're going to move to 0.13 in another PR https://github.com/kubevirt/kubevirt-ansible/pull/556