forked from HariSekhon/Kubernetes-configs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathechoserver.yaml
98 lines (95 loc) · 2.08 KB
/
echoserver.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#
# Author: Hari Sekhon
# Date: 2023-04-07 22:43:51 +0100 (Fri, 07 Apr 2023)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# For testing Ingress Controllers such as Kong or HAProxy
# Based on:
#
# https://raw.githubusercontent.com/SIMPLrU/interactive/master/konglabs/kong-ingress-controller/manifests/echo-service.yml
#
# Apply also:
#
# kong-ingress-echoserver.yaml
# ingress-nginx-echoserver.yaml
# haproxy-ingress-echoserver.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: echo
labels:
goldilocks.fairwinds.com/enabled: "true"
---
apiVersion: v1
kind: Service
metadata:
labels:
app: echo
name: echo
namespace: echo
spec:
ports:
- port: 8080
name: high
protocol: TCP
targetPort: 8080
- port: 80
name: low
protocol: TCP
targetPort: 8080
selector:
app: echo
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: echo
name: echo
namespace: echo
spec:
replicas: 2
selector:
matchLabels:
app: echo
strategy: {}
template:
metadata:
creationTimestamp: null
labels:
app: echo
spec:
containers:
- image: gcr.io/kubernetes-e2e-test-images/echoserver:2.2
name: echo
ports:
- containerPort: 8080
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
resources: {}