Almost everything in Kubernetes will work around pods, so it’s very important to understand what they are and how to run and interact with them. We encourage you to try to run a pod yourself.
In the examples so far, we have been using nginx, so a good exercise would be to try to run Apache, which is another web server that works similarly. Here’s a list of things you could do:
Write a pod manifest file to run the apache container (the docker image is called httpd).
Use kubectl to apply this manifest and see it running.
Use kubectl port-forward to send requests from the port 3000 to the container’s port 80.
Note: You need to add the --address 0.0.0.0 to the kubectl port-forward to run it on the platform.
Confirm that you can see Apache’s default page saying “It works!” when you access the APP URL in the widget below.
Enter the container, and change the contents of the file
/usr/local/apache2/htdocs/index.html, so when you refresh the page you can see your changes.
Search in directory...
/
apache.yaml
apache.yaml
1
# Write your code here
Run
Save
Reset
Your app can be found at: https://ed-5009147949744128_dc.educative.run
Test your manifest here
Note: Hit the “RUN” button before clicking on the app link.
If you can do that, well done! You already understand the main concept we will be working with. From now on, almost everything we will do is to ensure these pods are running the way they should.