IBM / k8s-storage-perf

This git repo will host the playbooks for collecting performance metrics for a Kubernetes persistent storage for IBM Cloud Paks
Apache License 2.0
9 stars 18 forks source link

"ERROR! couldn't resolve module/action 'k8s'", when trying to run ansible-playbook main.yml #10

Closed smchamberlin closed 1 year ago

smchamberlin commented 1 year ago

Running the ansible playbook with the following command:

ansible-playbook main.yml --extra-vars "@./params.yml" | tee output.log

I got a warning about deprecation, as well as a syntax error:

TASK [Storage Performance] *****************************************************
[DEPRECATION WARNING]: community.kubernetes.k8s has been deprecated. The 
community.kubernetes collection is being renamed to kubernetes.core. Please 
update your FQCNs to kubernetes.core instead. This feature will be removed from
 community.kubernetes in version 3.0.0. Deprecation warnings can be disabled by
 setting deprecation_warnings=False in ansible.cfg.
ERROR! couldn't resolve module/action 'k8s'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/home/ec2-user/k8s-storage-perf/roles/storage-perf-test/tasks/sysbench_test_prep.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# Run sysbench test
- name:  Setup PVCs to run test on
  ^ here
yonglian commented 1 year ago

Please note above issue is only happening in AWS env, and the tool works in other environments (ROKS in IBM cloud, and Fyre OCP+). So we need this tool to be enhanced to support AWS env. I believe this is the first time that we tried in an AWS cluster.

See more details below from Steven:

During installation of the pre-reqs I got the following error:

[ec2-user@ip-10-0-135-213 ~]$ ansible-galaxy collection install community.kubernetes
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Installing 'community.kubernetes:2.0.1' to '/home/ec2-user/.ansible/collections/ansible_collections/community/kubernetes'
Downloading https://galaxy.ansible.com/download/community-kubernetes-2.0.1.tar.gz to /home/ec2-user/.ansible/tmp/ansible-local-180524ht5_8c3d/tmp0z7yc8ct
community.kubernetes (2.0.1) was installed successfully
Installing 'kubernetes.core:2.3.2' to '/home/ec2-user/.ansible/collections/ansible_collections/kubernetes/core'
Downloading https://galaxy.ansible.com/download/kubernetes-core-2.3.2.tar.gz to /home/ec2-user/.ansible/tmp/ansible-local-180524ht5_8c3d/tmp0z7yc8ct
ERROR! Unexpected Exception, this is probably a bug: The read operation timed out
to see the full traceback, use -vvv
[ec2-user@ip-10-0-135-213 ~]$ 

However after trying it again it said it was already installed:
[ec2-user@ip-10-0-135-213 ~]$ ansible-galaxy collection install community.kubernetes
Starting galaxy collection install process
Process install dependency map
Starting collection install process
Skipping 'community.kubernetes' as it is already installed
[ec2-user@ip-10-0-135-213 ~]$ 

Also, reviewing the docs for the perf tool, seems I have to fill this out in the parameters file:
storageClass_ReadWriteOnce: <required>
storageClass_ReadWriteMany: <required>

However, such options seem to be specified in the PVC, not in the storage class definition.  Therefore we only have one storage class.  I specified the same storage class twice, but not sure if that’s the right path here.

Finally, running the ansible playbook, I got a warning about deprecation, as well as a syntax error:
TASK [Storage Performance] *****************************************************
[DEPRECATION WARNING]: community.kubernetes.k8s has been deprecated. The 
community.kubernetes collection is being renamed to kubernetes.core. Please 
update your FQCNs to kubernetes.core instead. This feature will be removed from
 community.kubernetes in version 3.0.0. Deprecation warnings can be disabled by
 setting deprecation_warnings=False in ansible.cfg.
ERROR! couldn't resolve module/action 'k8s'. This often indicates a misspelling, missing collection, or incorrect module path.
The error appears to be in '/home/ec2-user/k8s-storage-perf/roles/storage-perf-test/tasks/sysbench_test_prep.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

# Run sysbench test
- name:  Setup PVCs to run test on
  ^ here
smchamberlin commented 1 year ago

I tried this again today and I did not see this error (though not sure exactly what I did differently -- environment and steps should have been the same). We can open another ticket if someone sees it again ... For now closing.