-
Notifications
You must be signed in to change notification settings - Fork 0
/
httpbin_service.yml
32 lines (32 loc) · 1.13 KB
/
httpbin_service.yml
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
# SERVICE DEFINITION
# ===
# Services exposes our pods so we can access them from outside the cluster
# (no tunneling or network dark magic skills required).
---
apiVersion: v1
kind: Service
metadata:
# mind -load-balancer, we'll use this name for the ingress definition later.
name: httpbin-load-balancer
# notice here, we want to use the same "universe" defined in httpbin.yml
namespace: httpbin-ns
# We'll use this later for filtering resources
labels:
target: httpbin
# This is the actual definition of the service
spec:
# service type load balancer is used with cloud providers to get an
# ip/hostname to access the pods. The ingress (later defined) will
# link to this.
type: LoadBalancer
ports:
- name: http
protocol: TCP
port: 8100 # this is the port we want to expose for the service
# funny enough THIS PORT can't be repeated, I learned it afterwards.
# so you have to use unique ports here (at least in my single-node k3s
# server).
targetPort: 80 # this is the port exposed in the pods.
# Mind here, httpbin-app is the name defined in httpbin_deployment.yml
selector:
app: httpbin-app