kubernetes ingress-nginx 0.15.0使用
2018-06-04 16:50
423 查看
版权声明:本博客文章为作者原创,转载请注明参考文献地址 https://blog.csdn.net/zhangoic/article/details/80569579
1 创建相关资源
# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/mandatory.yaml
此时ingress-nginx-controller还不能使用,container日志显示缺少ingress-nginx服务。
2 创建ingress-nginx服务
# kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/master/deploy/provider/baremetal/service-nodeport.yaml
3 测试
# kubectl get svc -o wide -n ingress-nginx NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR default-http-backend ClusterIP 10.104.183.167 <none> 80/TCP 1h app=default-http-backend ingress-nginx NodePort 10.108.244.205 <none> 80:32483/TCP 52m app=ingress-nginx # cat << EOF | kubectl create -f - apiVersion: apps/v1beta1 kind: Deployment metadata: name: hello-world-deployment spec: replicas: 1 template: metadata: labels: app: hello-world spec: containers: - image: "gokul93/hello-world:latest" imagePullPolicy: Always name: hello-world-container ports: - containerPort: 8080 --- apiVersion: v1 kind: Service metadata: name: hello-world-svc spec: ports: - port: 8080 protocol: TCP targetPort: 8080 selector: app: hello-world type: NodePort EOF # cat << EOF | kubectl create -f - apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: nginx.ingress.kubernetes.io/ssl-redirect: "false" creationTimestamp: 2018-08-03T02:51:13Z generation: 2 name: hello-world-ingress namespace: default resourceVersion: "3668608" selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/hello-world-ingress uid: 15b9c53b-96c8-11e8-9920-00505683568f spec: rules: - http: paths: - backend: serviceName: hello-world-svc servicePort: 8080 path: / EOF # curl k8s-node-ip:32483/hello Hello world!hello阅读更多
相关文章推荐
- [经验交流] Kubernetes Nginx Ingress 安装与使用
- Kubernetes使用Nginx Ingress暴露Dashboard
- Kubernetes的负载均衡问题(Nginx Ingress)
- kubernetes最佳实践(四) - nginx-ingress-controller
- 为什么我不使用Kubernetes的Ingress
- 为什么我不使用Kubernetes的Ingress
- kubernetes集群中使用ingress发布服务
- 为什么我不使用Kubernetes的Ingress
- Kubernetes - 配置Nginx-Ingress 作为服务发现
- 《kubernetes-1.8.0》12-addon-ingress-nginx
- 使用 NGINX 和 NGINX Plus 的 Ingress Controller 进行 Kubernetes 的负载均衡
- 使用nginx替换Ingress
- Kubernetes Nginx Ingress Controller源码分析
- 网站安全配置(Nginx)防止网站被攻击(包括使用了CDN加速之后的配置方法)
- Nginx使用uninx socket来连接fastcgi(php)
- Nginx使用技巧
- 使用 Nginx 提升网站访问速度
- 使用SSL验证和Nginx做代理搭建生产环境的Docker仓库
- 【翻译】使用nginx作为反向代理服务器,uWSGI作为应用服务器来部署flask应用
- ubuntu下使用apt方式安装、卸载nginx