k8s apps - kind node
get kind
> curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
> chmod +x ./kind
> mv ./kind /usr/local/bin/kind
create multi node cluster
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
# control plane 1
- role: control-plane
kubeadmConfigPatches:
- |
kind: InitConfiguration
nodeRegistration:
kubeletExtraArgs:
node-labels: "ingress-ready=true"
system-reserved: memory=4Gi
extraPortMappings:
# - containerPort: 80
# hostPort: 80
# protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
# worker 1
- role: worker
kubeadmConfigPatches:
- |
kind: JoinConfiguration
nodeRegistration:
kubeletExtraArgs:
system-reserved: memory=8Gi
# worker 2
# - role: worker
# kubeadmConfigPatches:
# - |
# kind: JoinConfiguration
# nodeRegistration:
# kubeletExtraArgs:
# system-reserved: memory=8Gi
> kind create cluster --config cluster.yaml
> kind get clusters
> kubectl apply -f \
https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
> kubectl wait --namespace ingress-nginx \
--for=condition=ready pod \
--selector=app.kubernetes.io/component=controller \
--timeout=90s
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: simple-fanout-example
spec:
rules:
- host: foo.bar
http:
paths:
- backend:
service:
name: my-searx
port:
number: 80
path: /
pathType: Prefix
- host: foo1.bar
http:
paths:
- backend:
service:
name: my-octoprint
port:
number: 80
path: /
pathType: Prefix
- host: foo2.bar
http:
paths:
- backend:
service:
name: my-icinga2
port:
number: 80
path: /
pathType: Prefix
> kubectl create --filename ingress.yaml
15-09-2021