ansibleplaybookbundle / kubevirt-apb

APB for managing KubeVirt deployments
Apache License 2.0
8 stars 16 forks source link

provision fails to create demo-content because of invalid content #82

Closed lukas-bednar closed 6 years ago

lukas-bednar commented 6 years ago

create service instance

[root@cnv-executor-shiywang-master1 ~]# cat kubevirt-apb.yml 
---
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
  name: kubevirt
  namespace: kube-system
spec:
  clusterServiceClassExternalName: dh-virtualization
  clusterServicePlanExternalName: default
  parameters:
    admin_user: test_admin
    admin_password: 123456
    version: 0.7.0
[root@cnv-executor-shiywang-master1 ~]# oc create -f kubevirt-apb.yml 

See execution of apb provisioning

[root@cnv-executor-shiywang-master1 ~]# oc get pods --all-namespaces | grep prov
dh-virtualization-prov-nrh8r        apb-4764af0f-b886-4a14-ab79-f59b337edf21                       0/1       Error     0          25m

Check the logs

[root@cnv-executor-shiywang-master1 ~]# oc logs -n dh-virtualization-prov-nrh8r apb-4764af0f-b886-4a14-ab79-f59b337edf21

PLAY [Provision KubeVirt] ******************************************************

TASK [ansible.kubernetes-modules : Install latest openshift client] ************
skipping: [localhost]

TASK [ansibleplaybookbundle.asb-modules : debug] *******************************
skipping: [localhost]

PLAY [masters[0]] **************************************************************

TASK [kubevirt : include_tasks] ************************************************
included: /etc/ansible/roles/kubevirt-ansible/roles/kubevirt/tasks/provision.yml for localhost

TASK [kubevirt : Login As Super User] ******************************************
changed: [localhost]

TASK [kubevirt : Check if kube-system exists] **********************************
changed: [localhost]

TASK [kubevirt : Create kube-system namespace] *********************************
skipping: [localhost]

TASK [kubevirt : Add Privileged Policy] ****************************************
changed: [localhost] => (item=kubevirt-privileged)
changed: [localhost] => (item=kubevirt-controller)
changed: [localhost] => (item=kubevirt-infra)
changed: [localhost] => (item=kubevirt-apiserver)

TASK [kubevirt : Add Hostmount-anyuid Policy] **********************************
changed: [localhost]

TASK [kubevirt : Check for kubevirt.yaml.j2 template in /etc/ansible/roles/kubevirt-ansible/roles/kubevirt/templates] ***
ok: [localhost]

TASK [kubevirt : Check for kubevirt.yaml.j2 version v0.7.0 in /opt/apb/kubevirt-templates] ***
ok: [localhost]

TASK [kubevirt : Download KubeVirt Template] ***********************************
skipping: [localhost]

TASK [kubevirt : Render offline template] **************************************
changed: [localhost]

TASK [kubevirt : Render KubeVirt Yaml] *****************************************
skipping: [localhost]

TASK [kubevirt : Create KubeVirt Resources] ************************************
changed: [localhost]

TASK [kubevirt : Check for demo-content.yaml template in /etc/ansible/roles/kubevirt-ansible/roles/kubevirt/templates] ***
ok: [localhost]

TASK [kubevirt : Check for demo-content.yaml version v0.7.0 in /opt/apb/kubevirt-templates] ***
ok: [localhost]

TASK [kubevirt : Download Demo Content] ****************************************
skipping: [localhost]

TASK [kubevirt : Copy Offline Demo Content to /tmp] ****************************
changed: [localhost]

TASK [kubevirt : Copy BYO Demo Content to /tmp] ********************************
skipping: [localhost]

TASK [kubevirt : Create Demo Content] ******************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["kubectl", "apply", "-f", "/tmp/demo-content.yaml"], "delta": "0:00:01.310499", "end": "2018-08-02 07:53:36.559362", "msg": "non-zero return code", "rc": 1, "start": "2018-08-02 07:53:35.248863", "stderr": "error: error validating \"/tmp/demo-content.yaml\": error validating data: invalid object to validate; if you choose to ignore these errors, turn validation off with --validate=false", "stderr_lines": ["error: error validating \"/tmp/demo-content.yaml\": error validating data: invalid object to validate; if you choose to ignore these errors, turn validation off with --validate=false"], "stdout": "", "stdout_lines": []}

PLAY RECAP *********************************************************************
localhost                  : ok=12   changed=7    unreachable=0    failed=1   

Log into failing container

[root@cnv-executor-shiywang-master1 ~]# oc debug -n dh-virtualization-prov-nrh8r apb-4764af0f-b886-4a14-ab79-f59b337edf21
Defaulting container name to apb.
Use 'oc describe pod/apb-4764af0f-b886-4a14-ab79-f59b337edf21-debug -n dh-virtualization-prov-nrh8r' to see all of the containers in this pod.

Debugging with pod/apb-4764af0f-b886-4a14-ab79-f59b337edf21-debug, original command: entrypoint.sh provision --extra-vars {"_apb_last_requesting_user":"test_admin","_apb_plan_id":"default","_apb_service_class_id":"fd9b21a9caa8bf8b42b27bb0c90d3b74","_apb_service_instance_id":"e865f6f7-9628-11e8-ad30-0a580a800009","admin_password":123456,"admin_user":"test_admin","cluster":"openshift","namespace":"kube-system","version":"0.7.0"}
Waiting for pod to start ...
Pod IP: 10.130.0.42
If you don't see a command prompt, try pressing enter.
sh-4.2$ ls
actions  ansible.cfg  etc  hosts  kubevirt-templates
sh-4.2$ cat kubevirt-templates/
sprint5/        v0.0.1-alpha.3/ v0.0.2/         v0.1.0-alpha/   v0.3.0-alpha.1/ v0.4.0/         v0.4.1/         v0.5.0-alpha.0/ v0.5.1-alpha.3/ v0.6.2/         v0.7.0-alpha.2/
v0.0.1-alpha.0/ v0.0.1-alpha.4/ v0.0.3/         v0.2.0/         v0.3.0-alpha.2/ v0.4.0-alpha.0/ v0.4.1-alpha.1/ v0.5.0-alpha.1/ v0.6.0/         v0.7.0/         v0.7.0-alpha.3/
v0.0.1-alpha.1/ v0.0.1-alpha.5/ v0.0.4/         v0.3.0/         v0.3.0-alpha.3/ v0.4.0-alpha.1/ v0.4.1-alpha.2/ v0.5.1-alpha.1/ v0.6.1/         v0.7.0-alpha.0/ v0.7.0-alpha.4/
v0.0.1-alpha.2/ v0.0.1-alpha.6/ v0.1.0/         v0.3.0-alpha.0/ v0.3.0-alpha.4/ v0.4.0-alpha.2/ v0.5.0/         v0.5.1-alpha.2/ v0.6.1-alpha.0/ v0.7.0-alpha.1/ v0.7.0-alpha.5/
sh-4.2$ cat kubevirt-templates/v0.7.0/
demo-content.yaml               kubevirt.yaml.j2                vm-template-rhel7.yaml          
kubevirt.yaml                   vm-template-fedora.yaml         vm-template-windows2012r2.yaml  
sh-4.2$ cat kubevirt-templates/v0.7.0/
demo-content.yaml               kubevirt.yaml.j2                vm-template-rhel7.yaml          
kubevirt.yaml                   vm-template-fedora.yaml         vm-template-windows2012r2.yaml  
sh-4.2$ cat kubevirt-templates/v0.7.0/demo-content.yaml 
<html><body>You are being <a href="https://github-production-release-asset-2e65be.s3.amazonaws.com/76686583/7fdd6790-7fb4-11e8-9f22-24c2e2cb1329?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20180730%2Fus-east-1%2Fs3%2Faws4_request&amp;X-Amz-Date=20180730T135820Z&amp;X-Amz-Expires=300&amp;X-Amz-Signature=3a5c58ed35f91c86102b57db3e4b8400b119a7785ea564505e2d6940749baf94&amp;X-Amz-SignedHeaders=host&amp;actor_id=0&amp;response-content-disposition=attachment%3B%20filename%3Ddemo-content.yaml&amp;response-content-type=application%2Foctet-stream">redirected</a>.</body></html>sh-4.2$ 
sh-4.2$ exit

Removing debug pod ...

The kubevirt-templates/v0.7.0/demo-content.yaml contains invalid content which causes failure during deployment.

@rthallisey