Microk8s: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 8: | Line 8: | ||
#watch microk8s status | #watch microk8s status | ||
microk8s enable helm3 dns community hostpath-storage ingress | microk8s enable helm3 dns community hostpath-storage ingress | ||
#microk8s disable metallb | |||
microk8s enable metallb:${dhcpList} | |||
snap alias microk8s.kubectl kubectl | snap alias microk8s.kubectl kubectl | ||
snap alias microk8s.helm3 helm | snap alias microk8s.helm3 helm | ||
#snap unalias | #snap unalias | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 17:30, 19 January 2023
INSTALL
#https://kubernetes.io/blog/2019/11/26/running-kubernetes-locally-on-linux-with-microk8s/
dhcpList=192.168.1.21-192.168.1.29
snap install microk8s --classic
#microk8s.start
#watch microk8s status
microk8s enable helm3 dns community hostpath-storage ingress
#microk8s disable metallb
microk8s enable metallb:${dhcpList}
snap alias microk8s.kubectl kubectl
snap alias microk8s.helm3 helm
#snap unalias
FIRST APP
kubectl create namespace sandbox
kubectl config set-context --current --namespace=sandbox
#kubectl delete deployment sandbox
kubectl create deployment sandbox --image=registry.k8s.io/e2e-test-images/agnhost:2.39 -- /agnhost netexec --http-port=8080
#kubectl delete svc sandbox
kubectl expose deployment sandbox --type=LoadBalancer --port=8080
kubectl delete ingress sandbox
cat <<EOF |kubectl apply -f -
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sandbox
spec:
rules:
- host: "sandbox.c1.mi.infocepo.com"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: sandbox
port:
number: 8080
EOF