client # echo 192.168.100.1 web.zorglub.local www.zorglub.local web.tartempion.local www.tartempion.local zorglub.local tartempion.local >> /etc/hosts noeud1 # curl localhost noeud1 # curl https://localhost noeud1 # microk8s enable ingress noeud1 # curl localhost noeud1 # curl -k https://localhost noeud1 # k create deploy zorglub --image nginx:alpine --replicas 2 --port 80 noeud1 # k create deploy tartempion --image httpd:alpine --replicas 2 --port 80 # on peut simplifier un peu plus en employant nginx pour les deux déploiements ! noeud1 # k expose deploy zorglub noeud1 # k expose deploy tartempion noeud1 # noeud1 # # for POD in $(k get po -l "app in (tartempion, zorglub)" -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}') noeud1 # for POD in $(k get po -l "app in (tartempion, zorglub)" -o custom-columns=:.metadata.name --no-headers) noeud1 # do noeud1 # k exec $POD -- sh -c "echo je suis le pod $POD > /usr/share/nginx/html/index.html" # rien n'empêche d'insérer un 2>/dev/null avant le " fermant noeud1 # k exec $POD -- sh -c "echo je suis le pod $POD > /usr/local/apache2/htdocs/index.html" noeud1 # done noeud1 # k create ingress sites-web --rule "*.zorglub.local/*=zorglub:80" --rule "*.tartempion.local/*=tartempion:80" noeud1 # k get ingress noeud1 # DIVERS ESSAIS curl (vers web.zorglub.local ou www.tartempion.local) noeud1 # k create ingress domaines --rule "zorglub.local/*=zorglub:80" --rule "tartempion.local/*=tartempion:80" noeud1 # k get ingress noeud1 # DIVERS ESSAIS curl (vers zorglub.local tartempion.local)