美文网首页
Docker Desktop for Windows 中 Kub

Docker Desktop for Windows 中 Kub

作者: 蝗虫的小腿儿 | 来源:发表于2019-01-29 11:47 被阅读14次

    参考:https://kubernetes.github.io/ingress-nginx/deploy/

    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
    
    kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/cloud-generic.yaml
    
    

    确认启动

    kubectl -n ingress-nginx get pods
    
    运行中

    接下来就可以添加配置暴露service。
    记得将host中配置的域名添加到本机的hosts文件中。

    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
      name: test-ingress
      namespace: test
      annotations:
        nginx.ingress.kubernetes.io/proxy-connect-timeout: 30s
        nginx.ingress.kubernetes.io/proxy-send-timeout: 20s
        nginx.ingress.kubernetes.io/proxy-read-timeout: 20s
        nginx.ingress.kubernetes.io/proxy-body-size: 50m
        nginx.ingress.kubernetes.io/proxy-buffer-size: "16k"
    spec:
      rules:
      - host: test.abc.com
        http:
          paths:
          - path: /
            backend:
              serviceName: tomcat
              servicePort: 8080
    

    相关文章

      网友评论

          本文标题:Docker Desktop for Windows 中 Kub

          本文链接:https://www.haomeiwen.com/subject/bvxxsqtx.html