Compare commits

..

No commits in common. "eff8a3075768f5664d9a275bb247fe48730397ac" and "b9f038548c64ee3634fb656047b0d5c0adf3ec12" have entirely different histories.

13 changed files with 21 additions and 219 deletions

View file

@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: podinfo
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "10"
spec:
project: workshop
source:
repoURL: https://github.com/shautvast/ops-demo
targetRevision: HEAD
path: manifests/apps/podinfo
destination:
server: https://kubernetes.default.svc
namespace: podinfo
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View file

@ -1,28 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ingress-nginx
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "3"
spec:
project: workshop
sources:
- repoURL: https://kubernetes.github.io/ingress-nginx
chart: ingress-nginx
targetRevision: "4.12.0"
helm:
valueFiles:
- $values/manifests/networking/ingress-nginx/values.yaml
- repoURL: https://github.com/shautvast/ops-demo
targetRevision: HEAD
ref: values
destination:
server: https://kubernetes.default.svc
namespace: ingress-nginx
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true

View file

@ -1,22 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: metallb-config
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "2"
spec:
project: workshop
source:
repoURL: https://github.com/shautvast/ops-demo
targetRevision: HEAD
path: manifests/networking/metallb
directory:
include: "metallb-config.yaml"
destination:
server: https://kubernetes.default.svc
namespace: metallb-system
syncPolicy:
automated:
prune: true
selfHeal: true

View file

@ -1,34 +0,0 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: metallb
namespace: argocd
annotations:
argocd.argoproj.io/sync-wave: "1"
spec:
project: workshop
ignoreDifferences:
- group: apiextensions.k8s.io
kind: CustomResourceDefinition
jsonPointers:
- /spec/conversion/webhook/clientConfig/caBundle
sources:
- repoURL: https://metallb.github.io/metallb
chart: metallb
targetRevision: "0.14.9"
helm:
valueFiles:
- $values/manifests/networking/metallb/values.yaml
- repoURL: https://github.com/shautvast/ops-demo
targetRevision: HEAD
ref: values
destination:
server: https://kubernetes.default.svc
namespace: metallb-system
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true

View file

@ -49,7 +49,6 @@ Maak de volgende bestanden aan:
> [!TIP]
> **Wat dit doet**
>
> - Dit is de Helm-values file voor MetalLB.
> - In deze workshop-VM kun je hem leeg laten; de standaard chart-values zijn genoeg.
@ -61,7 +60,6 @@ Maak de volgende bestanden aan:
> [!TIP]
> **Wat dit doet**
>
> - `IPAddressPool` bepaalt uit welke range MetalLB IP's mag uitdelen.
> - `L2Advertisement` maakt die pool zichtbaar op je host-only netwerk via ARP.
> - Daardoor kan je laptop services op dat IP direct bereiken.
@ -90,7 +88,6 @@ spec:
> [!TIP]
> **Wat dit doet**
>
> - Installeert MetalLB via ArgoCD als aparte `Application`.
> - De chart komt van de upstream Helm repo; jouw repo levert de values via `$values/...`.
> - `sync-wave: "1"` zorgt dat MetalLB eerst klaar is.
@ -137,7 +134,6 @@ spec:
> [!TIP]
> **Wat dit doet**
>
> - Past jouw IP-pool/L2-config toe als losse ArgoCD `Application`.
> - Die split houdt "installatie" en "runtime-config" van MetalLB uit elkaar.
> - `sync-wave: "2"` laat dit pas lopen nadat MetalLB zelf staat.
@ -175,7 +171,6 @@ spec:
> [!TIP]
> **Wat dit doet**
>
> - Zet ingress-nginx neer met een `LoadBalancer` service.
> - Dat service-IP wordt vast op `192.168.56.200` gezet.
> - Zo kun je stabiele hostnames gebruiken met `nip.io`.
@ -198,7 +193,6 @@ controller:
> [!TIP]
> **Wat dit doet**
>
> - Installeert ingress-nginx via ArgoCD.
> - Ook hier: chart upstream, values uit jouw repo.
> - `sync-wave: "3"` laat ingress pas starten nadat MetalLB + config klaar zijn.
@ -220,7 +214,7 @@ spec:
helm:
valueFiles:
- $values/manifests/networking/ingress-nginx/values.yaml
- repoURL: https://github.com/shautvast/ops-demo
- repoURL: JOUW_FORK_URL
targetRevision: HEAD
ref: values
destination:
@ -234,12 +228,11 @@ spec:
- CreateNamespace=true
```
## kubectl -n argocd patch application root --type merge -p '{"metadata":{"annotations":{"argocd.argoproj.io/refresh":"hard"}}}'
---
### 3. Alles committen en pushen
> **HOST**
>
> ```bash
> git add apps/networking/ manifests/networking/
> git commit -m "feat: MetalLB + Ingress-Nginx"
@ -249,7 +242,6 @@ spec:
Wacht tot beide applications Synced zijn, en controleer dan:
> **VM**
>
> ```bash
> kubectl get svc -n ingress-nginx
> # NAME TYPE EXTERNAL-IP PORT(S)
@ -259,7 +251,6 @@ Wacht tot beide applications Synced zijn, en controleer dan:
Vanuit je laptop:
> **HOST**
>
> ```bash
> curl http://192.168.56.200
> # 404 van Nginx — klopt, nog geen Ingress-regel
@ -277,7 +268,6 @@ Vanuit je laptop:
> [!TIP]
> **Wat dit doet**
>
> - Definieert de HTTP-route voor podinfo.
> - `ingressClassName: nginx` bindt deze Ingress aan ingress-nginx.
> - De hostnaam met `nip.io` wijst naar jouw MetalLB IP.
@ -304,7 +294,6 @@ spec:
```
> **HOST**
>
> ```bash
> git add manifests/apps/podinfo/ingress.yaml
> git commit -m "feat: voeg podinfo Ingress toe"
@ -321,13 +310,12 @@ Pas `manifests/argocd/values.yaml` aan. Zoek het uitgecommentarieerde ingress-bl
> [!TIP]
> **Wat dit doet**
>
> - Schakelt ingress in voor de ArgoCD server zelf.
> - Daarna kun je ArgoCD via browser-URL gebruiken in plaats van port-forward.
> - De `hostname` moet matchen met het IP dat ingress-nginx exposeert.
```yaml
ingress:
ingress:
enabled: true
ingressClassName: nginx
hostname: argocd.192.168.56.200.nip.io
@ -337,7 +325,6 @@ ingress:
```
> **HOST**
>
> ```bash
> git add manifests/argocd/values.yaml
> git commit -m "feat: schakel ArgoCD ingress in"
@ -361,15 +348,12 @@ speaker:
operator: Exists
effect: NoSchedule
```
> [!TIP]
> **Wat dit doet**
>
> - `tolerations` zijn alleen nodig als je cluster control-plane `NoSchedule` taints gebruikt.
>
> **Termen uitgelegd**
>
> - `speaker`: de MetalLB component die op nodes draait en op het netwerk "antwoordt" voor een toegewezen
>- `speaker`: de MetalLB component die op nodes draait en op het netwerk "antwoordt" voor een toegewezen
> LoadBalancer-IP (in L2-modus via ARP).
> - `tolerations`: een Kubernetes-mechanisme waarmee een pod toch op een node mag landen die een `taint` heeft.
> Control-plane nodes zijn vaak getaint met `NoSchedule`; zonder toleration wordt de speaker daar niet ingepland.
@ -381,7 +365,7 @@ Commit en push daarna opnieuw, zodat ArgoCD MetalLB met deze values heruitrolt.
## Verwacht resultaat
| URL | App |
| ------------------------------------ | -------------- |
|--------------------------------------|----------------|
| http://podinfo.192.168.56.200.nip.io | podinfo v6.6.2 |
| http://argocd.192.168.56.200.nip.io | ArgoCD UI |
@ -392,7 +376,7 @@ Beide bereikbaar vanaf je laptop zonder port-forward.
## Probleemoplossing
| Symptoom | Oplossing |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
|---------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| `EXTERNAL-IP` blijft `<pending>` | MetalLB is nog niet klaar — check `kubectl get pods -n metallb-system` |
| curl naar 192.168.56.200 time-out | VirtualBox host-only adapter niet geconfigureerd — zie vm-setup.md |
| nip.io resolvet niet | Tijdelijk DNS-probleem, probeer opnieuw of voeg toe aan `/etc/hosts` |

View file

@ -1,34 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo
namespace: podinfo
spec:
replicas: 1
selector:
matchLabels:
app: podinfo
template:
metadata:
labels:
app: podinfo
spec:
containers:
- name: podinfo
image: ghcr.io/stefanprodan/podinfo:6.6.2
ports:
- containerPort: 9898
name: http
env:
- name: PODINFO_UI_COLOR
value: "#2ecc71"
readinessProbe:
httpGet:
path: /readyz
port: 9898
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 64Mi

View file

@ -1,4 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: podinfo

View file

@ -1,12 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: podinfo
namespace: podinfo
spec:
selector:
app: podinfo
ports:
- port: 80
targetPort: 9898
name: http

View file

@ -12,13 +12,14 @@ server:
- --insecure
# ── Exercise 03: uncomment this block after Ingress-Nginx is deployed ──────
ingress:
enabled: true
ingressClassName: nginx
hostname: argocd.192.168.56.200.nip.io
annotations:
nginx.ingress.kubernetes.io/ssl-passthrough: "false"
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
# ingress:
# enabled: true
# ingressClassName: nginx
# hostname: argocd.192.168.56.200.nip.io
# annotations:
# nginx.ingress.kubernetes.io/ssl-passthrough: "false"
# nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
# ──────────────────────────────────────────────────────────────────────────
configs:
params:

View file

@ -1,8 +0,0 @@
apiVersion: metallb.io/v1beta1
kind: L2Advertisement
metadata:
name: workshop-l2
namespace: metallb-system
spec:
ipAddressPools:
- workshop-pool

View file

@ -1,11 +0,0 @@
controller:
ingressClassResource:
name: nginx
default: true
service:
type: LoadBalancer
loadBalancerIP: "192.168.56.200"
resources:
requests:
cpu: 100m
memory: 128Mi

View file

@ -1,8 +0,0 @@
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: workshop-pool
namespace: metallb-system
spec:
addresses:
- 192.168.56.200-192.168.56.220