使用nginx替换Ingress


总感觉k8s Ingress 不可控, 所以使用nginx 替换Ingress,还是比较简单的。

 

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: nginx-frontend
spec:
#  replicas: 3
  template:
    metadata:
      labels:
        app: nginx-frontend
    spec:
      nodeSelector:
        status: nginx-frontend
      containers:
      - name: nginx-frontend
        image: docker.cinyi.com:443/senyint/nginx
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-frontend
spec:
  type: NodePort
  ports:
  - port: 80
    nodePort: 32222
  selector:
    app: nginx-frontend

 

 nginx配置文件为:

#dashboard的 servic IP地址。 
upstream dashboard { ip_hash; server kubernetes
-dashboard.kube-system:80; } # imweb的 service ip地址,是服务+命名空间 upstream imweb { ip_hash; server im-web.test:80; }

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM