1
0
Fork 0

Add kubernetes Ingress backend

Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
emile 2016-02-08 21:57:32 +01:00 committed by Emile Vauge
parent 6f47434833
commit 720912e880
No known key found for this signature in database
GPG key ID: D808B4C167352E59
18 changed files with 1191 additions and 201 deletions

93
examples/k8s.ingress.yaml Normal file
View file

@ -0,0 +1,93 @@
# 3 Services for the 3 endpoints of the Ingress
apiVersion: v1
kind: Service
metadata:
name: whoami-x
labels:
app: whoami
spec:
type: NodePort
ports:
- port: 80
nodePort: 30301
targetPort: 80
protocol: TCP
name: http
selector:
app: whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoami-default
labels:
app: whoami
spec:
type: NodePort
ports:
- port: 80
nodePort: 30302
targetPort: 80
protocol: TCP
name: http
selector:
app: whoami
---
apiVersion: v1
kind: Service
metadata:
name: whoami-y
labels:
app: whoami
spec:
type: NodePort
ports:
- port: 80
nodePort: 30284
targetPort: 80
protocol: TCP
name: http
selector:
app: whoami
---
# A single RC matching all Services
apiVersion: v1
kind: ReplicationController
metadata:
name: whoami
spec:
replicas: 1
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: emilevauge/whoami
ports:
- containerPort: 80
---
# An Ingress with 2 hosts and 3 endpoints
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: whoamimap
spec:
rules:
- host: foo.localhost
http:
paths:
- path: /bar
backend:
serviceName: whoami-x
servicePort: 80
- host: bar.localhost
http:
paths:
- backend:
serviceName: whoami-y
servicePort: 80
- backend:
serviceName: whoami-x
servicePort: 80