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