git mv Ingress ingress

This commit is contained in:
Prashanth Balasubramanian 2016-02-21 16:13:08 -08:00
parent 34b949c134
commit 3da4e74e5a
2185 changed files with 754743 additions and 0 deletions

18
echoheaders/Dockerfile Normal file
View file

@ -0,0 +1,18 @@
# Copyright 2015 The Kubernetes Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM gcr.io/google_containers/nginx-slim:0.3
MAINTAINER Prashanth B <beeps@google.com>
ADD nginx.conf /etc/nginx/nginx.conf
ADD README.md README.md

11
echoheaders/Makefile Normal file
View file

@ -0,0 +1,11 @@
all: push
# TAG 0.0 shouldn't clobber any release builds
TAG = 1.2
PREFIX = gcr.io/google_containers/echoserver
container:
docker build -t $(PREFIX):$(TAG) .
push: container
gcloud docker push $(PREFIX):$(TAG)

3
echoheaders/README.md Normal file
View file

@ -0,0 +1,3 @@
# Echoserver
This is a simple python http server that responds with the http headers it received, runs on port 8080.

32
echoheaders/echo-app.yaml Normal file
View file

@ -0,0 +1,32 @@
apiVersion: v1
kind: Service
metadata:
name: echoheaders
labels:
app: echoheaders
spec:
type: NodePort
ports:
- port: 80
targetPort: 8080
protocol: TCP
name: http
selector:
app: echoheaders
---
apiVersion: v1
kind: ReplicationController
metadata:
name: echoheaders
spec:
replicas: 1
template:
metadata:
labels:
app: echoheaders
spec:
containers:
- name: echoheaders
image: gcr.io/google_containers/echoserver:1.2
ports:
- containerPort: 8080

51
echoheaders/nginx.conf Normal file
View file

@ -0,0 +1,51 @@
events {
worker_connections 1024;
}
http {
default_type 'text/plain';
# maximum allowed size of the client request body. By default this is 1m.
# Request with bigger bodies nginx will return error code 413.
# http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
client_max_body_size 10m;
server {
# please check the benefits of reuseport https://www.nginx.com/blog/socket-sharding-nginx-release-1-9-1
# basically instructs to create an individual listening socket for each worker process (using the SO_REUSEPORT
# socket option), allowing a kernel to distribute incoming connections between worker processes.
listen 8080 default_server reuseport;
location / {
lua_need_request_body on;
content_by_lua_block {
ngx.say("CLIENT VALUES:")
ngx.say("client_address=", ngx.var.remote_addr)
ngx.say("command=", ngx.req.get_method())
ngx.say("real path=", ngx.var.request_uri)
ngx.say("query=", ngx.var.query_string)
ngx.say("request_version=", ngx.req.http_version())
ngx.say("request_uri=", ngx.var.scheme.."://"..ngx.var.host..":"..ngx.var.server_port..ngx.var.request_uri)
ngx.say("")
ngx.say("SERVER VALUES:")
ngx.say("server_version=", "nginx: "..ngx.var.nginx_version.." - lua: "..ngx.config.ngx_lua_version)
ngx.say("")
ngx.say("HEADERS RECEIVED:")
local headers = ngx.req.get_headers()
local keys = {}
for key, val in pairs(headers) do
table.insert(keys, key)
end
table.sort(keys)
for i, key in ipairs(keys) do
ngx.say(key, "=", headers[key])
end
ngx.say("BODY:")
ngx.print(ngx.var.request_body or "-no body in request-")
}
}
}
}