Skip to content

Commit e5a3ae6

Browse files
authored
Merge pull request #38 from bunkerity/dev
Dev
2 parents 0799d8d + 1c69c06 commit e5a3ae6

23 files changed

+3152
-1241
lines changed

charts/bunkerweb/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.0.3
18+
version: 1.0.6
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.6.4"
24+
appVersion: "1.6.5"

charts/bunkerweb/templates/_helpers.tpl

Lines changed: 686 additions & 0 deletions
Large diffs are not rendered by default.

charts/bunkerweb/templates/bunkerweb-daemonset.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,10 @@ spec:
5353
{{- if .Values.bunkerweb.hostPorts }}
5454
hostPort: 443
5555
{{- end }}
56+
{{- if and .Values.bunkerweb.usePrometheusExporter }}
5657
- containerPort: 9113
5758
name: metrics
59+
{{- end }}
5860
env:
5961
# Mandatory for k8s integration
6062
- name: KUBERNETES_MODE
@@ -76,6 +78,10 @@ spec:
7678
readinessProbe:
7779
{{- toYaml . | nindent 12}}
7880
{{- end }}
81+
{{- with .Values.bunkerweb.volumeMounts }}
82+
volumeMounts:
83+
{{- toYaml . | nindent 12 }}
84+
{{- end }}
7985
{{- if .Values.bunkerweb.nodeSelector }}
8086
{{- with .Values.bunkerweb.nodeSelector }}
8187
nodeSelector:
@@ -107,4 +113,8 @@ spec:
107113
topologySpreadConstraints:
108114
{{- toYaml . | nindent 8 }}
109115
{{- end }}
116+
{{- with .Values.bunkerweb.volumes }}
117+
volumes:
118+
{{- toYaml . | nindent 8 }}
119+
{{- end }}
110120
{{- end }}

charts/bunkerweb/templates/bunkerweb-deployment.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
selector:
1212
matchLabels:
1313
{{- include "bunkerweb.selectorLabels" . | nindent 6 }}
14+
bunkerweb.io/component: "bunkerweb"
1415
template:
1516
metadata:
1617
annotations:
@@ -66,10 +67,14 @@ spec:
6667
{{- toYaml . | nindent 12}}
6768
{{- end }}
6869
ports:
70+
- containerPort: 5000
71+
name: bwapi
6972
- containerPort: 8080
7073
- containerPort: 8443
74+
{{- if and .Values.bunkerweb.usePrometheusExporter }}
7175
- containerPort: 9113
7276
name: metrics
77+
{{- end }}
7378
env:
7479
# Mandatory for k8s integration
7580
- name: KUBERNETES_MODE
@@ -91,6 +96,10 @@ spec:
9196
readinessProbe:
9297
{{- toYaml . | nindent 12}}
9398
{{- end }}
99+
{{- with .Values.bunkerweb.volumeMounts }}
100+
volumeMounts:
101+
{{- toYaml . | nindent 12 }}
102+
{{- end }}
94103
{{- if .Values.bunkerweb.nodeSelector }}
95104
{{- with .Values.bunkerweb.nodeSelector }}
96105
nodeSelector:
@@ -122,4 +131,8 @@ spec:
122131
topologySpreadConstraints:
123132
{{- toYaml . | nindent 8 }}
124133
{{- end }}
134+
{{- with .Values.bunkerweb.volumes }}
135+
volumes:
136+
{{- toYaml . | nindent 8 }}
137+
{{- end }}
125138
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if .Values.bunkerweb.hpa.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ include "bunkerweb.fullname" . }}-hpa
6+
namespace: {{ .Release.Namespace }}
7+
spec:
8+
scaleTargetRef:
9+
apiVersion: apps/v1
10+
kind: {{ .Values.bunkerweb.hpa.targetKind | default "Deployment" }}
11+
{{- if and .Values.bunkerweb.hpa.nameOverride (ne .Values.bunkerweb.hpa.nameOverride "") }}
12+
name: {{ .Values.bunkerweb.hpa.nameOverride }}
13+
{{- else }}
14+
name: {{ include "bunkerweb.fullname" . }}
15+
{{- end }}
16+
{{- if ne .Values.bunkerweb.hpa.targetKind "DaemonSet" }}
17+
minReplicas: {{ .Values.bunkerweb.hpa.minReplicas | default 2 }}
18+
maxReplicas: {{ .Values.bunkerweb.hpa.maxReplicas | default 10 }}
19+
{{- end }}
20+
metrics:
21+
{{- if .Values.bunkerweb.hpa.cpu.enabled }}
22+
- type: Resource
23+
resource:
24+
name: cpu
25+
target:
26+
type: Utilization
27+
averageUtilization: {{ .Values.bunkerweb.hpa.cpu.targetAverageUtilization | default 60 }}
28+
{{- end }}
29+
{{- if .Values.bunkerweb.hpa.memory.enabled }}
30+
- type: Resource
31+
resource:
32+
name: memory
33+
target:
34+
type: Utilization
35+
averageUtilization: {{ .Values.bunkerweb.hpa.memory.targetAverageUtilization | default 70 }}
36+
{{- end }}
37+
{{- end }}

charts/bunkerweb/templates/bunkerweb-poddisruptionbudget.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
{{- $replicaCount := int .Values.bunkerweb.replicaCount }}
2-
{{- if and .Values.bunkerweb.pdb.create (gt $replicaCount 1) }}
1+
{{- $replicas := int .Values.bunkerweb.replicas }}
2+
{{- if and .Values.bunkerweb.pdb.create (gt $replicas 1) }}
33
apiVersion: policy/v1
44
kind: PodDisruptionBudget
55
metadata:

charts/bunkerweb/templates/bunkerweb-service-internal.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ metadata:
66
labels:
77
{{- include "bunkerweb.labels" . | nindent 4 }}
88
spec:
9-
clusterIP: None
109
selector:
1110
bunkerweb.io/component: "bunkerweb"
12-
11+
{{- if and .Values.bunkerweb.service.headless (ne .Values.bunkerweb.service.headless false) }}
12+
clusterIP: None
13+
{{- else }}
14+
type: ClusterIP
15+
ports:
16+
- name: bwapi
17+
protocol: TCP
18+
port: 5000
19+
targetPort: 5000
20+
{{- end }}
1321
---
14-
22+
{{- if .Values.scheduler.usePrometheusExporter -}}
1523
apiVersion: v1
1624
kind: Service
1725
metadata:
@@ -28,4 +36,5 @@ spec:
2836
- name: metrics
2937
protocol: TCP
3038
port: 9113
31-
targetPort: 9113
39+
targetPort: 9113
40+
{{- end }}

charts/bunkerweb/templates/bunkerweb-statefulset.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ spec:
1212
selector:
1313
matchLabels:
1414
{{- include "bunkerweb.selectorLabels" . | nindent 6 }}
15+
bunkerweb.io/component: "bunkerweb"
1516
template:
1617
metadata:
1718
annotations:
@@ -43,8 +44,10 @@ spec:
4344
ports:
4445
- containerPort: 8080
4546
- containerPort: 8443
47+
{{- if and .Values.bunkerweb.usePrometheusExporter }}
4648
- containerPort: 9113
4749
name: metrics
50+
{{- end }}
4851
env:
4952
- name: KUBERNETES_MODE
5053
value: "yes"
@@ -63,6 +66,10 @@ spec:
6366
readinessProbe:
6467
{{- toYaml . | nindent 12 }}
6568
{{- end }}
69+
{{- with .Values.bunkerweb.volumeMounts }}
70+
volumeMounts:
71+
{{- toYaml . | nindent 12 }}
72+
{{- end }}
6673
{{- with .Values.nodeSelector }}
6774
nodeSelector:
6875
{{- toYaml . | nindent 8 }}
@@ -71,4 +78,8 @@ spec:
7178
topologySpreadConstraints:
7279
{{- toYaml . | nindent 8 }}
7380
{{- end }}
81+
{{- with .Values.bunkerweb.volumes }}
82+
volumes:
83+
{{- toYaml . | nindent 8 }}
84+
{{- end }}
7485
{{- end }}

charts/bunkerweb/templates/controller-deployment.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ spec:
5858
value: "{{ .Values.settings.kubernetes.ingressClass }}"
5959
- name: KUBERNETES_DOMAIN_NAME
6060
value: "{{ .Values.settings.kubernetes.domainName }}"
61-
- name: BUNKERWEB_NAMESPACE
62-
value: "{{ include "bunkerweb.namespace" . }}"
63-
- name: BUNKERWEB_SERVICE_NAME
64-
value: "{{ include "bunkerweb.fullname" . }}-external"
6561
{{- if .Values.controller.nodeSelector }}
6662
{{- with .Values.controller.nodeSelector }}
6763
nodeSelector:
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if and .Values.grafana.enabled .Values.grafana.ingress.enabled -}}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: grafana-{{ include "bunkerweb.fullname" . }}
6+
namespace: {{ include "bunkerweb.namespace" . }}
7+
labels:
8+
{{- include "bunkerweb.labels" . | nindent 4 }}
9+
annotations:
10+
{{- with .Values.grafana.ingress.annotations }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
spec:
14+
{{- if .Values.grafana.ingress.ingressClassName }}
15+
ingressClassName: {{ .Values.grafana.ingress.ingressClassName }}
16+
{{- end}}
17+
{{- if .Values.grafana.ingress.tlsSecretName }}
18+
tls:
19+
- hosts:
20+
- {{ .Values.grafana.ingress.serverName }}
21+
secretName: {{ .Values.grafana.ingress.tlsSecretName }}
22+
{{- end }}
23+
rules:
24+
- host: {{ .Values.grafana.ingress.serverName }}
25+
http:
26+
paths:
27+
- path: {{ .Values.grafana.ingress.serverPath }}
28+
pathType: Prefix
29+
backend:
30+
service:
31+
name: grafana-{{ include "bunkerweb.fullname" . }}
32+
port:
33+
number: 3000
34+
{{- end }}

0 commit comments

Comments
 (0)