七 Ingress 一、 资料信息 Ingress-Nginx github地址:https://github.com
七 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
https://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.yaml
2.执行
service-nodeport.yaml
3.执行deployment
deployment.yaml
4.执行ingress
ingress.http.yaml
master机器解析IP后可以通过 curl 访谒但是本机解析后通过浏览器访谒大部分都是掉败的,,原因未知
Kubernetes学习(七)
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/29922.html