Compare commits
No commits in common. "eff8a3075768f5664d9a275bb247fe48730397ac" and "b9f038548c64ee3634fb656047b0d5c0adf3ec12" have entirely different histories.
eff8a30757
...
b9f038548c
13 changed files with 21 additions and 219 deletions
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -49,7 +49,6 @@ 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.
|
||||||
|
|
||||||
|
|
@ -61,7 +60,6 @@ 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.
|
||||||
|
|
@ -90,7 +88,6 @@ 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.
|
||||||
|
|
@ -137,7 +134,6 @@ 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.
|
||||||
|
|
@ -175,7 +171,6 @@ 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`.
|
||||||
|
|
@ -198,7 +193,6 @@ 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.
|
||||||
|
|
@ -220,7 +214,7 @@ spec:
|
||||||
helm:
|
helm:
|
||||||
valueFiles:
|
valueFiles:
|
||||||
- $values/manifests/networking/ingress-nginx/values.yaml
|
- $values/manifests/networking/ingress-nginx/values.yaml
|
||||||
- repoURL: https://github.com/shautvast/ops-demo
|
- repoURL: JOUW_FORK_URL
|
||||||
targetRevision: HEAD
|
targetRevision: HEAD
|
||||||
ref: values
|
ref: values
|
||||||
destination:
|
destination:
|
||||||
|
|
@ -234,12 +228,11 @@ 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"
|
||||||
|
|
@ -249,7 +242,6 @@ 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)
|
||||||
|
|
@ -259,7 +251,6 @@ 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
|
||||||
|
|
@ -277,7 +268,6 @@ 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.
|
||||||
|
|
@ -304,7 +294,6 @@ 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"
|
||||||
|
|
@ -321,13 +310,12 @@ 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
|
||||||
|
|
@ -337,7 +325,6 @@ ingress:
|
||||||
```
|
```
|
||||||
|
|
||||||
> **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"
|
||||||
|
|
@ -361,15 +348,12 @@ 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
|
||||||
> - `speaker`: de MetalLB component die op nodes draait en op het netwerk "antwoordt" voor een toegewezen
|
|
||||||
> LoadBalancer-IP (in L2-modus via ARP).
|
> 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.
|
||||||
|
|
@ -381,7 +365,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 |
|
||||||
|
|
||||||
|
|
@ -392,7 +376,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` |
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: podinfo
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: podinfo
|
|
||||||
namespace: podinfo
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: podinfo
|
|
||||||
ports:
|
|
||||||
- port: 80
|
|
||||||
targetPort: 9898
|
|
||||||
name: http
|
|
||||||
|
|
@ -12,13 +12,14 @@ server:
|
||||||
- --insecure
|
- --insecure
|
||||||
|
|
||||||
# ── Exercise 03: uncomment this block after Ingress-Nginx is deployed ──────
|
# ── Exercise 03: uncomment this block after Ingress-Nginx is deployed ──────
|
||||||
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"
|
||||||
|
# ──────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
configs:
|
configs:
|
||||||
params:
|
params:
|
||||||
|
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
apiVersion: metallb.io/v1beta1
|
|
||||||
kind: L2Advertisement
|
|
||||||
metadata:
|
|
||||||
name: workshop-l2
|
|
||||||
namespace: metallb-system
|
|
||||||
spec:
|
|
||||||
ipAddressPools:
|
|
||||||
- workshop-pool
|
|
||||||
|
|
@ -1,11 +0,0 @@
|
||||||
controller:
|
|
||||||
ingressClassResource:
|
|
||||||
name: nginx
|
|
||||||
default: true
|
|
||||||
service:
|
|
||||||
type: LoadBalancer
|
|
||||||
loadBalancerIP: "192.168.56.200"
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 100m
|
|
||||||
memory: 128Mi
|
|
||||||
|
|
@ -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
|
|
||||||
Loading…
Add table
Reference in a new issue