Task 00: Kubernetes Lab Environment

Connect to the lab environment via RDP. Linux Jump Host => Access => XRDP

../../_images/01_udf_xrdp.jpg

username: ubuntu password: ubuntu

If you’re prompted for a password a second time: ubuntu

Open a terminal. Position and resize the terminal to the left side of the screen. ssh to microk8s1.

ssh ubuntu@microk8s1
ubuntu
../../_images/03_microk8s_login.jpg

Open the Firefox web browser. Position and resize the web browser to the right side of the screen. With your screen split between left (terminal) and right (web browser) windows, you can toggle maximize either window to take up the whole screen if you need the extra room to complete a lab task.

../../_images/04_split_screen.jpg

Clone the nginx-api-gateway-for-k8s repository.

git clone https://github.com/f5devcentral/nginx-api-gateway-for-k8s.git
../../_images/05_git_clone.jpg

Change into the working directory.

cd nginx-api-gateway-for-k8s

Copy the lab commands into your ~/.local/bin directory.

cp -r ./bin/* ~/.local/bin/
../../_images/07_cp_bin.jpg

Any shell script commands copied to ~/.local/bin wil be made executable and available to invoke from anywhere automatically. Use [Tab] completion to save time.

ls -alt ~/.local/bin
../../_images/08_ls_bin.jpg

If running in your own environment, make the shell script commands executable.

chmod +x ~/.local/bin/*

Familiarize yourself with the lab environment before you get started.

The lab environment consists of a single-node K8s cluster (microk8s) running (NGINX Plus with App Protect) as ingress in a daemonset.

kubectl and k are aliased to microk8s kubectl. These commands can be used interchangeably.

alias

The three commands below would display the same results.

k get daemonset nginx-ingress -n nginx-ingress
kubectl get daemonset nginx-ingress -n nginx-ingress
microk8s kubectl get daemonset nginx-ingress -n nginx-ingress
../../_images/05b_get_daemonset_nginx_ingress.jpg

NGINX Plus is running as a daemonset and will listen on TCP ports 80 and 443 by default.

From the web browser try:

http://10.1.1.4:80 # returns “404 Not Found” when not configured

http://10.1.1.4:443 # returns “400 Bad Request” when not configured

../../_images/06_nginx_404_not_found.jpg

Confirm the K8s cluster is healthy. Look for green ‘clean’.

microk8s-status.sh
../../_images/09_microk8s-status.jpg

Confirm name resolution works from inside a test container.

test-dns.sh
../../_images/10_test-dns.jpg

The NGINX Plus images are available in the container registry running on http://localhost:32000/v2/_catalog.

curl http://localhost:32000/v2/_catalog | jq
../../_images/11_microk8s_local_container_repo.jpg

You can see all the K8s resources created in the lab at any time.

list-all-k8s-lab-resources.sh
../../_images/12_list-all-k8s-lab-resources.jpg

Attention

You can restore the lab back to a clean state at any time with the start-over flag.

list-all-k8s-lab-resources.sh --start-over