Add whoami as a second real app (docs/08 hands-on exercise)

This commit is contained in:
2026-09-03 03:52:11 +01:00
parent 574d3032db
commit f5cb20ad6b
5 changed files with 82 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
# This is an Argo CD "Application" — see apps/demo.yaml for the full
# explanation of what this resource is and why you never apply it by hand.
# This one is the docs/08-adding-new-apps.md hands-on exercise: a second,
# independent app added the normal way, proving the app-of-apps pattern
# works for more than the pre-installed apps.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: whoami
namespace: argocd
spec:
project: default
source:
repoURL: https://tea.ahmza.com/ahmza/k8s-starter-pack.git
targetRevision: main
path: apps/whoami
destination:
server: https://kubernetes.default.svc
namespace: whoami
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
+25
View File
@@ -0,0 +1,25 @@
# A tiny HTTP server that echoes back request details (headers, hostname,
# IP) — useful as a second, real, end-to-end proof of the app-of-apps
# pattern from docs/08-adding-new-apps.md: no storage, no privileged
# access, just a Deployment and a Service like apps/demo/, but a completely
# separate app added the normal way (drop files in apps/, commit, push).
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
namespace: whoami
spec:
replicas: 1
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami:v1.10
ports:
- containerPort: 80
+10
View File
@@ -0,0 +1,10 @@
# A Namespace is a way to group related resources together inside the
# cluster, like a folder. Keeping "whoami" separate from other apps lets you
# manage, view, and delete them independently (e.g. `kubectl -n whoami get pods`).
#
# We create this explicitly, as its own file, rather than letting Argo CD
# invent it implicitly. That way it shows up in Git like everything else.
apiVersion: v1
kind: Namespace
metadata:
name: whoami
+17
View File
@@ -0,0 +1,17 @@
# type: LoadBalancer asks MetalLB for a real, routable address from this
# cluster's dedicated BGP service pool — see docs/05-metallb.md. 10.10.60.12
# is the next free address in docs/network.md at the time this was added.
apiVersion: v1
kind: Service
metadata:
name: whoami
namespace: whoami
annotations:
metallb.io/loadBalancerIPs: "10.10.60.12"
spec:
type: LoadBalancer
selector:
app: whoami
ports:
- port: 80
targetPort: 80