Linux中怎么用cat命令创建文件并写入数据
272
2022-10-21
K8S基础:服务网络service/ingress
Service:Pod的服务发现与负载均衡
1、配置现有deployment的service(cluster IP)
[root@master server]# kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
mynginx 3/3 3 3 26m
[root@master server]# kubectl expose deploy/mynginx --port=8000 --target-port=80 —type=ClusterIP
service/mynginx exposed
[root@master server]# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.233.0.1 If you see this page, the nginx web server is successfully installed and
working. Further configuration is required. For online documentation and support please refer to
nginx.org. Thank you for using nginx. If you see this page, the nginx web server is successfully installed and
working. Further configuration is required. For online documentation and support please refer to
nginx.org. Thank you for using nginx.
Commercial support is available at
nginx.com.
Commercial support is available at
nginx.com.
2、配置现有deployment的service(NodePort IP)
#删除clusterIP模式的svc
[root@master server]# kubectl delete svc mynginx
service "mynginx” deleted
#创建新的svc,Nodeport模式
[root@master server]# kubectl expose deploy/mynginx --port=8000 --target-port=80 --type=NodePort
service/mynginx exposed
[root@master server]# kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.233.0.1 If you see this page, the nginx web server is successfully installed and
working. Further configuration is required. For online documentation and support please refer to
nginx.org. Thank you for using nginx.
Commercial support is available at
nginx.com.
Ingress:service的统一网关入口
1、部署安装Ingress
#yaml部署安装Ingress [root@master server]# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.2/deploy/static/provider/cloud/deploy.yaml namespace/ingress-nginx created serviceaccount/ingress-nginx created serviceaccount/ingress-nginx-admission created role.rbac.authorization.k8s.io/ingress-nginx created role.rbac.authorization.k8s.io/ingress-nginx-admission created clusterrole.rbac.authorization.k8s.io/ingress-nginx created clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created rolebinding.rbac.authorization.k8s.io/ingress-nginx created rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created configmap/ingress-nginx-controller created service/ingress-nginx-controller created service/ingress-nginx-controller-admission created deployment.apps/ingress-nginx-controller created job.batch/ingress-nginx-admission-create created job.batch/ingress-nginx-admission-patch created ingressclass.networking.k8s.io/nginx created validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created #查看ingress创建状态 [root@master server]# kubectl get pod -A NAMESPACE NAME READY STATUS RESTARTS AGE ingress-nginx ingress-nginx-admission-create-pmgsz 0/1 ImagePullBackOff 0 76s ingress-nginx ingress-nginx-admission-patch-sz7r7 0/1 ImagePullBackOff 0 76s ingress-nginx ingress-nginx-controller-cb87575f5-8rccx 0/1 ContainerCreating 0 76s
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~