book-of-kubernetes / examples

Examples for The Book of Kubernetes
MIT License
166 stars 76 forks source link

Chapter 02 & 03 CRI-O Installation Fails on Kubic Repository #5

Closed cuttlefisch closed 2 years ago

cuttlefisch commented 2 years ago

Description of Issue

It looks like the playbooks targeting AWS for chapters 02 & 03 fail to install CRI-O, and /opt/crio-ver is missing for manual installation steps described on p.27.

Steps to Reproduce

Steps performed from Fedora 36 workstation, using an AWS Sandbox Account.

Chapter 2:

  1. Configure AWS environment Variables
  2. Setup python virtualenvironment and install dependencies according to setup/README.md, including the Amazon Web Services section
  3. From the chapter-02 directory run ansible-playbook aws-setup.yaml and wait for it to complete
  4. Perform example commands through to the Containers and Namespaces in CRI-O section
  5. Try using the extra playbook to install CRI-O & crictl: ansible-playbook extra.yaml

Resulting error (* char substituted for IP address):

TASK [cri-o : gpg key] *********************************************************************************************************************************************************
changed: [*.*.*.*]

TASK [cri-o : kubic repository] ************************************************************************************************************************************************
fatal: [*.*.*.*]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: E:The repository 'https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04  Release' does not have a Release file."}

PLAY RECAP *********************************************************************************************************************************************************************
*.*.*.*              : ok=6    changed=5    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0

Next, check for /opt/crio-ver on remote host:

root@host01:~# tree /opt/
/opt/
└── containerd
    ├── bin
    └── lib

Chapter 3: the initial ansible-playbook aws-setup.yaml completes but the remote host has no crictl installed.

Run summary:

PLAY RECAP ****************************************************************************
localhost                  : ok=15   changed=3    unreachable=0    failed=0    skipped=15   rescued=0    ignored=0

Check for crictl after connecting to remote:

root@host01:~# crictl

Command 'crictl' not found, did you mean:
. . .  
AlanHohn commented 2 years ago

Hello,

Thanks for the report and the detailed steps to reproduce. It looks like you might not have run the main playbook.yaml file with each of these?

The aws-setup.yaml file only does the creation of the necessary AWS resources. The main file playbook.yaml in each chapter performs the relevant setup. The split is necessary so the same automation can be used with Vagrant as well as AWS.

In chapter 2, the main playbook creates /opt/crio-ver and also installs some necessary tools that allow the addition of the kubic repository (either manually or using the extras.yaml file). In chapter 3, the main playbook installs CRI-O and crictl.

You should be able to get going by running:

ansible-playbook playbook.yaml

Do this right after running ansible-playbook aws-setup.yaml.

Hope this helps; let me know if not.