Skip to content

Commit 1be81be

Browse files
committed
chore(helm): add helm structure
Signed-off-by: Gabriel Mocanu <gabi.mocanu98@gmail.com>
1 parent f105c1a commit 1be81be

File tree

5 files changed

+133
-0
lines changed

5 files changed

+133
-0
lines changed

helm/web-challenge/Chart.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v2
2+
name: web-challenge
3+
description: A Helm chart for deploying web security challenges
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"
7+
keywords:
8+
- security
9+
- ctf
10+
- web
11+
- challenge
12+
maintainers:
13+
- name: Gabriel Mocanu
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ .Values.challenge.name }}
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app: {{ .Values.challenge.name }}
8+
category: {{ .Values.challenge.category }}
9+
spec:
10+
replicas: {{ .Values.replicaCount }}
11+
selector:
12+
matchLabels:
13+
app: {{ .Values.challenge.name }}
14+
template:
15+
metadata:
16+
labels:
17+
app: {{ .Values.challenge.name }}
18+
category: {{ .Values.challenge.category }}
19+
spec:
20+
containers:
21+
- name: {{ .Values.challenge.name }}
22+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
23+
imagePullPolicy: {{ .Values.image.pullPolicy }}
24+
ports:
25+
- name: http
26+
containerPort: {{ .Values.containerPort }}
27+
protocol: TCP
28+
{{- if .Values.healthCheck.enabled }}
29+
livenessProbe:
30+
httpGet:
31+
path: {{ .Values.healthCheck.path }}
32+
port: http
33+
initialDelaySeconds: {{ .Values.healthCheck.initialDelaySeconds }}
34+
periodSeconds: {{ .Values.healthCheck.periodSeconds }}
35+
readinessProbe:
36+
httpGet:
37+
path: {{ .Values.healthCheck.path }}
38+
port: http
39+
initialDelaySeconds: {{ .Values.healthCheck.initialDelaySeconds }}
40+
periodSeconds: {{ .Values.healthCheck.periodSeconds }}
41+
{{- end }}
42+
resources:
43+
{{- toYaml .Values.resources | nindent 12 }}
44+
{{- with .Values.nodeSelector }}
45+
nodeSelector:
46+
{{- toYaml . | nindent 8 }}
47+
{{- end }}
48+
{{- with .Values.affinity }}
49+
affinity:
50+
{{- toYaml . | nindent 8 }}
51+
{{- end }}
52+
{{- with .Values.tolerations }}
53+
tolerations:
54+
{{- toYaml . | nindent 8 }}
55+
{{- end }}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: {{ .Values.namespace }}
5+
labels:
6+
name: {{ .Values.namespace }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ .Values.challenge.name }}
5+
namespace: {{ .Values.namespace }}
6+
labels:
7+
app: {{ .Values.challenge.name }}
8+
category: {{ .Values.challenge.category }}
9+
spec:
10+
type: {{ .Values.service.type }}
11+
ports:
12+
- port: {{ .Values.service.port }}
13+
targetPort: http
14+
protocol: TCP
15+
name: http
16+
{{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }}
17+
nodePort: {{ .Values.service.nodePort }}
18+
{{- end }}
19+
selector:
20+
app: {{ .Values.challenge.name }}

helm/web-challenge/values.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
namespace: web-basics
2+
3+
challenge:
4+
name: ""
5+
category: "web-basics"
6+
7+
image:
8+
repository: ""
9+
tag: "latest"
10+
pullPolicy: IfNotPresent
11+
12+
replicaCount: 1
13+
14+
containerPort: 80
15+
16+
service:
17+
type: NodePort
18+
port: 80
19+
nodePort: "" # Leave empty for auto-assign (30000-32767) or specify a port
20+
21+
resources:
22+
limits:
23+
cpu: 100m
24+
memory: 128Mi
25+
requests:
26+
cpu: 50m
27+
memory: 64Mi
28+
29+
healthCheck:
30+
enabled: false
31+
path: "/"
32+
initialDelaySeconds: 5
33+
periodSeconds: 10
34+
35+
nodeSelector: {}
36+
37+
tolerations: []
38+
39+
affinity: {}

0 commit comments

Comments
 (0)