fastdfs-nginx
by ygqygq2
FastDFS-Nginx chart for Kubernetes
About this chart
FastDF-Nginx - Multiple tracker, Multiple storage
FastDFS is an open source high performance distributed file system (DFS). It's major functions include: file storing, file syncing and file accessing, and design for high capacity and load balance.
Introduction
This chart bootstraps tracker and storage stateful-application on a Kubernetes cluster using the Helm package manager. Largely inspired by this tutorial, further work was made to 'production-ize' the example.
Prerequisites
- Kubernetes 1.6+
- PV provisioner support in the underlying infrastructure
Installing the Chart
To install the chart with the release name my-release:
$ helm install my-release local/fastdfs-nginx
The command deploys FastDFS-Nginx cluster on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.
Uninstall
To uninstall/delete the my-release deployment:
$ helm delete my-release
Configuration
The following table lists the configurable parameters of the FastDFS-Nginx chart and their default values.
| Parameter | Description | Default |
|---|---|---|
fastdfs.storage | storage replicas number and pvc size | See values.yaml |
fastdfs.tracker | tracker replicas number, pvc size and nginx config file. | See values.yaml |
service.type | Service type. | ClusterIP |
image | fastdfs-nginx image, tag. | ygqygq2/fastdfs-nginx V6.07 |
trackerPorts | tracker and nginx ports. | See values.yaml |
storagePorts | storage and nginx ports. | See values.yaml |
ingress | Ingress for the fastdfs tracker nginx. | false |
persistentVolume.enabled | Create a volume to store data | true |
persistence.storageClass | Type of persistent volume claim | nil |
persistence.accessModes | Persistent volume access modes | [ReadWriteOnce] |
persistence.annotations | Persistent volume annotations | {} |
resources | CPU/Memory resource requests/limits | Memory: 128Mi, CPU: 100m |
Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,
Persistence
The FastDFS image stores the data and configurations at the /var/fdfs path of the container.
By default persistence is enabled, and a PersistentVolumeClaim is created and mounted in that directory. As a result, a persistent volume will need to be defined:
# https://kubernetes.io/docs/user-guide/persistent-volumes/#azure-disk
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: fast
provisioner: kubernetes.io/azure-disk
parameters:
skuName: Premium_LRS
location: westus
In order to disable this functionality you can change the values.yaml to disable persistence and use an emptyDir instead.
Deploy fastdfs-nginx with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has fastdfs-nginx on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartfastdfs-nginx is pinned at v2.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply