Microk8s: Difference between revisions
Jump to navigation
Jump to search
(Created page with " == kubernetes == #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...") |
No edit summary |
||
Line 1: | Line 1: | ||
==INSTALL== | |||
== | <syntaxhighlight lang="bash"> | ||
#https://kubernetes.io/blog/2019/11/26/running-kubernetes-locally-on-linux-with-microk8s/ | #https://kubernetes.io/blog/2019/11/26/running-kubernetes-locally-on-linux-with-microk8s/ | ||
dhcpList=192.168.1.21-192.168.1.29 | dhcpList=192.168.1.21-192.168.1.29 | ||
Line 13: | Line 13: | ||
#microk8s disable metallb | #microk8s disable metallb | ||
microk8s enable metallb:${dhcpList} | microk8s enable metallb:${dhcpList} | ||
</syntaxhighlight> | |||
==FIRST APP== | |||
<syntaxhighlight lang="bash"> | |||
kubectl create namespace sandbox | kubectl create namespace sandbox | ||
kubectl config set-context --current --namespace=sandbox | kubectl config set-context --current --namespace=sandbox | ||
#kubectl delete deployment sandbox | #kubectl delete deployment sandbox |
Revision as of 17:29, 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
snap alias microk8s.kubectl kubectl
snap alias microk8s.helm3 helm
#snap unalias
#microk8s disable metallb
microk8s enable metallb:${dhcpList}
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