Microk8s: Difference between revisions

From Essential
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
==INSTALL==
==AUTOMATED INSTALL==
* Execute :
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
mkdir -p ~/old &&\
cd ~/old &&\
curl https://infocepo.com/wiki/index.php/Special:Export/Microk8s 2>/dev/null |tac |sed -r '0,/'"#"'24cc42#/d' |tac |sed -r '0,/'"#"'24cc42#/d' |sed 's/'"&"'amp;/\&/g;s/'"&"'gt;/>/g;s/'"&"'lt;/</g' >$$ &&\
bash $$ &&\
cd -
</syntaxhighlight>
==code==
<syntaxhighlight lang="bash">
#24cc42#
#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 14: Line 24:
snap alias microk8s.helm3 helm
snap alias microk8s.helm3 helm
#snap unalias
#snap unalias
#24cc42#
</syntaxhighlight>
</syntaxhighlight>



Revision as of 18:28, 11 February 2023

AUTOMATED INSTALL

  • Execute :
mkdir -p ~/old &&\
cd ~/old &&\
curl https://infocepo.com/wiki/index.php/Special:Export/Microk8s 2>/dev/null |tac |sed -r '0,/'"#"'24cc42#/d' |tac |sed -r '0,/'"#"'24cc42#/d' |sed 's/'"&"'amp;/\&/g;s/'"&"'gt;/>/g;s/'"&"'lt;/</g' >$$ &&\
bash $$ &&\
cd -

code

#24cc42#
#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 install kubectl --classic
snap alias microk8s.helm3 helm
#snap unalias
#24cc42#

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