Kubernetes学习(七)

2021-09-07 11:12

阅读:826

标签:解析   content   机器   pre   static   cas   strong   ati   VID   七 Ingress 一、资料信息 Ingress-Nginx github 地址:https://github.com/kubernetes/ingress-nginx Ingress-Nginx 官方网站:https://kubernetes.github.io/ingress-nginx/ 进入官方下载 wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml       二、部署 Ingress-Nginx https://raw.githubusercontent.com/kubernetes/ingress-nginx/nginx-0.28.0/deploy/static/provider/baremetal/service-nodeport.yamlhttps://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/static/mandatory.yaml kubectl apply -f mandatory.yaml kubectl apply -f service-nodeport.yaml Ingress HTTP 代理访问 deployment、Service、Ingress Yaml 文件 apiVersion: extensions/v1beta1   kind: Deployment metadata: name: nginx-dm spec:   replicas: 2 template:  metadata: labels:  name: nginx  spec:  containers:  - name: nginx  image: wangyanglinux/myapp:v1  imagePullPolicy: IfNotPresent  ports:  - containerPort: 80     apiVersion: v1 kind: Service metadata:  name: nginx-svc spec:  ports:  - port: 80  targetPort: 80  protocol: TCP  selector:  name: nginx     apiVersion: extensions/v1beta1 kind: Ingress metadata:    name: nginx-test spec:  rules: - host: www1.atguigu.com  http: paths:  - path: / backend:  serviceName: nginx-svc  servicePort: 80 过程如下 1.执行mandatory.yaml2.执行service-nodeport.yaml3.执行deploymentdeployment.yaml4.执行ingressingress.http.yaml master机器解析IP后可以通过 curl 访问但是本机解析后通过浏览器访问大部分都是失败的,原因未知  Kubernetes学习(七)标签:解析   content   机器   pre   static   cas   strong   ati   VID   原文地址:https://www.cnblogs.com/lovedairan/p/12287709.html


评论


亲,登录后才可以留言!