Open bonsi opened 3 years ago
I would add that for chapter 2 I encountered issues running the playbook, specifically:
TASK [Create a Deployment for Hello Go.] *** fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to get client due to HTTPConnectionPool(host='localhost', port=80): Max retries exceeded with url: /version (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f4f9c9daf40>: Failed to establish a new connection: [Errno 111] Connection refused'))"}
Tracked the issue down to my version of ansible installed, described here: https://github.com/kubernetes-client/python/issues/1333
Solution was to update my install of ansible:
sudo apt unstall ansible
sudo add-apt-repository --yes --update ppa:ansible/ansible
sudo apt update
sudo apt install ansible
After updating, things worked.
Posting issues, notes & suggestions as I'm working along through the book:
My system:
Chapter 1
On Ubuntu,
minikube start
now uses "docker" as the default driver, and not "virtualbox" which you imply in the sections afterwards. To use "virtualbox" as the driver, one would need to runminikube start --driver=virtualbox
. On subsequentminikube start
s, the selected driver is saved in~/.minikube
and doesn't need to be specified anymore.Chapter 2
Section: Installing Ansible
pip
andpython-dev
are not longer available through the default repo's. The default python version for Ubuntu/Debian is currently v3.8 and thus the commands need to be replaced bypip3
andpython3-dev
Chapter 3
Writing a Playbook to Build a Container Image
vars/main.yml
but then use version "8.3.1" later on in "Writing a Playbook to Test the Container Image" where you usedocker run -d -p 8983:8983 ansible-for-kubernetes/solr:8.3.1
to start the containerChapter 4
A Vagrantfile for local Infrastructure-as-Code
Running the cluster build playbook
ansible-playbook -i inventory main.yml
fails atTASK [geerlingguy.docker : Ensure dependencies are installed.]
with the error:for each host (kube1, kube2, kube3). The error is probably related to the apt cache age of the used Vagrant boxed because I was able to fix it by running
sudo apt update
on each box (or Ansible-style:ansible -m command -a 'sudo apt update' -i inventory all
. Running the playbook again then succeeds. An even better solution is to add the following to thepre_tasks
of the playbook:Testing the cluster with a deployment using Ansible
TASK [Create hello-k8s resources and wait until they are Ready.]
fails with errorFixed this issue by downgrading/pinning the openshift version in the
test-deployment.yml
playbook to v0.11.2 as outlined in this issue.Patching Flannel to use the right network interface
diff -u kube-flannel.yml kube-flannel-virtualbox.yml > kube-flannel-patch.txt
)kube-flannel-ds-amd64
butkube-flannel-ds
Chapter 5
Authenticating to the EKS Cluster via kubeconfig
The
aws-iam-authenticator
is no longer required when usingaws-cli
version 1.16.156 or laterChapter 6
(TODO in book)
Chapter 7
Manage Kind with Molecule
The default YAML files generated with
molecule init scenario
seem to have changed (quite a bit). Following along and making changes as suggested result inmolecule test
throwing an error:I suspect this has to do with the absent
connection: local
inconverge.yml
because after I modifiedconverge.yml
as outlined in the next subchapter of the book ("Test a playbook in Kind with Molecule"), the error went away.Test a playbook in Kind with Molecule
molecule converge
successfully runs (docker ps
shows me a running containerkindest/node:v1.20.2
) but if I runkubectl get job hello
after that, I get an error:Seems like the new kubeconfig (
~/.kube/config-molecule-test
) is not being used. Solved that by runningexport KUBECONFIG=~/.kube/config-molecule-test
Kubernetes CI Testing in GitHub Actions
molecule-kind.yml
and later in the subchapter you say "Once you have theci.yml
workflow file added to your repository"Groetjes, Ivo