Code Monkey home page Code Monkey logo

k8s-hello-world's Introduction

k8s

环境准备

# 装配k8s配置文件
kubectl kustomize . > k8s.yaml

# 部署
kubectl apply -f k8s.yaml --namespace=demo-test

打开项目网关

在kubesphere管理界面,打开项目网关,获得http端口号,如 31665 的云主机的安全组中,把31665端口放开

http://:31665/

当前需要解决的问题

web browser(210.129.19.178) ----> [ ingress(10.233.107.21) --path route--> nginx --upstream--> hello-world-app ]

Ingress把请求转发给nginx时,并没有把客户端的ip(210.129.19.178)传递给后端的nginx,而是把自己的容器ip(10.233.107.21)传递给了nginx

页面展示

x-forwarded-for: ["127.0.0.6, 10.233.107.21"]

x-real-ip: ["10.233.107.21"]

期待展示的是

x-forwarded-for: ["127.0.0.6, 10.233.107.21, 210.129.19.178"]

x-real-ip: ["210.129.19.178"]

这个配置不知道该如何调整,才能正确的把客户端ip传递下去

k8s-hello-world's People

Contributors

edwardzhou avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.