This guide is intended for users who are familiar with Kubernetes. It does not cover how to set up a Kubernetes cluster or provide tutorials on using kubectl
. Additionally, this guide may include some advanced Kubernetes terminology, so a certain level of familiarity is required for reading.
This article focuses on deploying GZCTF in a Kubernetes cluster. For configuration instructions specific to GZCTF itself, please refer to the Quick Start guide.
GZCTF supports multi-instance deployment, but based on testing, currently the most stable deployment method is a single-instance deployment with the database on the same node. Therefore, this article will focus on single-instance deployment as an example.
For multi-instance deployment, all instances need to use S3/Object Storage to ensure file consistency and write concurenncy (See #365). Additionally, Redis needs to be deployed to ensure cache consistency among multiple instances. Refer to appsettings documentation to configure both. Multiple providers are supported such as Azure/AWS/Minio.
For multi-instance deployment, the load balancer needs to be configured with sticky sessions to enable real-time data retrieval using websockets.
If you prefer a simpler deployment, go for a single-instance deployment!
Since you have chosen to deploy with Kubernetes, it implies that you need a larger number of Pods. Please pay attention to the following configuration:
Specify --kube-controller-manager-arg=node-cidr-mask-size=16
during installation. The default CIDR is /24
, supporting a maximum of 255 Pods. This cannot be changed after installation.
Adjust the value of maxPods
accordingly, otherwise you may reach the Pod limit and be unable to schedule more Pods.
Create namespaces and configuration files. See appsettings
Create local PV (if you need to share storage among multiple instances, please change the configuration yourself)
Create the Deployment manifest of GZCTF
Create Service and Ingress
Additional Configuration for Traefik
In order to make GZCTF able to obtain the real IP address of users through XFF, Traefik needs to be able to add the XFF header correctly. Please note that the following content may not always be up-to-date and applicable to all versions of Traefik. This is an example of helm values, please search for the latest configuration method yourself.
GZCTF_ADMIN_PASSWORD
environment variable. Otherwise, you will need to manually create the admin account.https://kubernetes.default.svc.cluster.local:443
as the server
field in the cluster configuration file.