Skip to content

Commit b7900d6

Browse files
fix: volumeMounts in gzctf and wrong volumeMount path for postgresql
1 parent e987c32 commit b7900d6

5 files changed

Lines changed: 13 additions & 110 deletions

File tree

gzctf/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: gzctf
33
description: A Helm chart for deploying GZCTF on Kubernetes
44
type: application
5-
version: 0.1.1
5+
version: 0.1.2
66

77
dependencies:
88
- name: garnet

gzctf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# GZCTF Helm Chart
2-
![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
2+
![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
33
[![Lint and Server-side Dryrun Chart](https://github.com/GZCTF/helm/actions/workflows/lint-and-test-chart.yaml/badge.svg)](https://github.com/GZCTF/helm/actions/workflows/lint-and-test-chart.yaml)
44

55
This is a Helm chart for deploying GZCTF on Kubernetes. It deploys the official [GZCTF Docker image](ghcr.io/gztimewalker/gzctf/gzctf). Optional HA/Autoscaling (still experimental) + postgresql or postgresql-ha + [Garnet](https://github.com/microsoft/Garnet) or [redis-ha](https://github.com/DandyDeveloper/charts/tree/master/charts/redis-ha) + [MinIO S3](https://github.com/minio/minio/tree/master/helm/minio). Also supports using external Postgresql/Redis/S3.

gzctf/templates/deployment.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,19 +56,26 @@ spec:
5656
{{- if and (not .Values.minio.enabled) (.Values.gzctf.pvc.create) }}
5757
- name: {{ include "gzctf.fullname" . }}
5858
mountPath: /app/files
59+
{{- else if and (.Values.minio.enabled) (not .Values.gzctf.pvc.create) }}
60+
- name: emptydir
61+
mountPath: /app/files
5962
{{- end }}
6063
- name: {{ include "gzctf.fullname" . }}-appsettings
6164
mountPath: /app/appsettings.json
6265
subPath: appsettings.json
6366
readOnly: true
64-
{{ with .Values.gzctf.volumeMounts }}
67+
{{- with .Values.gzctf.volumeMounts }}
6568
{{- toYaml . | nindent 12 }}
6669
{{- end }}
6770
volumes:
68-
{{ if and (not .Values.minio.enabled) (.Values.gzctf.pvc.create) -}}
71+
{{- if and (not .Values.minio.enabled) (.Values.gzctf.pvc.create) -}}
6972
- name: {{ include "gzctf.fullname" . }}
7073
persistentVolumeClaim:
7174
claimName: {{ include "gzctf.fullname" . }}
75+
{{- else if and (.Values.minio.enabled) (not .Values.gzctf.pvc.create) }}
76+
- name: emptydir
77+
emptyDir:
78+
sizeLimit: 1Mi
7279
{{- end }}
7380
- name: {{ include "gzctf.fullname" . }}-appsettings
7481
secret:

gzctf/templates/postgresql/statefulset.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ spec:
7070
{{- end }}
7171
volumeMounts:
7272
- name: {{ include "gzctf.fullname" . }}-db
73-
mountPath: /var/lib/postgresql
73+
mountPath: /var/lib/postgresql/data
74+
subPath: data
7475
{{- with .Values.postgresql.volumeMounts }}
7576
{{- toYaml . | nindent 12 }}
7677
{{- end }}

gzctf/values.yaml

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -50,70 +50,14 @@ gzctf:
5050
//"RedisCache": "gzctf-garnet:6379,password=gzctf",
5151
//"Storage": "minio.s3://serviceUrl=gzctf-minio;keyId=gzctf;key=gzctf;bucket=gzctf-bucket"
5252
},
53-
"Logging": {
54-
"LogLevel": {
55-
"Default": "Information",
56-
"Microsoft": "Warning",
57-
"Microsoft.Hosting.Lifetime": "Information"
58-
},
59-
"Loki": {
60-
"Enable": false,
61-
"EndpointUri": "http://loki:3100",
62-
"Labels": [
63-
{
64-
"Key": "app",
65-
"Value": "gzctf"
66-
}
67-
],
68-
"PropertiesAsLabels": ["app"],
69-
"Credentials": {
70-
"Login": "login",
71-
"Password": "password"
72-
},
73-
"Tenant": "my-tenant",
74-
"MinimumLevel": "Trace"
75-
}
76-
},
77-
"Telemetry": {
78-
"Prometheus": {
79-
"Enable": false,
80-
"Port": 3000,
81-
"TotalNameSuffixForCounters": false
82-
},
83-
"OpenTelemetry": {
84-
"Enable": false,
85-
"Protocol": "Grpc",
86-
"EndpointUri": "http://jaeger-collector:4317"
87-
},
88-
"AzureMonitor": {
89-
"Enable": false,
90-
"ConnectionString": "InstrumentationKey=12345678-abcd-abcd-abcd-12345678..."
91-
},
92-
"Console": {
93-
"Enable": true
94-
}
95-
},
96-
"EmailConfig": {
97-
"SenderAddress": "",
98-
"SenderName": "",
99-
"UserName": "",
100-
"Password": "",
101-
"Smtp": {
102-
"Host": "localhost",
103-
"Port": 587,
104-
"BypassCertVerify": false
105-
}
106-
},
10753
"XorKey": "gzctf",
10854
"ContainerProvider": {
10955
"Type": "Kubernetes",
11056
"PortMappingType": "Default",
11157
"EnableTrafficCapture": false,
11258
"PublicEntry": "ctf.example.com",
11359
"KubernetesConfig": {
114-
// optional
11560
"Namespace": "gzctf-challenges",
116-
"ConfigPath": "kube-config.yaml",
11761
"AllowCIDR": [
11862
"10.0.0.0/8"
11963
],
@@ -122,55 +66,6 @@ gzctf:
12266
"223.5.5.5"
12367
]
12468
}
125-
},
126-
"RequestLogging": false,
127-
"DisableRateLimit": false,
128-
"Registries": {
129-
"ghcr.io": {
130-
"UserName": "...",
131-
"Password": "ghp_..."
132-
},
133-
"docker.io": {
134-
"UserName": "...",
135-
"Password": "..."
136-
},
137-
"your.custom.registry": {
138-
"UserName": "...",
139-
"Password": "..."
140-
}
141-
},
142-
"CaptchaConfig": {
143-
"Provider": "None", // or "CloudflareTurnstile" or "HashPow"
144-
"SiteKey": "<Your SITE_KEY>",
145-
"SecretKey": "<Your SECRET_KEY>"
146-
},
147-
"ForwardedOptions": {
148-
"ForwardedHeaders": 5, // a flag enum, see following link
149-
"ForwardLimit": 1,
150-
"ForwardedForHeaderName": "X-Forwarded-For",
151-
// use the following options to allow proxy
152-
"TrustedNetworks": ["10.0.0.0/8"],
153-
"TrustedProxies": ["10.0.0.1"]
154-
},
155-
"Kestrel": {
156-
"Limits": {
157-
"MaxResponseBufferSize": 2048,
158-
"MaxRequestBufferSize": 1048576,
159-
"MaxRequestLineSize": 8192,
160-
"MaxRequestHeadersTotalSize": 32768,
161-
"MaxRequestHeaderCount": 100,
162-
"MaxRequestBodySize": 27262946,
163-
"KeepAliveTimeout": "0.0:5:0",
164-
"RequestHeadersTimeout": "0.0:5:0",
165-
"MaxConcurrentConnections": null,
166-
"MaxConcurrentUpgradedConnections": null
167-
},
168-
"AddServerHeader": true,
169-
"AllowResponseHeaderCompression": true,
170-
"AllowSynchronousIO": false,
171-
"AllowAlternateSchemes": false,
172-
"DisableStringReuse": false,
173-
"ConfigurationLoader": null
17469
}
17570
}
17671

0 commit comments

Comments
 (0)