From cdee645cb912f9d4265e944c67125821bf085b7e Mon Sep 17 00:00:00 2001 From: Florent Benoit Date: Mon, 5 May 2025 16:46:59 +0200 Subject: [PATCH 1/4] docs: add demo script for the minc-extension --- minc-extension/README.md | 75 ++++++++++++++++++++++ minc-extension/frontend-test/Containerfile | 4 ++ minc-extension/frontend-test/index.html | 18 ++++++ 3 files changed, 97 insertions(+) create mode 100644 minc-extension/README.md create mode 100644 minc-extension/frontend-test/Containerfile create mode 100644 minc-extension/frontend-test/index.html diff --git a/minc-extension/README.md b/minc-extension/README.md new file mode 100644 index 0000000..c9e59d7 --- /dev/null +++ b/minc-extension/README.md @@ -0,0 +1,75 @@ +# Demo Using MINC (MicroShift IN Container) + +## Prerequisites + +- Install the MINC extension: + `ghcr.io/minc-org/minc-extension:next` (for the current development version) +- Install the demo extension: + `quay.io/podman-desktop-demo/podman-desktop-extension` +- Clone this demo repository. +- Go to the **Resources** tab and click **Create new...** under the **MicroShift** entry + (depending on the configuration, select ports 443 and 80 as local ports). +- Ensure the current Kubernetes namespace is set to `microshift`. +- Check the existing Kubernetes resources: + - In **Kubernetes > Pods**, ensure no pod from the app is currently running. + - In **Kubernetes > Services**, remove any service from a previous deployment. + - In **Ingresses/Routes**, remove the `my-pod` route if it exists. + +## Podify / Kubify Demo + +### Podify + +1. Initialize the frontend and backend containers by clicking on the status bar. +1. Once the status bar displays `Podify Demo ready`, navigate to the **Containers** view. +1. Verify that both containers are running. Click the kebab menu (`⋮`) on `python-frontend` and select **Open Browser**. +1. Pod creation steps: + - Select the checkboxes for `python-frontend` and `redis`. + - Click the **Create Pod** button near the container search bar. + - Uncheck port `6379` for Redis (we don't want to expose it externally). + - Click **Create Pod**. + - Open the pod details and click the `↗️` icon to open the browser to the exposed port. + +### Kubify + +1. Ensure `microshift` is still the selected Kubernetes namespace (check in the bottom-left status bar). +1. In the **Pods** view, click the kebab menu for your pod and select **Deploy to Kubernetes**. +1. Make sure the checkboxes for: + - **Kubernetes Services** + - **Create OpenShift Routes** + are selected. +1. Click **Deploy**. +1. At the bottom, under **Endpoints**, you should see: + `Port 5000 is reachable with route my-pod-8088` — click the link. +1. Confirm in the dialog to open: + `https://my-pod-8088-default.apps.127.0.0.1.nip.io` +1. If your MINC configuration uses a different port (not 443), append the port to the URL like `:9443`. + - To verify the port, open the `microshift` container from the Containers view — it lists the exposed ports. + +## Local Mode + +1. Go to the **Images** section in the left navigation bar. +1. Click the **Build** button in the top right. +1. Set the **Containerfile path** to: + `minc-extension/frontend-test/Containerfile` (from this repository). +1. Keep the default value for **Build context directory**. +1. Enter `my-local-httpd` as the **Image Name**. +1. Click **Build**, and then **Done** once the build completes. +1. Verify that the `my-local-httpd` image appears under **Images** (e.g., `docker.io/my-local-httpd`). +1. Check that the image is available inside MicroShift by running the following in the `microshift` container: + ```bash + crictl images | grep my-local + ``` + in the `microshift` container. +1. Start the container from the image by clicking the ▶️ icon. Keep default options. +1. Verify the app is working by clicking the `↗️` icon to open it in a browser. +1. Convert the running container to a pod: + - Select the container. + - Click the **Create Pod** button near the container search. + - Use `my-custom-image-pod` as the name. + - Expose only port `8080`. + - Click **Create Pod**. +1. In the pod’s kebab menu, click **Deploy to Kubernetes**, then click the `nip.io` link. + - You may need to append `:9443` to the link if that's the configured port. + +> 📝 Note: The image is **not** on Docker Hub — it's a **local image**. +> No step is required to copy or import the image. \ No newline at end of file diff --git a/minc-extension/frontend-test/Containerfile b/minc-extension/frontend-test/Containerfile new file mode 100644 index 0000000..1246d21 --- /dev/null +++ b/minc-extension/frontend-test/Containerfile @@ -0,0 +1,4 @@ +FROM registry.access.redhat.com/ubi9/httpd-24@sha256:87f232768f58423776d56db593862aff5024c106d357ec2d443ef48f0ae8019e +COPY index.html /var/www/html/index.html +# expose frontend port +# EXPOSE 8080 \ No newline at end of file diff --git a/minc-extension/frontend-test/index.html b/minc-extension/frontend-test/index.html new file mode 100644 index 0000000..c18d64e --- /dev/null +++ b/minc-extension/frontend-test/index.html @@ -0,0 +1,18 @@ + + + + + + Welcome Page + + + +
+

Welcome to a custom page

+

HTTPD server running.

+ + Local Build + +
+ + \ No newline at end of file From e4a9a2590f63c524f560b7b2f3382f32569bdd18 Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Fri, 9 May 2025 13:47:42 +0200 Subject: [PATCH 2/4] chore: update file --- minc-extension/frontend-test/Containerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/minc-extension/frontend-test/Containerfile b/minc-extension/frontend-test/Containerfile index 1246d21..f40f60f 100644 --- a/minc-extension/frontend-test/Containerfile +++ b/minc-extension/frontend-test/Containerfile @@ -1,4 +1,2 @@ FROM registry.access.redhat.com/ubi9/httpd-24@sha256:87f232768f58423776d56db593862aff5024c106d357ec2d443ef48f0ae8019e COPY index.html /var/www/html/index.html -# expose frontend port -# EXPOSE 8080 \ No newline at end of file From d27025bc946f8b60043f45c213831b5641d84771 Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Fri, 9 May 2025 13:47:58 +0200 Subject: [PATCH 3/4] chore: add missing EOF/newline --- minc-extension/frontend-test/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minc-extension/frontend-test/index.html b/minc-extension/frontend-test/index.html index c18d64e..5744654 100644 --- a/minc-extension/frontend-test/index.html +++ b/minc-extension/frontend-test/index.html @@ -15,4 +15,4 @@

Welcome to a custom page

- \ No newline at end of file + From 1f312cc72fb4f91df28e83fe41d0e56b3fb30eb7 Mon Sep 17 00:00:00 2001 From: Florent BENOIT Date: Mon, 12 May 2025 15:23:01 +0200 Subject: [PATCH 4/4] chore: amend install part --- minc-extension/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/minc-extension/README.md b/minc-extension/README.md index c9e59d7..16ba130 100644 --- a/minc-extension/README.md +++ b/minc-extension/README.md @@ -2,8 +2,7 @@ ## Prerequisites -- Install the MINC extension: - `ghcr.io/minc-org/minc-extension:next` (for the current development version) +- Install the MINC extension from the catalog of extensions - Install the demo extension: `quay.io/podman-desktop-demo/podman-desktop-extension` - Clone this demo repository. @@ -72,4 +71,4 @@ - You may need to append `:9443` to the link if that's the configured port. > 📝 Note: The image is **not** on Docker Hub — it's a **local image**. -> No step is required to copy or import the image. \ No newline at end of file +> No step is required to copy or import the image.