Welcome to Cloud Academy's lab guide for Performing a Kubernetes Deployment using ConfigMaps and Helm.
In this Lab scenario, you'll work with 2 containers. An NGINX web server container will be configured to proxy incoming HTTP requests downstream to another container running a customized FLASK-based web application. The NGINX web server container will use the publicly available nginx:1.13.7 image. The FLASK-based web application container will be based on a custom docker image that you will need to create first.
This lab uses a web-based IDE so that you can gain access to and modify the files on the server. For students who aren't familiar with this method, it can cause some confusion at first. The most common concerns we receive about this lab are connecting to the IDE and then running the first few commands. Below, you'll find some extra guidance.
1. Ensure that the lab environment is 100% completed. Click the Open Environment button to access the console. Use the student credentials provided in the lab to sign in.
2. Go to EC2 page and select the ide.containers.cloudacademy.platform.instance under Instance tab. Locate and copy the Public IPv4 address under the Details tab.
3. On your browser, enter the command: http://PUBLIC_IP_IDE_CLOUDACADEMY_PLATFORM_INSTANCE:8080, replacing the value to your instance’s IPv4 address copied earlier to access the IDE.
4. To access the Explorer view, click the two-sheet icon on the left-hand side. Navigate to and expand the lab/code/App/lab-code/flaskapp folder. Double click both the Dockerfile and main.py to open.
5. Right-click over the flaskapp folder and then select the Open in Terminal menu option:
6. On the new terminal session, ensure to copy and paste the commands perfectly so that you'll receive the correct results as in the instruction.
7. This should let you pass the validation checks.
8. On the same terminal, run the following command to change into the k8s directory
cd ../k8s && ls -la
9. Go back to the Explorer view and select the k8s folder. Double click the nginx.configmap.yaml file to open.
10. Add the following commands directly beneath the #Code1.0 comment block:
The updated file nginx.configmap.yaml manifest file should now look like the following:
11. Go back to the terminal, and run the remaining commands to update the nginx.configmap.yaml file into the K8s cluster and list out all of the ConfigMap resources in the K8s cluster.
Do the same process for the deployment.yaml file following the commands provided in the steps. You need to be careful with the YAML formatting - indentation and whitespace are important - indentation should be performed using spaces, not tabs.
The updated file deployment.yaml manifest file should now look like the following:
NOTE: Make sure that you save (CTRL+S) the updated deployment.yaml file BEFORE proceeding onto the next step.
In case you’ll get the error: “Failed to connect to 10.109.105.66 port 80: Connection refused.” this could be due to numerous reasons - the error specifics def indicate a network connection issue. Likely a problem due to incorrectly editing the K8s manifest files (easily done).
To address this, you should copy the fully edited equivalent manifest file from within the provided solution-code folder. Also, the curl command must be performed within the provided IDE’s integrated terminal - the IP address is an internal cluster address that will not resolve externally; if it happens again, please check the EPs (endpoints) registered against the frontend service using:
kubectl get ep frontend
I hope you have found our guide helpful!
If you have any additional questions or concerns, please email firstname.lastname@example.org or use the Submit a Request link at the top right corner of this page.