20201215 kubernetes (三)
課堂資訊
Proxy Server
Proxy
正向代理伺服器
客戶端
反向代理伺服器
服務器
Ingress

課堂練習
Ingress
Last updated
Was this helpful?
Proxy Server
Proxy
正向代理伺服器
客戶端
反向代理伺服器
服務器

Last updated
Was this helpful?
Was this helpful?
cd test-ingress-nginxkubectl apply -f mandatory.yamlkubectl apply -f service-nodeport.yamllsgedit service-nodeport.yaml mandatory.yaml &kubectl get deploymentkubectl get deployment -n ingress-nginxkubectl get svc -n ingress-nginxkubectl get pods -n ingress-nginxkubectl get deploymentkubectl delete deployment mywebkubectl delete svc mywebkubectl get svckubectl apply -f httpd.yamlgedit httpd.yamlkubectl get deploymentkubectl get svcgedit ingress-httpd.yamlcurl [httpd_CLUSTER-IP]kubectl apply -f ingress-httpd.yamlkubectl get ingresskubectl get svckubectl get pod -n ingress-nginxkubectl get pod -n ingress-nginx -o wide192.168.8.130 www.a.com
192.168.8.131 www.a.comkubectl get podkubectl get pod -o widekubectl exec [vm3_httpdName] -it -- bashcd htdocs/echo "vm3 www.a.com" > hi.htmlsexitkubectl exec [vm2_httpdName] -it -- bashcd htdocs/echo "vm2 www.a.com" > hi.htmlsexitcp httpd.yaml httpd2.yamlcp ingress-httpd.yaml ingress-httpd2.yamlgedit httpd2.yaml ingress-httpd2.yamlkubectl apply -f httpd2.yamlkubectl apply -f ingress-httpd2.yamlkubectl get ingresskubectl get podkubectl exec [http2_Name] -it -- bashcd htdocs/echo "www.b.com" > hi.htmkubectl get deploymentkubectl describe deployment httpdkubectl get replicasetkubectl get deployment httpd2kubectl edit deployment httpd2cdlskubectl apply -f cronjob.ymlkubectl get podcat cronjob.ymlkubectl get pod -o wide