/ansible-kubernetes-workshop

Documentation and files accompanying my 'Ansible for Kubernetes' talks

Primary LanguageJavaScriptMIT LicenseMIT

Ansible Kubernetes Workshop

Introduction to deploying on Kubernetes using Ansible.

Preparing for the Workshop

Local Setup

Before taking part in the workshop, please make sure your local system has the following applications installed:

You will also need a copy of this repository:

  • Download a zip
  • git clone https://github.com/JeffreyDD/ansible-kubernetes-workshop.git
    cd ansible-kubernetes-workshop
    git checkout complete
    

Not required, but recommended for an optimal experience:

Windows Notes

While Ansible supports managing Windows nodes, it can not run on Windows. If you want to to participate in the workshop from a windows machine, you'll need to use WSL2.

Cluster Setup

Besides having the above mentioned tools installed, you'll also need access to a Kubernetes cluster, with the following features configured and working:

  • Cluster networking
  • Persistent volumes
  • Ingress controller

For most users, running this locally for the workshop is the way to go. There are many ways of running Kubernetes locally, but the following methods have been verified to work for most users' environments.

  • Minikube

    Recommended for novice users

    Minikube runs Kubernetes in a prebuilt virtual machine, completely isolated from your local environment. It supports macOS, Linux and Windows, and works with many virtualization providers, of which VirtualBox is easiest to setup for most users.

  • Docker Desktop

    Recommended for users already running Docker Desktop

    Docker Desktop also offers a Kubernetes integration which is very easy to use. You will need to deploy

Configuring /etc/hosts

As we'll be using hostname-based ingresses during the workshop, you'll need to update your hosts file.

For most Docker Desktop users this step isn't required. If you are facing issues during the workshop, apply the following configuration, but replace <minikube-ip> with 127.0.0.1, or whatever is appropriate for your custom docker setup.

Add the following lines to your hosts file, replacing <minikube-ip> with the output of the minikube ip command. You can follow these instructions on updating your hosts file on Windows, Linux and MacOS to do so.

<minikube-ip>	wordpress.localtest.me
<minikube-ip>	prometheus.localtest.me
<minikube-ip>	grafana.localtest.me
<minikube-ip>	alertmanager.localtest.me
<minikube-ip>	mattermost.localtest.me
<minikube-ip>	home.localtest.me
<minikube-ip>	dashboard.localtest.me

FAQ

Error: failed to create resource: Internal error occurred: failed calling webhook \"validate.nginx.ingress.kubernetes.io\": an error on the server (\"\") has prevented the request from succeeding The following should fix the issue on minikube: kubectl delete -A ValidatingWebhookConfiguration ingress-nginx-admission