-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcontroller.yaml
More file actions
97 lines (97 loc) · 2.93 KB
/
controller.yaml
File metadata and controls
97 lines (97 loc) · 2.93 KB
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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: haproxy-unified-gateway
name: haproxy-unified-gateway
namespace: haproxy-unified-gateway
spec:
# specify the number of controller replicas
replicas: 1
selector:
matchLabels:
run: haproxy-unified-gateway
template:
metadata:
labels:
run: haproxy-unified-gateway
spec:
serviceAccountName: haproxy-unified-gateway
containers:
- name: haproxy-unified-gateway
# specify the container image, tag and pull policy
image: docker.io/haproxytech/haproxy-unified-gateway:latest
# image: haproxytech/haproxy-unified-gateway:latest
# imagePullPolicy: this is set to never for kind cluster usage
imagePullPolicy: Always
# imagePullPolicy: IfNotPresent
args:
# specify the hugconf CRD location, all other params are in configuration file
- --hugconf-crd=haproxy-unified-gateway/hugconf
# metrics auth: none (default), kube-rbac, or basic
# - --metrics-auth=kube-rbac
# - --metrics-auth=basic
# - --metrics-basic-auth-user=prometheus
# - --metrics-basic-auth-password=changeme
resources:
limits:
memory: 2560Mi
requests:
memory: 2048Mi
securityContext:
runAsNonRoot: true
allowPrivilegeEscalation: false
runAsUser: 1000
runAsGroup: 1000
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
seccompProfile:
type: RuntimeDefault
ports:
# specify the container ports, it needs to align with gateway configuration
- name: http
containerPort: 31080
- name: https
containerPort: 31443
# additional container port to specify the stats port
- name: stat
containerPort: 31024
# prometheus metrics port
- name: metrics
containerPort: 31060
env:
# specify the environment variables needed for logs and metrics
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
---
apiVersion: v1
kind: Service
metadata:
name: haproxy-unified-gateway
namespace: haproxy-unified-gateway
labels:
app.kubernetes.io/name: haproxy-unified-gateway
spec:
selector:
run: haproxy-unified-gateway
type: LoadBalancer
ports:
- name: stat
port: 31024
targetPort: 31024
- name: metrics
port: 31060
targetPort: 31060