码迷,mamicode.com
首页 > 其他好文 > 详细

k8s1.8 ingress 配置

时间:2017-10-31 20:14:38      阅读:194      评论:0      收藏:0      [点我收藏+]

标签:secret   vim   beta   data   cert   extension   create   key   color   



kubectl create secret tls ingress-secret-fengjian --key /data/sslkey/cinyi.key --cert /data/sslkey/cinyi.pem
[root@k8s1 ingress]# vim ingress.yaml 

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-default
spec:
  rules:
  - host: nginx.cinyi.com
    http:
      paths:
      - backend:
          serviceName: nginx-default
          servicePort: 80

[root@k8s1 ingress]# vim ingress_443.yaml 

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-default-443
  namespace: default
spec:
  tls:
  - hosts:
    - nginx.cinyi.com
    secretName: ingress-secret
  rules:
  - host: nginx.cinyi.com
    http:
      paths:
      - backend:
          serviceName: nginx-default
          servicePort: 80



kubectl create secret tls ingress-secret-fengjian --key /data/sslkey/cinyi.key --cert /data/sslkey/cinyi.pem  --namespace=fengjian

[root@k8s1 ingress]# vim ingress-fengjian.yaml 

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-fengjian-80
  namespace: fengjian
spec:
  rules:
  - host: feng.cinyi.com
    http:
      paths:
      - backend:
          serviceName: my-nginx-fengjian
          servicePort: 80

[root@k8s1 ingress]# vim ingress-fengjian-443.yaml 

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: nginx-fengjian-443
  namespace: fengjian
spec:
  tls:
  - hosts:
    - feng.cinyi.com
    secretName: ingress-secret-fengjian
  rules:
  - host: feng.cinyi.com
    http:
      paths:
      - backend:
          serviceName: my-nginx-fengjian
          servicePort: 80

技术分享

 

技术分享

 

 

k8s1.8 ingress 配置

标签:secret   vim   beta   data   cert   extension   create   key   color   

原文地址:http://www.cnblogs.com/fengjian2016/p/7762999.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!