New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More information when creating a pod (networking, environment variables, etc.) #1073
Comments
Created some observations for an upcoming Kubernetes / Pod meeting that may be applicable to this issue: // Alright! Here goes!
// Step 1. Running this on the CLI
// First thing I'll do is create a separate network so the containers can access each other:
podman network create kube-test
// Create the MYSQL container
podman run -d -e MYSQL_ROOT_PASSWORD="tutorial" -e MYSQL_DATABASE="tutorial-db" -e MYSQL_USER="tutorial-user" -e MYSQL_PASSWORD="tutorial-pw" --network=kube-test --publish 3306:3306 --name=tutorial-db docker.io/mariadb
// Now we create the Wordpress container!
podman run -d -e WORDPRESS_DB_NAME="tutorial-db" -e WORDPRESS_DB_USER="tutorial-user" -e WORDPRESS_DB_PASSWORD="tutorial-pw" -e WORDPRESS_DB_HOST="tutorial-db:3306" --network=kube-test --publish 8080:80 --name=tutorial-wp docker.io/wordpress
// Yup! It works! Can login and everything. No problem there.
// Step 2. Convert from Containers to Pods within Podman Desktop.
// Doesn't work
// Issues encountered:
// Wordpress container unable to talk to DB container (the DNS /etc/resolv.conf isn't properly populated / it's not on the same network)
// Most likely Podman Desktop issue when podifying that doesn't take into account networking? Will need to investigate it more.
// Step 3. Let's try again by creating the pod manually NOT part of Podman Desktop
// Create the pod with the correct ports
podman pod create --name tutorial-pod -p 3306:3306 -p 8080:80
// Create the same containers (without the port publishing)
podman run -d --pod tutorial-pod -e WORDPRESS_DB_NAME="tutorial-db" -e WORDPRESS_DB_USER="tutorial-user" -e WORDPRESS_DB_PASSWORD="tutorial-pw" -e WORDPRESS_DB_HOST="tutorial-db:3306" --name=tutorial-wp docker.io/wordpress
podman run -d --pod tutorial-pod -e MYSQL_ROOT_PASSWORD="tutorial" -e MYSQL_DATABASE="tutorial-db" -e MYSQL_USER="tutorial-user" -e MYSQL_PASSWORD="tutorial-pw" --name=tutorial-db docker.io/mariadb
// Works! Can access the database + access the pods at port :8080
// Conclusion: Something odd is happening when creating the pod from "normal" containers within Podman Desktop.
// Action items:
// * Better interaction when creating the Pods (selecting ports, what's going to be shown, networking, etc.). There is an issue for this here: https://github.com/containers/podman-desktop/issues/1073
// * Debugging / logging? What's happening / being created?
// Step 4. Going from the Pods to Kubernetes
// Click on the "Deploy to Kubernetes" in the GUI.
// First observations:
// * Long YAML, but small viewbox to view everything
// * When changing the Pod Name the YAML isn't updated with the new Pod name (how do we know it'll deploy that pod name?)
// * Why is it a Pod / shouldn't we deploying as a Deployment? If it's a Pod, it'll never be recreated if it deletes.
// * No information for newcomers / resources / those who are unfamiliar with Kubernetes. I find this is the biggest pain. Kubernetes is complex. This pod is similar to Podman's pods, but this will dissapear on restart. Also, what's with all these annotations? Do I ignore them? Are they important?
// * We use none of the Kubernetes recommended labels for the Pod generation. We should be adding a name at least: https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/#labels
// First deployment
// * When deployed, the pod says "404 not found" in GUI
// * I see it is deployed within Kubernetes (using Lens GUI)
// Observations
// * No "next steps". Once deployed, you are on your own in Kubernetes land
// * No checking to see if Pod is UP yet, only that it's been deployed
// It works! I was able to port forward and access it. However. It's a Pod, on restart it'll dissapear, and I had to setup the port forwarding manually.
// Observations
// * Maybe I want to create a service / deployment to be able to access it?
|
This issue has been automatically marked as stale because it has not had activity in the last 6 months. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions! |
This issue has been automatically closed because it has not had any further activity in the last 30 days. Thank you for your contributions! |
Is your enhancement related to a problem? Please describe
When creating a pod, we should show what is accessible within the pod, environment variables which are shared between pods, networking, etc.
Right now the page is very blank and documentation is lacking on what Pods actually "do".
Describe the solution you'd like
More information with regards to pod creation.
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: