Skip to content

Latest commit

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GZCTF Helm Chart

Version: 0.1.7Type: applicationLint and Server-side Dryrun Chart

This is a Helm chart for deploying GZCTF on Kubernetes. It deploys the official GZCTF Docker image. Optional HA/Autoscaling (experimental) + postgresql or postgresql-ha + Garnet or redis-ha + RustFS S3. Also supports using external Postgresql/Redis/S3.

Add the helm repo

helm repo add gzctf https://gzctf.github.io/helm

Install (Quick start)

This installs a single-node gzctf with ReadWriteOnce PVC and a single replica of postgresql (statefulset). appsettings has the default configurations

helm install gzctf gzctf/gzctf \
--set env[0].name=GZCTF_ADMIN_PASSWORD \
--set env[0].value=xxx

Install with custom values.yaml

If you need to install garnet or redis-ha and/or postgresql-ha and/or RustFS. Also if you need to set passwords/xorkey

helm install gzctf gzctf/gzctf -f values.yaml

Install from source

Build helm dependencies before installing the chart.

helm dependency update

Set the values in values.yaml to your desired configuration. Then install

helm install release-name . -f values.yaml --create-namespace --namespace gzctf

Uninstall

helm uninstall release-name --namespace gzctf

Important Notes

  • multi-node deployment is still experimental (needs extensive testing)
  • gzctf support for s3 bucket is experimental (single-node deployment doesnt need s3 bucket)
  • garnet/redis is not needed for single-node deployment
  • minio stopped releasing community edition binaries and docker images minio/minio/issues/21647 We replaced it with RustFS instead.
  • postgresql-ha bitnami image is legacy/deprecated

Values examples

Deploy Postgresql + Garnet + RustFS

gzctf:
image:
tag: "latest"appsettings: | { "AllowedHosts": "*", "ConnectionStrings": { "Database": "Host=gzctf-db:5432;Database=gzctf;Username=postgres;Password=gzctf", "RedisCache": "gzctf-garnet:6379,password=gzctf", "Storage": "minio.s3://accessKey=...;secretKey=...;bucket=...;endpoint=...;forcePathStyle=true" }, ... } # content of appsettings.jsonenv:
- name: LC_ALLvalue: "en_US.UTF-8"
- name: GZCTF_ADMIN_PASSWORDvalue: "astrongpassword"autoscaling:
enabled: false # (set to true for multi-node. still experimental)minReplicas: 2maxReplicas: 5targetCPUUtilizationPercentage: 80targetMemoryUtilizationPercentage: 80garnet:
enabled: trueconfig:
garnetConf: | { "AuthenticationMode": "Password", "Password": "gzctf" # needs to be consistent with the RedisCache password in appsettings.json }redis-ha:
enabled: false # (Can be enabled instead of garnet. Configure your appsettings to connect to release-name-redis-ha-haproxy )postgresql:
enabled: trueenv:
- name: POSTGRES_PASSWORDvalue: gzctf # needs to be consistent with the database password in appsettings.jsonpersistence:
enabled: truesize: 2Girustfs:
enabled: truesecret:
rustfs:
access_key: "gzctf"secret_key: "gzctf"# needs to be consistent with the storage configurations in appsettings.jsonstorageclass:
dataStorageSize: 10Gi

Configure your own external DB/Redis/S3

GZCTF:
image:
tag: "latest"appsettings: | { "AllowedHosts": "*", "ConnectionStrings": { "Database": "Host=...;Database=...;Username=...;Password=...", "RedisCache": "...,password=...", "Storage": "minio.s3://accessKey=...;secretKey=...;bucket=...;endpoint=...;forcePathStyle=true" }, ... } # content of appsettings.jsonpostgresql:
enabled: falsegarnet:
enabled: falserustfs:
enabled: false

Requirements

RepositoryNameVersion
https://charts.bitnami.com/bitnamipostgresql-ha16.3.2
https://dandydeveloper.github.io/chartsredis-ha4.33.7
https://rustfs.github.io/helmrustfs0.2.0
oci://ghcr.io/microsoft/helm-chartsgarnet0.2.2

Values

KeyTypeDefaultDescription
extraObjectslist[]Additional Kubernetes manifests to deploy with this Helm chart
garnet.config.existingSecretstring""Garnet secret (if you want to use an existing secret). This secret must contains a key called 'garnet.conf'.
garnet.config.garnetConfstring"{\n \"AuthenticationMode\": \"Password\",\n \"Password\": \"gzctf\"\n}\n"The garnet.conf data content.
garnet.enabledboolfalseEnable Microsoft Garnet cache-store deployment
garnet.imageobject{"registry":"ghcr.io","repostiory":"microsoft/garnet","tag":""}Garnet container image configuration
garnet.image.registrystring"ghcr.io"Garnet image registry
garnet.image.repostiorystring"microsoft/garnet"Garnet image repository
garnet.image.tagstring""Garnet image tag (empty string uses chart appVersion)
garnet.persistenceobjectDisabled (persistence not needed for cache)Persistent storage configuration for Garnet
garnet.persistence.enabledboolfalseEnable persistent storage for Garnet (not recommended for cache workloads)
gzctf.affinityobject{}Affinity rules for GZCTF pod scheduling
gzctf.appsettingsstringSee values.yaml for full configurationGZCTF application settings (appsettings.json content)
gzctf.autoscaling.enabledboolfalseEnable autoscaling
gzctf.autoscaling.maxReplicasint100Maximum number of replicas
gzctf.autoscaling.minReplicasint1Minimum number of replicas
gzctf.autoscaling.targetCPUUtilizationPercentageint80Target CPU utilization percentage
gzctf.autoscaling.targetMemoryUtilizationPercentageint80Target memory utilization percentage
gzctf.clusterRole.createbooltrueCreate ClusterRole for GZCTF (required for Kubernetes challenge container management)
gzctf.clusterRole.ruleslist[{"apiGroups":["*"],"resources":["*"],"verbs":["*"]},{"nonResourceURLs":["*"],"verbs":["*"]}]ClusterRole rules (full cluster access for managing challenge containers)
gzctf.envlist[{"name":"GZCTF_ADMIN_PASSWORD","value":"xxx"},{"name":"LC_ALL","value":"en_US.UTF-8"}]Environment variables for GZCTF container
gzctf.env[0]object{"name":"GZCTF_ADMIN_PASSWORD","value":"xxx"}Initial admin password for GZCTF
gzctf.env[1]object{"name":"LC_ALL","value":"en_US.UTF-8"}Locale configuration
gzctf.fullnameOverridestring""Override the full name of the chart
gzctf.imageobject{"pullPolicy":"Always","repository":"ghcr.io/gztimewalker/gzctf/gzctf","tag":"v1.8.5"}GZCTF container image configuration
gzctf.image.pullPolicystring"Always"Image pull policy
gzctf.image.repositorystring"ghcr.io/gztimewalker/gzctf/gzctf"GZCTF image repository
gzctf.image.tagstring"v1.8.5"GZCTF image tag
gzctf.imagePullSecretslist[]Image pull secrets for private container registries
gzctf.ingress.annotationsobject{"traefik.ingress.kubernetes.io/service.sticky.cookie":"true","traefik.ingress.kubernetes.io/service.sticky.cookie.httponly":"true","traefik.ingress.kubernetes.io/service.sticky.cookie.name":"LB_Session"}Annotations for ingress resource
gzctf.ingress.classNamestring""Ingress class name
gzctf.ingress.enabledbooltrueEnable ingress for GZCTF
gzctf.ingress.hostslist[{"host":"gctf.example.com","paths":[{"path":"/","pathType":"Prefix"}]}]Ingress hosts configuration
gzctf.ingress.tlslist[]TLS configuration for ingress
gzctf.livenessProbeobject{"httpGet":{"path":"/healthz","port":"metrics"}}Liveness probe configuration
gzctf.metrics.enabledbooltrueEnable metrics port
gzctf.metrics.portint3000Metrics port number
gzctf.nameOverridestring""Override the name of the chart
gzctf.nodeSelectorobject{}Node labels for GZCTF pod assignment
gzctf.podAnnotationsobject{}Annotations to add to GZCTF pods
gzctf.podLabelsobject{}Labels to add to GZCTF pods
gzctf.podSecurityContextobject{}Security context for GZCTF pod
gzctf.pvc.accessModestring"ReadWriteOnce"Access mode for the PVC (use ReadWriteMany when deploying multiple instances)
gzctf.pvc.createbooltrueCreate a PVC for GZCTF
gzctf.pvc.sizestring"2Gi"Size of the PVC
gzctf.pvc.storageClassNamestring"standard"Storage class name for the PVC (empty string uses cluster default)
gzctf.readinessProbeobject{"httpGet":{"path":"/healthz","port":"metrics"}}Readiness probe configuration
gzctf.replicaCountint1Number of GZCTF replicas (Set to >1 for multi-node. Needs requirements)
gzctf.resourcesobject{"requests":{"cpu":"1000m","memory":"384Mi"}}Resource requests and limits for GZCTF container
gzctf.resources.requestsobject{"cpu":"1000m","memory":"384Mi"}Resource requests
gzctf.resources.requests.cpustring"1000m"CPU request
gzctf.resources.requests.memorystring"384Mi"Memory request
gzctf.securityContextobject{}Security context for GZCTF container
gzctf.serviceobject{"annotations":{},"port":8080,"type":"ClusterIP"}GZCTF service configuration
gzctf.service.annotationsobject{}Annotations to add to the service
gzctf.service.portint8080Service port
gzctf.service.typestring"ClusterIP"Service type
gzctf.serviceAccountobject{"annotations":{},"automount":true,"create":true,"name":""}ServiceAccount configuration for GZCTF
gzctf.serviceAccount.annotationsobject{}Annotations to add to the ServiceAccount
gzctf.serviceAccount.automountbooltrueAutomatically mount ServiceAccount token
gzctf.serviceAccount.createbooltrueCreate a ServiceAccount for GZCTF
gzctf.serviceAccount.namestring""ServiceAccount name (generated from chart fullname if not set)
gzctf.strategyTypestring"RollingUpdate"Deployment strategy type
gzctf.tolerationslist[]Tolerations for GZCTF pod scheduling
gzctf.volumeMountslist[]Additional volume mounts for GZCTF container
gzctf.volumeslist[]Additional volumes for GZCTF pod
postgresql-ha.enabledboolfalseEnable or disable PostgreSQL HA deployment (THIS USES BITNAMI LEGACY IMAGES BY DEFAULT WHICH NO LONGER RECIEVE RPOPER SECURITY UPDATES)
postgresql-ha.metrics.enabledboolfalsepostgresql exporter enable
postgresql-ha.metrics.image.registrystring"docker.io"postgres-exporter image registry
postgresql-ha.metrics.image.repositorystring"bitnamilegacy/postgres-exporter"postgres-exporter image repository
postgresql-ha.metrics.image.tagstring"0.17.1-debian-12-r16"postgres-exporter image tag
postgresql-ha.persistence.accessModestring"ReadWriteOnce"Volume access mode
postgresql-ha.persistence.enabledbooltrueEnable persistent volume for database storage
postgresql-ha.persistence.sizestring"2Gi"Persistent volume size
postgresql-ha.persistence.storageClassstring""Storage class name (empty string uses cluster default)
postgresql-ha.pgpool.image.registrystring"docker.io"pgpool image registry
postgresql-ha.pgpool.image.repositorystring"bitnamilegacy/pgpool"pgpool image repository
postgresql-ha.pgpool.image.tagstring"4.6.3-debian-12-r0"pgpool image tag
postgresql-ha.postgresql.databasestring"gzctf"Default database name to create
postgresql-ha.postgresql.image.registrystring"docker.io"Docker registry for PostgreSQL image
postgresql-ha.postgresql.image.repositorystring"bitnamilegacy/postgresql-repmgr"PostgreSQL repository (bitnamilegacy repmgr version)
postgresql-ha.postgresql.image.tagstring"17.6.0-debian-12-r2"PostgreSQL image tag (version 17.6.0)
postgresql-ha.postgresql.passwordstring"gzctf"PostgreSQL superuser password (should be overridden or use secrets)
postgresql-ha.postgresql.usernamestring"postgres"PostgreSQL superuser username
postgresql-ha.volumePermissions.enabledbooltrueEnable init container to set proper volume permissions
postgresql-ha.volumePermissions.image.registrystring"docker.io"volume-permissions image registry
postgresql-ha.volumePermissions.image.repositorystring"bitnamilegacy/os-shell"volume-permissions image repository
postgresql-ha.volumePermissions.image.tagstring"12-debian-12-r51"volume-permissions image tag
postgresql.affinityobject{}Affinity rules for PostgreSQL pod scheduling
postgresql.enabledbooltrueEnable PostgreSQL deployment
postgresql.envlist[{"name":"POSTGRES_PASSWORD","value":"gzctf"}]Environment variables for PostgreSQL container
postgresql.env[0]objectMust match the database password in appsettings.jsonPostgreSQL password environment variable
postgresql.imageobject{"imagePullSecrets":[],"pullPolicy":"IfNotPresent","registry":"docker.io","repository":"postgres","tag":"16-alpine"}PostgreSQL image configuration
postgresql.image.imagePullSecretslist[]Image pull secrets for private registries
postgresql.image.pullPolicystring"IfNotPresent"Image pull policy
postgresql.image.registrystring"docker.io"Docker registry for PostgreSQL image
postgresql.image.repositorystring"postgres"PostgreSQL image repository
postgresql.image.tagstring"16-alpine"PostgreSQL image tag
postgresql.livenessProbeobject{}Liveness probe configuration for PostgreSQL container
postgresql.nodeSelectorobject{}Node labels for PostgreSQL pod assignment
postgresql.persistence.accessModestring"ReadWriteOnce"Access mode for the persistent volume
postgresql.persistence.enabledbooltrueEnable persistent storage for PostgreSQL
postgresql.persistence.sizestring"2Gi"Size of the persistent volume
postgresql.persistence.storageClassNamestring""Storage class name for persistent volume (empty string uses cluster default)
postgresql.podAnnotationsobject{}Annotations to add to PostgreSQL pods
postgresql.podLabelsobject{}
postgresql.podSecurityContextobject{}Security context for PostgreSQL pod
postgresql.readinessProbeobject{}Readiness probe configuration for PostgreSQL container
postgresql.resourcesobject{"requests":{"cpu":"500m","memory":"512Mi"}}Resource requests and limits for PostgreSQL container
postgresql.resources.requestsobject{"cpu":"500m","memory":"512Mi"}Resource requests
postgresql.resources.requests.cpustring"500m"CPU request
postgresql.resources.requests.memorystring"512Mi"Memory request
postgresql.securityContextobject{}Security context for PostgreSQL container
postgresql.serviceobject{"port":5432}PostgreSQL service configuration
postgresql.service.portint5432PostgreSQL service port
postgresql.tolerationslist[]Tolerations for PostgreSQL pod scheduling
postgresql.volumeMountslist[]Additional volume mounts for PostgreSQL container
postgresql.volumeslist[]Additional volumes for PostgreSQL pod
redis-ha.additionalAffinitiesobject{}Additional affinities to add to the Redis server pods.
redis-ha.affinitystring""Assign custom [affinity] rules to the Redis pods.
redis-ha.authbooltrueConfigures redis-ha with AUTH
redis-ha.containerSecurityContextobjectSee [values.yaml]Redis HA statefulset container-level security context
redis-ha.enabledboolfalseDeploys a High-Availability Redis cluster
redis-ha.exporter.enabledboolfalseEnable Prometheus redis-exporter sidecar
redis-ha.exporter.imagestring"ghcr.io/oliver006/redis_exporter"Repository to use for the redis-exporter
redis-ha.exporter.tagstring"v1.78.0"Tag to use for the redis-exporter
redis-ha.haproxy.additionalAffinitiesobject{}Additional affinities to add to the haproxy pods.
redis-ha.haproxy.affinitystring""Assign custom [affinity] rules to the haproxy pods.
redis-ha.haproxy.containerSecurityContextobjectSee [values.yaml]HAProxy container-level security context
redis-ha.haproxy.enabledbooltrueEnabled HAProxy LoadBalancing/Proxy
redis-ha.haproxy.hardAntiAffinitybooltrueWhether the haproxy pods should be forced to run on separate nodes.
redis-ha.haproxy.labelsobject{"app.kubernetes.io/name":"gzctf-redis-ha-haproxy"}Custom labels for the haproxy pod.
redis-ha.haproxy.metrics.enabledbooltrueHAProxy enable prometheus metric scraping
redis-ha.haproxy.tolerationslist[][Tolerations] for use with node taints for haproxy pods.
redis-ha.hardAntiAffinitybooltrueWhether the Redis server pods should be forced to run on separate nodes.
redis-ha.image.repositorystring"public.ecr.aws/docker/library/redis"Redis repository
redis-ha.image.tagstring"7.2.11-alpine"Redis tag
redis-ha.persistentVolume.enabledboolfalseConfigures persistence on Redis nodes
redis-ha.redis.configobjectSee [values.yaml]Any valid redis config options in this section will be applied to each server (see redis-ha chart)
redis-ha.redis.config.savestring'""'Will save the DB if both the given number of seconds and the given number of write operations against the DB occurred. "" is disabled
redis-ha.redis.masterGroupNamestring"gzctf"Redis convention for naming the cluster group: must match ^[\\w-\\.]+$ and can be templated
redis-ha.redisPasswordstring"gzctf"A password that configures a requirepass and masterauth in the conf parameters (Requires auth: enabled)
redis-ha.tolerationslist[][Tolerations] for use with node taints for Redis pods.
redis-ha.topologySpreadConstraintsobject{"enabled":false,"maxSkew":"","topologyKey":"","whenUnsatisfiable":""}Assign custom [TopologySpreadConstraints] rules to the Redis pods. # https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
redis-ha.topologySpreadConstraints.enabledboolfalseEnable Redis HA topology spread constraints
redis-ha.topologySpreadConstraints.maxSkewstring"" (defaults to 1)Max skew of pods tolerated
redis-ha.topologySpreadConstraints.topologyKeystring"" (defaults to topology.kubernetes.io/zone)Topology key for spread
redis-ha.topologySpreadConstraints.whenUnsatisfiablestring"" (defaults to ScheduleAnyway)Enforcement policy, hard or soft
rustfs.enabledboolfalseEnable RustFS deployment (set to false if you want to use an external S3 bucket)
rustfs.modeobject{"distributed":{"enabled":false},"standalone":{"enabled":true}}RustFS mode configuration
rustfs.mode.distributedobject{"enabled":false}Distributed mode configuration
rustfs.mode.standaloneobject{"enabled":true}Standalone mode configuration
rustfs.secretobject{"rustfs":{"access_key":"","secret_key":""}}RustFS secret configuration
rustfs.secret.rustfsobject{"access_key":"","secret_key":""}RustFS secret name
rustfs.secret.rustfs.access_keystring""RustFS access key
rustfs.secret.rustfs.secret_keystring""RustFS secret key
rustfs.storageclassobject{"dataStorageSize":"10Gi"}RustFS storage class configuration
rustfs.storageclass.dataStorageSizestring"10Gi"Data storage size

Autogenerated from chart metadata using helm-docs

About

A helm chart that deploys GZCTF

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages