feat: add initial port mapping example#435
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new port-mapping/ example demonstrating how to expose an internal HTTP service (port 8080) via Unikraft Cloud port mapping to external 443 over TLS/HTTP, including both kraft CLI and direct API workflows.
Changes:
- Introduces a minimal Python HTTP server plus container/Kraft packaging files for deployment.
- Adds a step-by-step README covering deploy/operate flows via
kraftCLI and via API helper scripts. - Adds configuration templates (
ukc.config.template,app.config) and API shell scripts for instance/image operations.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| port-mapping/ukc.config.template | Adds UKC user/token/metro config template and derived UKC_API base URL. |
| port-mapping/server.py | Adds a minimal HTTP server that listens on port 8080. |
| port-mapping/README.md | Documents CLI + API workflows for port mapping example. |
| port-mapping/Kraftfile | Defines Unikraft Cloud runtime, rootfs build, and command. |
| port-mapping/Dockerfile | Builds a Python slim OCI image containing the server. |
| port-mapping/app.config | Adds shared env vars for image/instance naming and port mapping. |
| port-mapping/api/stop-instance.sh | Adds API helper script to stop an instance. |
| port-mapping/api/start-instance.sh | Adds API helper script to start an instance. |
| port-mapping/api/query.sh | Adds API helper script to discover FQDN and query the service. |
| port-mapping/api/push-image.sh | Adds API workflow helper to push a packaged image. |
| port-mapping/api/pkg-image.sh | Adds API workflow helper to package an image. |
| port-mapping/api/get-instance-info.sh | Adds API helper script to list instance info. |
| port-mapping/api/delete-instance.sh | Adds API helper script to delete an instance. |
| port-mapping/api/create-instance.sh | Adds API helper script to create an instance with explicit port mapping. |
| port-mapping/.gitignore | Prevents committing the real ukc.config file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
72ee4d2 to
42f510b
Compare
Roxanacmaria
left a comment
There was a problem hiding this comment.
I reviewed the implementation and tested it on my side. Everything worked as expected, and I was able to follow the implementation without any issues. The code is clear, the documentation is easy to understand, and I did not encounter any problems while running the project.
Looks good to me. Nice work!
Dan-Andrei-Simionescu
left a comment
There was a problem hiding this comment.
I went through the code and tested the functionality locally. Everything behaves as intended. The code structure is clean, the instructions provided in the documentation are straightforward to follow.
No description provided.