Compare commits
10 commits
b9f038548c
...
eff8a30757
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eff8a30757 | ||
|
|
0874071ab9 | ||
|
|
26e0c64d0a | ||
|
|
efdd0bcdc0 | ||
|
|
6103d4e2ec | ||
|
|
d0b1420565 | ||
|
|
896869b3b3 | ||
|
|
f0680b97af | ||
|
|
f4c109ab89 | ||
|
|
32c37f1513 |
13 changed files with 219 additions and 21 deletions
22
apps/apps/podinfo.yaml
Normal file
22
apps/apps/podinfo.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
28
apps/networking/ingress-nginx.yaml
Normal file
28
apps/networking/ingress-nginx.yaml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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
|
||||
22
apps/networking/metallb-config.yaml
Normal file
22
apps/networking/metallb-config.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
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
|
||||
34
apps/networking/metallb.yaml
Normal file
34
apps/networking/metallb.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
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
|
||||
|
|
@ -49,6 +49,7 @@ 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.
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ 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.
|
||||
|
|
@ -88,6 +90,7 @@ 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.
|
||||
|
|
@ -134,6 +137,7 @@ 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.
|
||||
|
|
@ -171,6 +175,7 @@ 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`.
|
||||
|
|
@ -193,6 +198,7 @@ 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.
|
||||
|
|
@ -214,7 +220,7 @@ spec:
|
|||
helm:
|
||||
valueFiles:
|
||||
- $values/manifests/networking/ingress-nginx/values.yaml
|
||||
- repoURL: JOUW_FORK_URL
|
||||
- repoURL: https://github.com/shautvast/ops-demo
|
||||
targetRevision: HEAD
|
||||
ref: values
|
||||
destination:
|
||||
|
|
@ -228,11 +234,12 @@ 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"
|
||||
|
|
@ -242,6 +249,7 @@ spec:
|
|||
Wacht tot beide applications Synced zijn, en controleer dan:
|
||||
|
||||
> **VM**
|
||||
>
|
||||
> ```bash
|
||||
> kubectl get svc -n ingress-nginx
|
||||
> # NAME TYPE EXTERNAL-IP PORT(S)
|
||||
|
|
@ -251,6 +259,7 @@ 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
|
||||
|
|
@ -268,6 +277,7 @@ 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.
|
||||
|
|
@ -294,6 +304,7 @@ spec:
|
|||
```
|
||||
|
||||
> **HOST**
|
||||
>
|
||||
> ```bash
|
||||
> git add manifests/apps/podinfo/ingress.yaml
|
||||
> git commit -m "feat: voeg podinfo Ingress toe"
|
||||
|
|
@ -310,21 +321,23 @@ 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:
|
||||
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"
|
||||
```
|
||||
|
||||
> **HOST**
|
||||
>
|
||||
> ```bash
|
||||
> git add manifests/argocd/values.yaml
|
||||
> git commit -m "feat: schakel ArgoCD ingress in"
|
||||
|
|
@ -348,13 +361,16 @@ 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
|
||||
> 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.
|
||||
> 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
|
||||
|
||||
| URL | App |
|
||||
|--------------------------------------|----------------|
|
||||
| ------------------------------------ | -------------- |
|
||||
| http://podinfo.192.168.56.200.nip.io | podinfo v6.6.2 |
|
||||
| http://argocd.192.168.56.200.nip.io | ArgoCD UI |
|
||||
|
||||
|
|
@ -376,7 +392,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` |
|
||||
|
|
|
|||
34
manifests/apps/podinfo/deployment.yaml
Normal file
34
manifests/apps/podinfo/deployment.yaml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
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
|
||||
4
manifests/apps/podinfo/namespace.yaml
Normal file
4
manifests/apps/podinfo/namespace.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: podinfo
|
||||
12
manifests/apps/podinfo/service.yaml
Normal file
12
manifests/apps/podinfo/service.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: podinfo
|
||||
namespace: podinfo
|
||||
spec:
|
||||
selector:
|
||||
app: podinfo
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 9898
|
||||
name: http
|
||||
|
|
@ -12,14 +12,13 @@ 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:
|
||||
|
|
|
|||
8
manifests/networking/L2Advertisement.yaml
Normal file
8
manifests/networking/L2Advertisement.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: metallb.io/v1beta1
|
||||
kind: L2Advertisement
|
||||
metadata:
|
||||
name: workshop-l2
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
ipAddressPools:
|
||||
- workshop-pool
|
||||
11
manifests/networking/ingress-nginx/values.yaml
Normal file
11
manifests/networking/ingress-nginx/values.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
controller:
|
||||
ingressClassResource:
|
||||
name: nginx
|
||||
default: true
|
||||
service:
|
||||
type: LoadBalancer
|
||||
loadBalancerIP: "192.168.56.200"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
8
manifests/networking/metallb/metallb-config.yaml
Normal file
8
manifests/networking/metallb/metallb-config.yaml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
apiVersion: metallb.io/v1beta1
|
||||
kind: IPAddressPool
|
||||
metadata:
|
||||
name: workshop-pool
|
||||
namespace: metallb-system
|
||||
spec:
|
||||
addresses:
|
||||
- 192.168.56.200-192.168.56.220
|
||||
0
manifests/networking/metallb/values.yaml
Normal file
0
manifests/networking/metallb/values.yaml
Normal file
Loading…
Add table
Reference in a new issue