2016-02-08 20:57:32 +00:00
|
|
|
# 3 Services for the 3 endpoints of the Ingress
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2016-04-20 11:26:51 +00:00
|
|
|
name: service1
|
2016-02-08 20:57:32 +00:00
|
|
|
labels:
|
|
|
|
app: whoami
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
|
|
|
- port: 80
|
2016-04-20 11:26:51 +00:00
|
|
|
nodePort: 30283
|
2016-02-08 20:57:32 +00:00
|
|
|
targetPort: 80
|
|
|
|
protocol: TCP
|
2016-04-26 20:26:25 +00:00
|
|
|
name: https
|
2016-02-08 20:57:32 +00:00
|
|
|
selector:
|
|
|
|
app: whoami
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2016-04-20 11:26:51 +00:00
|
|
|
name: service2
|
2016-02-08 20:57:32 +00:00
|
|
|
labels:
|
|
|
|
app: whoami
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
|
|
|
- port: 80
|
2016-04-20 11:26:51 +00:00
|
|
|
nodePort: 30284
|
2016-02-08 20:57:32 +00:00
|
|
|
targetPort: 80
|
|
|
|
protocol: TCP
|
|
|
|
name: http
|
|
|
|
selector:
|
|
|
|
app: whoami
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
2016-04-20 11:26:51 +00:00
|
|
|
name: service3
|
2016-02-08 20:57:32 +00:00
|
|
|
labels:
|
|
|
|
app: whoami
|
|
|
|
spec:
|
|
|
|
type: NodePort
|
|
|
|
ports:
|
|
|
|
- port: 80
|
2016-04-20 11:26:51 +00:00
|
|
|
nodePort: 30285
|
2016-02-08 20:57:32 +00:00
|
|
|
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:
|
2016-04-25 14:56:06 +00:00
|
|
|
name: whoami-ingress
|
2016-02-08 20:57:32 +00:00
|
|
|
spec:
|
|
|
|
rules:
|
|
|
|
- host: foo.localhost
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- path: /bar
|
|
|
|
backend:
|
2016-04-20 11:26:51 +00:00
|
|
|
serviceName: service1
|
2016-02-08 20:57:32 +00:00
|
|
|
servicePort: 80
|
|
|
|
- host: bar.localhost
|
|
|
|
http:
|
|
|
|
paths:
|
|
|
|
- backend:
|
2016-04-20 11:26:51 +00:00
|
|
|
serviceName: service2
|
2016-02-08 20:57:32 +00:00
|
|
|
servicePort: 80
|
|
|
|
- backend:
|
2016-04-20 11:26:51 +00:00
|
|
|
serviceName: service3
|
2016-02-08 20:57:32 +00:00
|
|
|
servicePort: 80
|