From 08a723fdbd89d0afe13549c4e833ca9306f8d91d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 18 Oct 2026 17:14:27 +0100 Subject: [PATCH 1/2] feature: add podinfo deploy --- dev/onboarding/services/podinfo/README.md | 74 +++++++++++++++++++++ dev/onboarding/services/podinfo/deploy.sh | 14 ++++ dev/onboarding/services/podinfo/values.yaml | 21 ++++++ 3 files changed, 109 insertions(+) create mode 100644 dev/onboarding/services/podinfo/README.md create mode 100755 dev/onboarding/services/podinfo/deploy.sh create mode 100644 dev/onboarding/services/podinfo/values.yaml diff --git a/dev/onboarding/services/podinfo/README.md b/dev/onboarding/services/podinfo/README.md new file mode 100644 index 0000000..8cbb90c --- /dev/null +++ b/dev/onboarding/services/podinfo/README.md @@ -0,0 +1,74 @@ +# Podinfo + +Run these commands from `dev/onboarding/services/podinfo`, with your test cluster selected. + +## Deploy or update + +```bash +bash deploy.sh +``` + +The script installs Podinfo or updates the existing release using `values.yaml`. + +## Open in the browser + +```bash +kubectl port-forward -n podinfo svc/podinfo 8080:8081 +``` + +Open [http://localhost:8080](http://localhost:8080). Keep the command running and stop it with Ctrl+C. Restart it if an update replaces the connected pod. + +With the current values, `8080` is the local port, `service.externalPort: 8081` is the Service port, and `service.httpPort: 8081` is the application port inside the pod. + +## Changes to try + +Edit `values.yaml`, run `bash deploy.sh` again, and observe the result. + +| Setting | Change to try | +| --- | --- | +| `ui.message` | Write your team's welcome message. | +| `ui.color` | Choose a quoted hex color, such as `"#00897b"`. | +| `ui.logo` | Use an image URL that the browser can access, or `""` for the default logo. A local file is not uploaded by Helm. | +| `replicaCount` | Switch between `1` and `3`, then inspect the pods. | +| `service.externalPort` | Change the Service port. Update the number after `:` in the port-forward command to match it. | +| `service.httpPort` | Change the application port inside the pod. The chart updates the application, container port, and health checks. The Service follows the named container port automatically. | +| `resources.requests` | Try CPU `20m` and memory `64Mi`. Requests are used to schedule pods. | +| `resources.limits` | CPU and memory caps. Keep requests at or below limits. `100m` is one tenth of a CPU core, and `Mi` means mebibytes. | + +For example, change only `service.externalPort` to `9898`, leaving `service.httpPort` at `8081`. Apply with `bash deploy.sh`, stop the old forward, and run: + +```bash +kubectl port-forward -n podinfo svc/podinfo 8080:9898 +``` + +The browser URL stays [http://localhost:8080](http://localhost:8080). The Service now accepts traffic on `9898` and sends it to the application on `8081`. Changing only `service.httpPort` does not require a different port-forward mapping, though you may need to restart the forward after the rollout. + +Inspect pods and resource settings: + +```bash +kubectl get pods -n podinfo +kubectl describe deployment podinfo -n podinfo +``` + +Start with the UI, then replicas, ports, and resources. Change one thing at a time. + +## Try deliberate failures + +Set one flag under `faults` in `values.yaml` to `true`, then run `bash deploy.sh`. + +| Flag | Effect | +| --- | --- | +| `delay` | Adds random response delays of up to 5 seconds. | +| `error` | Makes approximately one third of application requests return an HTTP error. | +| `unready` | Makes readiness checks fail, so affected pods are not eligible for normal Service traffic. | +| `unhealthy` | Makes health checks fail, which can cause Kubernetes to restart the container. | + +Start with `delay` or `error`. Restart port-forwarding if needed, then repeat this command to compare responses: + +```bash +curl -i http://localhost:8080/ +``` + +With `unready` or `unhealthy`, `deploy.sh` can time out because it waits for pods to become ready. A timeout does not automatically undo the deployment. + +To recover, set the enabled flags back to `false` and run `bash deploy.sh` again. diff --git a/dev/onboarding/services/podinfo/deploy.sh b/dev/onboarding/services/podinfo/deploy.sh new file mode 100755 index 0000000..b4a288d --- /dev/null +++ b/dev/onboarding/services/podinfo/deploy.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" + +helm repo add stefanprodan https://stefanprodan.github.io/podinfo +helm repo update stefanprodan + +helm upgrade --install podinfo stefanprodan/podinfo \ + --version 6.14.0 \ + --namespace podinfo \ + --create-namespace \ + --values "$SCRIPT_DIR/values.yaml" \ + --wait --timeout 5m \ No newline at end of file diff --git a/dev/onboarding/services/podinfo/values.yaml b/dev/onboarding/services/podinfo/values.yaml new file mode 100644 index 0000000..0a50ed6 --- /dev/null +++ b/dev/onboarding/services/podinfo/values.yaml @@ -0,0 +1,21 @@ +ui: + message: Welcome to Niployments! + color: '#000000' + logo: 'https://avatars.githubusercontent.com/u/3583307?s=280&v=4' +replicaCount: 3 +service: + type: ClusterIP + externalPort: 8081 + httpPort: 8081 +resources: + requests: + cpu: 10m + memory: 32Mi + limits: + cpu: 500m + memory: 128Mi +faults: + delay: false + error: false + unready: false + unhealthy: false From 155afa858c209a5a190d1ca524e476b80b47d2fa Mon Sep 17 00:00:00 2001 From: Filipe Esteves <97606680+FrozenHart@users.noreply.github.com> Date: Tue, 20 Oct 2026 00:17:36 +0100 Subject: [PATCH 2/2] Delete dev/onboarding/services/podinfo/README.md we will put this file in the wiki --- dev/onboarding/services/podinfo/README.md | 74 ----------------------- 1 file changed, 74 deletions(-) delete mode 100644 dev/onboarding/services/podinfo/README.md diff --git a/dev/onboarding/services/podinfo/README.md b/dev/onboarding/services/podinfo/README.md deleted file mode 100644 index 8cbb90c..0000000 --- a/dev/onboarding/services/podinfo/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# Podinfo - -Run these commands from `dev/onboarding/services/podinfo`, with your test cluster selected. - -## Deploy or update - -```bash -bash deploy.sh -``` - -The script installs Podinfo or updates the existing release using `values.yaml`. - -## Open in the browser - -```bash -kubectl port-forward -n podinfo svc/podinfo 8080:8081 -``` - -Open [http://localhost:8080](http://localhost:8080). Keep the command running and stop it with Ctrl+C. Restart it if an update replaces the connected pod. - -With the current values, `8080` is the local port, `service.externalPort: 8081` is the Service port, and `service.httpPort: 8081` is the application port inside the pod. - -## Changes to try - -Edit `values.yaml`, run `bash deploy.sh` again, and observe the result. - -| Setting | Change to try | -| --- | --- | -| `ui.message` | Write your team's welcome message. | -| `ui.color` | Choose a quoted hex color, such as `"#00897b"`. | -| `ui.logo` | Use an image URL that the browser can access, or `""` for the default logo. A local file is not uploaded by Helm. | -| `replicaCount` | Switch between `1` and `3`, then inspect the pods. | -| `service.externalPort` | Change the Service port. Update the number after `:` in the port-forward command to match it. | -| `service.httpPort` | Change the application port inside the pod. The chart updates the application, container port, and health checks. The Service follows the named container port automatically. | -| `resources.requests` | Try CPU `20m` and memory `64Mi`. Requests are used to schedule pods. | -| `resources.limits` | CPU and memory caps. Keep requests at or below limits. `100m` is one tenth of a CPU core, and `Mi` means mebibytes. | - -For example, change only `service.externalPort` to `9898`, leaving `service.httpPort` at `8081`. Apply with `bash deploy.sh`, stop the old forward, and run: - -```bash -kubectl port-forward -n podinfo svc/podinfo 8080:9898 -``` - -The browser URL stays [http://localhost:8080](http://localhost:8080). The Service now accepts traffic on `9898` and sends it to the application on `8081`. Changing only `service.httpPort` does not require a different port-forward mapping, though you may need to restart the forward after the rollout. - -Inspect pods and resource settings: - -```bash -kubectl get pods -n podinfo -kubectl describe deployment podinfo -n podinfo -``` - -Start with the UI, then replicas, ports, and resources. Change one thing at a time. - -## Try deliberate failures - -Set one flag under `faults` in `values.yaml` to `true`, then run `bash deploy.sh`. - -| Flag | Effect | -| --- | --- | -| `delay` | Adds random response delays of up to 5 seconds. | -| `error` | Makes approximately one third of application requests return an HTTP error. | -| `unready` | Makes readiness checks fail, so affected pods are not eligible for normal Service traffic. | -| `unhealthy` | Makes health checks fail, which can cause Kubernetes to restart the container. | - -Start with `delay` or `error`. Restart port-forwarding if needed, then repeat this command to compare responses: - -```bash -curl -i http://localhost:8080/ -``` - -With `unready` or `unhealthy`, `deploy.sh` can time out because it waits for pods to become ready. A timeout does not automatically undo the deployment. - -To recover, set the enabled flags back to `false` and run `bash deploy.sh` again.