Skip to content

Commit 428a112

Browse files
committed
DOC/MINOR: use dockerhub image for controller example deployment
1 parent c184a9f commit 428a112

File tree

5 files changed

+110
-8
lines changed

5 files changed

+110
-8
lines changed

.aspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,4 @@ allowed:
7575
- dereference
7676
- darwin
7777
- performant
78+
- dockerhub
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
labels:
5+
run: haproxy-unified-gateway
6+
name: haproxy-unified-gateway
7+
namespace: haproxy-unified-gateway
8+
spec:
9+
# specify the number of controller replicas
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
run: haproxy-unified-gateway
14+
template:
15+
metadata:
16+
labels:
17+
run: haproxy-unified-gateway
18+
spec:
19+
serviceAccountName: haproxy-unified-gateway
20+
containers:
21+
- name: haproxy-unified-gateway
22+
# specify the container image, tag and pull policy
23+
# image: docker.io/haproxytech/haproxy-unified-gateway:latest
24+
image: haproxytech/haproxy-unified-gateway:latest
25+
# imagePullPolicy: this is set to never for kind cluster usage
26+
# imagePullPolicy: Always for other environments
27+
imagePullPolicy: Never
28+
resources:
29+
limits:
30+
memory: 2560Mi
31+
requests:
32+
memory: 2048Mi
33+
lifecycle:
34+
preStop:
35+
exec:
36+
# Send SIGUSR1 directly to the haproxy process
37+
command: ["/bin/sh", "-c", "kill -SIGUSR1 $(cat /var/run/haproxy.pid)"]
38+
args:
39+
# specify the hugconf CRD location, all other params are in configuration file
40+
- --hugconf-crd=haproxy-unified-gateway/hugconf
41+
securityContext:
42+
runAsNonRoot: true
43+
allowPrivilegeEscalation: false
44+
runAsUser: 1000
45+
runAsGroup: 1000
46+
capabilities:
47+
drop:
48+
- ALL
49+
add:
50+
- NET_BIND_SERVICE
51+
seccompProfile:
52+
type: RuntimeDefault
53+
ports:
54+
# specify the container ports, it needs to align with gateway configuration
55+
- name: http
56+
containerPort: 31080
57+
- name: https
58+
containerPort: 31443
59+
# additional container port to specify the stats port
60+
- name: stat
61+
containerPort: 31024
62+
env:
63+
# specify the environment variables needed for logs and metrics
64+
- name: POD_NAME
65+
valueFrom:
66+
fieldRef:
67+
fieldPath: metadata.name
68+
- name: POD_NAMESPACE
69+
valueFrom:
70+
fieldRef:
71+
fieldPath: metadata.namespace
72+
- name: POD_IP
73+
valueFrom:
74+
fieldRef:
75+
fieldPath: status.podIP
76+
---
77+
apiVersion: v1
78+
kind: Service
79+
metadata:
80+
name: haproxy-unified-gateway
81+
namespace: haproxy-unified-gateway
82+
spec:
83+
selector:
84+
run: haproxy-unified-gateway
85+
type: NodePort
86+
ports:
87+
- name: http
88+
port: 31080
89+
targetPort: 31080
90+
# nodePort is needed for NodePort service type
91+
nodePort: 31080
92+
protocol: TCP
93+
- name: https
94+
port: 31443
95+
targetPort: 31443
96+
# nodePort is needed for NodePort service type
97+
nodePort: 31443
98+
protocol: TCP
99+
- name: stat
100+
port: 31024
101+
targetPort: 31024

example/deploy/hug/controller.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ spec:
2020
containers:
2121
- name: haproxy-unified-gateway
2222
# specify the container image, tag and pull policy
23-
# image: docker.io/haproxytech/haproxy-unified-gateway:latest
24-
image: haproxytech/haproxy-unified-gateway:latest
23+
image: docker.io/haproxytech/haproxy-unified-gateway:latest
24+
# image: haproxytech/haproxy-unified-gateway:latest
2525
# imagePullPolicy: this is set to never for kind cluster usage
26-
# imagePullPolicy: Always for other environments
27-
imagePullPolicy: Never
26+
imagePullPolicy: Always
27+
# imagePullPolicy: Never
2828
resources:
2929
limits:
3030
memory: 2560Mi

taskfile/k0s.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ tasks:
175175
- echo "deploying Controller ..."
176176
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/rbac.yaml
177177
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/hugconf.yaml
178-
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/controller.yaml
178+
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug-dev/controller.yaml
179179
- task: delimiter
180180
- echo "deploying echo service ..."
181181
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/echo/echo.yaml
@@ -202,7 +202,7 @@ tasks:
202202
- task: delimiter
203203
- echo "deploying Controller ..."
204204
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/rbac.yaml
205-
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/controller.yaml
205+
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug-dev/controller.yaml
206206
- task: delimiter
207207
- /{{.kubectl}} delete pods -l run=haproxy-unified-gateway -n haproxy-unified-gateway
208208
- /{{.kubectl}} wait --for=condition=ready --timeout=10s pod -l run=haproxy-unified-gateway -n haproxy-unified-gateway

taskfile/kind.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ tasks:
128128
- echo "deploying Controller ..."
129129
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/rbac.yaml
130130
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/hugconf.yaml
131-
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/controller.yaml
131+
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug-dev/controller.yaml
132132
- task: delimiter
133133
- echo "deploying echo service ..."
134134
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/echo/echo.yaml
@@ -154,7 +154,7 @@ tasks:
154154
- task: delimiter
155155
- echo "deploying Controller ..."
156156
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/rbac.yaml
157-
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug/controller.yaml
157+
- /{{.kubectl}} apply -f {{.CONFIG_DIR}}/hug-dev/controller.yaml
158158
- task: delimiter
159159
- /{{.kubectl}} delete pods -l run=haproxy-unified-gateway -n haproxy-unified-gateway
160160
- /{{.kubectl}} wait --for=condition=ready --timeout=10s pod -l run=haproxy-unified-gateway -n haproxy-unified-gateway

0 commit comments

Comments
 (0)