Skip to content

Commit 0342f51

Browse files
authoredNov 30, 2024··
Merge pull request #6 from fabiante/feat/prebuild-installer
Add Quick Start instructions to run latest podbouncer build
2 parents 808a382 + d551aa3 commit 0342f51

File tree

2 files changed

+274
-1
lines changed

2 files changed

+274
-1
lines changed
 

‎README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ data:
2727
maxPodAge: "1h"
2828
```
2929
30-
## Getting Started
30+
## Quick Start
31+
32+
If you simply want to run podbouncer on your cluster, you can use the command below:
33+
34+
**Warning:** With this command you will run a potentially destructive controller in your cluster.
35+
36+
_Note:_ This installs podbouncer in the `podbouncer-system` namespace.
37+
38+
```shell
39+
kubectl apply -f https://raw.githubusercontent.com/fabiante/podbouncer/refs/heads/main/dist/install.yaml
40+
```
41+
42+
## Getting Started (Local Build + Deploy)
3143

3244
### Prerequisites
3345
- go version v1.22.0+

‎dist/install.yaml

+261
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
labels:
5+
app.kubernetes.io/managed-by: kustomize
6+
app.kubernetes.io/name: podbouncer
7+
control-plane: controller-manager
8+
name: podbouncer-system
9+
---
10+
apiVersion: v1
11+
kind: ServiceAccount
12+
metadata:
13+
labels:
14+
app.kubernetes.io/managed-by: kustomize
15+
app.kubernetes.io/name: podbouncer
16+
name: podbouncer-controller-manager
17+
namespace: podbouncer-system
18+
---
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
kind: Role
21+
metadata:
22+
labels:
23+
app.kubernetes.io/managed-by: kustomize
24+
app.kubernetes.io/name: podbouncer
25+
name: podbouncer-leader-election-role
26+
namespace: podbouncer-system
27+
rules:
28+
- apiGroups:
29+
- ""
30+
resources:
31+
- configmaps
32+
verbs:
33+
- get
34+
- list
35+
- watch
36+
- create
37+
- update
38+
- patch
39+
- delete
40+
- apiGroups:
41+
- coordination.k8s.io
42+
resources:
43+
- leases
44+
verbs:
45+
- get
46+
- list
47+
- watch
48+
- create
49+
- update
50+
- patch
51+
- delete
52+
- apiGroups:
53+
- ""
54+
resources:
55+
- events
56+
verbs:
57+
- create
58+
- patch
59+
---
60+
apiVersion: rbac.authorization.k8s.io/v1
61+
kind: ClusterRole
62+
metadata:
63+
name: podbouncer-manager-role
64+
rules:
65+
- apiGroups:
66+
- ""
67+
resources:
68+
- configmaps
69+
verbs:
70+
- get
71+
- list
72+
- watch
73+
- apiGroups:
74+
- ""
75+
resources:
76+
- configmaps/status
77+
verbs:
78+
- get
79+
- apiGroups:
80+
- ""
81+
resources:
82+
- pods
83+
verbs:
84+
- create
85+
- delete
86+
- get
87+
- list
88+
- patch
89+
- update
90+
- watch
91+
- apiGroups:
92+
- ""
93+
resources:
94+
- pods/status
95+
verbs:
96+
- get
97+
- patch
98+
- update
99+
---
100+
apiVersion: rbac.authorization.k8s.io/v1
101+
kind: ClusterRole
102+
metadata:
103+
name: podbouncer-metrics-auth-role
104+
rules:
105+
- apiGroups:
106+
- authentication.k8s.io
107+
resources:
108+
- tokenreviews
109+
verbs:
110+
- create
111+
- apiGroups:
112+
- authorization.k8s.io
113+
resources:
114+
- subjectaccessreviews
115+
verbs:
116+
- create
117+
---
118+
apiVersion: rbac.authorization.k8s.io/v1
119+
kind: ClusterRole
120+
metadata:
121+
name: podbouncer-metrics-reader
122+
rules:
123+
- nonResourceURLs:
124+
- /metrics
125+
verbs:
126+
- get
127+
---
128+
apiVersion: rbac.authorization.k8s.io/v1
129+
kind: RoleBinding
130+
metadata:
131+
labels:
132+
app.kubernetes.io/managed-by: kustomize
133+
app.kubernetes.io/name: podbouncer
134+
name: podbouncer-leader-election-rolebinding
135+
namespace: podbouncer-system
136+
roleRef:
137+
apiGroup: rbac.authorization.k8s.io
138+
kind: Role
139+
name: podbouncer-leader-election-role
140+
subjects:
141+
- kind: ServiceAccount
142+
name: podbouncer-controller-manager
143+
namespace: podbouncer-system
144+
---
145+
apiVersion: rbac.authorization.k8s.io/v1
146+
kind: ClusterRoleBinding
147+
metadata:
148+
labels:
149+
app.kubernetes.io/managed-by: kustomize
150+
app.kubernetes.io/name: podbouncer
151+
name: podbouncer-manager-rolebinding
152+
roleRef:
153+
apiGroup: rbac.authorization.k8s.io
154+
kind: ClusterRole
155+
name: podbouncer-manager-role
156+
subjects:
157+
- kind: ServiceAccount
158+
name: podbouncer-controller-manager
159+
namespace: podbouncer-system
160+
---
161+
apiVersion: rbac.authorization.k8s.io/v1
162+
kind: ClusterRoleBinding
163+
metadata:
164+
name: podbouncer-metrics-auth-rolebinding
165+
roleRef:
166+
apiGroup: rbac.authorization.k8s.io
167+
kind: ClusterRole
168+
name: podbouncer-metrics-auth-role
169+
subjects:
170+
- kind: ServiceAccount
171+
name: podbouncer-controller-manager
172+
namespace: podbouncer-system
173+
---
174+
apiVersion: v1
175+
data:
176+
maxPodAge: 1h
177+
kind: ConfigMap
178+
metadata:
179+
labels:
180+
app.kubernetes.io/managed-by: kustomize
181+
app.kubernetes.io/name: podbouncer
182+
control-plane: controller-manager
183+
name: podbouncer-config
184+
namespace: podbouncer-system
185+
---
186+
apiVersion: v1
187+
kind: Service
188+
metadata:
189+
labels:
190+
app.kubernetes.io/managed-by: kustomize
191+
app.kubernetes.io/name: podbouncer
192+
control-plane: controller-manager
193+
name: podbouncer-controller-manager-metrics-service
194+
namespace: podbouncer-system
195+
spec:
196+
ports:
197+
- name: https
198+
port: 8443
199+
protocol: TCP
200+
targetPort: 8443
201+
selector:
202+
control-plane: controller-manager
203+
---
204+
apiVersion: apps/v1
205+
kind: Deployment
206+
metadata:
207+
labels:
208+
app.kubernetes.io/managed-by: kustomize
209+
app.kubernetes.io/name: podbouncer
210+
control-plane: controller-manager
211+
name: podbouncer-controller-manager
212+
namespace: podbouncer-system
213+
spec:
214+
replicas: 1
215+
selector:
216+
matchLabels:
217+
control-plane: controller-manager
218+
template:
219+
metadata:
220+
annotations:
221+
kubectl.kubernetes.io/default-container: manager
222+
labels:
223+
control-plane: controller-manager
224+
spec:
225+
containers:
226+
- args:
227+
- --metrics-bind-address=:8443
228+
- --leader-elect
229+
- --health-probe-bind-address=:8081
230+
command:
231+
- /manager
232+
image: fabiante/podbouncer:latest
233+
livenessProbe:
234+
httpGet:
235+
path: /healthz
236+
port: 8081
237+
initialDelaySeconds: 15
238+
periodSeconds: 20
239+
name: manager
240+
readinessProbe:
241+
httpGet:
242+
path: /readyz
243+
port: 8081
244+
initialDelaySeconds: 5
245+
periodSeconds: 10
246+
resources:
247+
limits:
248+
cpu: 500m
249+
memory: 128Mi
250+
requests:
251+
cpu: 10m
252+
memory: 64Mi
253+
securityContext:
254+
allowPrivilegeEscalation: false
255+
capabilities:
256+
drop:
257+
- ALL
258+
securityContext:
259+
runAsNonRoot: true
260+
serviceAccountName: podbouncer-controller-manager
261+
terminationGracePeriodSeconds: 10

0 commit comments

Comments
 (0)
Please sign in to comment.