Skip to main content

k8s Deployment

This chapter introduces how to deploy Curvine distributed storage cluster on Kubernetes using production-grade Helm Chart.

Prerequisites​

  • Kubernetes 1.20+
  • Helm 3.0+
  • PV provisioner (if using PVC storage)

Quick Start​

1. Load Images into Kubernetes Cluster​

Refer to docker compile to build images and import them into the Kubernetes cluster.

2. Add Helm Repository (Optional)​

# If Chart is published to repository
helm repo add curvine https://curvineio.github.io/helm-charts
helm repo update

3. Install Chart​

Note: The current Helm version provided is based on the main branch and is intended for pre-release use only. To install, you must specify the --devel flag

# Install with default configuration
helm install curvine curvine/curvine -n curvine --create-namespace --devel

# Install with custom replica count
helm install curvine curvine/curvine -n curvine --create-namespace --devel \
--set master.replicas=5 \
--set worker.replicas=10

# Install with custom values file
helm install curvine curvine/curvine -n curvine --create-namespace --devel \
-f https://curvineio.github.io/helm/charts/examples/values-prod.yaml

Option B: Install from Local Chart​

Note: Run these commands from the helm-charts directory (parent directory of curvine-runtime folder)

# Install with default configuration
helm install curvine ./curvine-runtime -n curvine --create-namespace

# Install with custom replica count
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set master.replicas=5 \
--set worker.replicas=10

# Install with custom values file
helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f ./curvine-runtime/examples/values-prod.yaml

4. Verify Deployment​

# Check Pod status
kubectl get pods -n curvine

# View Services
kubectl get svc -n curvine

# View PersistentVolumeClaims
kubectl get pvc -n curvine

# Run Helm tests
helm test curvine -n curvine

5. Access Cluster​

# Port forward to access Master Web UI
kubectl port-forward -n curvine svc/curvine-master 9000:9000

# Access http://localhost:9000

Configuration​

View Current Configuration​

# View all current values
helm get values curvine -n curvine

# View specific version values in YAML format
helm get values curvine -n curvine -o yaml

# View rendered manifests
helm get manifest curvine -n curvine

# View Chart's values.yaml
cat ./curvine-runtime/values.yaml

# View specific parameters
helm get values curvine -n curvine | grep master.replicas

Common Parameter Usage Examples​

Adjust Resource Limits​

# Increase Master resources for high-load scenarios
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set master.resources.requests.cpu=2000m \
--set master.resources.requests.memory=4Gi \
--set master.resources.limits.cpu=4000m \
--set master.resources.limits.memory=8Gi

Configure Node Affinity​

# Run Master on specific nodes
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set 'master.nodeSelector.node-type=master' \
--set 'worker.nodeSelector.node-type=worker'

Enable Worker Privileged Mode​

# Enabled by default, but can be disabled if needed
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set worker.privileged=false

Configure Multiple Data Directories for Worker​

# Create values-multi-data.yaml with the following content:
# worker:
# storage:
# dataDirs:
# - name: "data1"
# type: "SSD"
# enabled: true
# size: "100Gi"
# storageClass: "fast-ssd"
# mountPath: "/data/data1"
# - name: "data2"
# type: "HDD"
# enabled: true
# size: "500Gi"
# storageClass: "slow-hdd"
# mountPath: "/data/data2"

helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f values-multi-data.yaml

Adjust Log Level​

# Set log level to DEBUG for troubleshooting
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set config.log.level=DEBUG

Configure External Master Service​

# Expose Master Service via LoadBalancer
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set service.masterExternal.enabled=true \
--set service.masterExternal.type=LoadBalancer

Configuration Parameters​

Global Parameters​

ParameterDescriptionDefault Value
global.clusterDomainKubernetes cluster domaincluster.local

Cluster Parameters​

ParameterDescriptionDefault Value
cluster.idCluster identifiercurvine
cluster.formatMasterFormat Master data on startupfalse
cluster.formatWorkerFormat Worker data on startupfalse
cluster.formatJournalFormat journal data on startupfalse

Image Configuration​

ParameterDescriptionDefault Value
image.repositoryContainer image repositorydocker.io/curvine
image.tagContainer image taglatest
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsImage pull secrets[]

Master Configuration​

ParameterDescriptionDefault Value
master.replicasMaster replica count (must be odd: 1, 3, 5, 7...)3
master.rpcPortRPC port8995
master.journalPortJournal/Raft port8996
master.webPortWeb UI port9000
master.web1PortAdditional Web port9001
master.storage.meta.enabledEnable metadata storagetrue
master.storage.meta.storageClassMetadata storage class"" (default)
master.storage.meta.sizeMetadata storage size10Gi
master.storage.meta.hostPathMetadata host path (used when no storageClass)""
master.storage.meta.mountPathMetadata mount path/opt/curvine/data/meta
master.storage.journal.enabledEnable journal storagetrue
master.storage.journal.storageClassJournal storage class"" (default)
master.storage.journal.sizeJournal storage size50Gi
master.storage.journal.hostPathJournal host path (used when no storageClass)""
master.storage.journal.mountPathJournal mount path/opt/curvine/data/journal
master.resources.requests.cpuCPU request1000m
master.resources.requests.memoryMemory request2Gi
master.resources.limits.cpuCPU limit2000m
master.resources.limits.memoryMemory limit4Gi
master.nodeSelectorNode selector labels
master.tolerationsPod tolerations[]
master.affinityPod affinity rules
master.labelsAdditional labels
master.annotationsAdditional annotations
master.extraEnvAdditional environment variables[]
master.extraVolumesAdditional volumes[]
master.extraVolumeMountsAdditional volume mounts[]

Worker Configuration​

ParameterDescriptionDefault Value
worker.replicasWorker replica count3
worker.rpcPortRPC port8997
worker.webPortWeb UI port9001
worker.hostNetworkUse host networkfalse
worker.dnsPolicyDNS policyClusterFirst
worker.privilegedPrivileged mode (required for FUSE)true
worker.storage.dataDirs[0].nameData directory namedata1
worker.storage.dataDirs[0].typeStorage type (SSD/HDD)SSD
worker.storage.dataDirs[0].enabledEnable data directorytrue
worker.storage.dataDirs[0].sizeData directory size10Gi
worker.storage.dataDirs[0].storageClassStorage class"" (default)
worker.storage.dataDirs[0].hostPathHost path (used when no storageClass)""
worker.storage.dataDirs[0].mountPathMount path/data/data1
worker.resources.requests.cpuCPU request2000m
worker.resources.requests.memoryMemory request4Gi
worker.resources.limits.cpuCPU limit4000m
worker.resources.limits.memoryMemory limit8Gi
worker.nodeSelectorNode selector labels
worker.tolerationsPod tolerations[]
worker.antiAffinity.enabledEnable Pod anti-affinitytrue
worker.antiAffinity.typeAnti-affinity type (required/preferred)preferred
worker.labelsAdditional labels
worker.annotationsAdditional annotations
worker.extraEnvAdditional environment variables[]
worker.extraVolumesAdditional volumes[]
worker.extraVolumeMountsAdditional volume mounts[]

Service Configuration​

ParameterDescriptionDefault Value
service.master.typeMaster Service typeClusterIP
service.master.annotationsMaster Service annotations
service.masterExternal.enabledEnable external Master Servicefalse
service.masterExternal.typeExternal Service typeClusterIP
service.masterExternal.annotationsExternal Service annotations
service.masterExternal.nodePortNodePort configuration
service.masterExternal.loadBalancerIPLoadBalancer IP""
service.masterExternal.loadBalancerSourceRangesLoadBalancer source ranges[]

Service Account & RBAC​

ParameterDescriptionDefault Value
serviceAccount.createCreate Service Accounttrue
serviceAccount.nameService Account name"" (auto-generated)
serviceAccount.annotationsService Account annotations
rbac.createCreate RBAC resourcestrue

Curvine Configuration​

ParameterDescriptionDefault Value
config.master.metaDirMaster metadata directory/opt/curvine/data/meta
config.journal.enableEnable journaltrue
config.journal.journalDirJournal directory/opt/curvine/data/journal
config.client.blockSizeStrClient block size64MB
config.log.levelLog level (INFO/DEBUG/WARN/ERROR)INFO
config.log.logDirLog directory/opt/curvine/logs
configOverrides.masterMaster configuration override
configOverrides.journalJournal configuration override
configOverrides.workerWorker configuration override
configOverrides.clientClient configuration override
configOverrides.logLog configuration override

For the complete parameter list, please refer to values.yaml.

Configuration Examples​

Development Environment (Minimal)​

# Install from Helm repository
helm install curvine curvine/curvine -n curvine --create-namespace --devel \
--set master.replicas=1 \
--set worker.replicas=1

# Install from local Chart (run in helm-charts directory)
helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f ./curvine-runtime/examples/values-dev.yaml

Production Environment (High Availability)​

# Install from Helm repository
helm install curvine curvine/curvine -n curvine --create-namespace --devel \
--set master.replicas=5 \
--set worker.replicas=10 \
--set master.storage.meta.storageClass=fast-ssd \
--set master.storage.journal.storageClass=fast-ssd

# Install from local Chart (run in helm-charts directory)
helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f ./curvine-runtime/examples/values-prod.yaml

Bare Metal Environment (Using hostPath)​

# Install from local Chart (run in helm-charts directory)
helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f ./curvine-runtime/examples/values-baremetal.yaml

Custom Configuration​

# Install from Helm repository
helm install curvine curvine/curvine -n curvine --create-namespace --devel \
--set master.replicas=5 \
--set worker.replicas=10 \
--set master.storage.meta.storageClass=fast-ssd \
--set worker.storage.dataDirs[0].storageClass=fast-ssd \
--set worker.storage.dataDirs[0].size=500Gi

# Install from local Chart (run in helm-charts directory)
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set master.replicas=5 \
--set worker.replicas=10 \
--set master.storage.meta.storageClass=fast-ssd \
--set worker.storage.dataDirs[0].storageClass=fast-ssd \
--set worker.storage.dataDirs[0].size=500Gi

Storage Configuration​

master:
storage:
meta:
storageClass: "fast-ssd"
size: "20Gi"
journal:
storageClass: "fast-ssd"
size: "100Gi"

worker:
storage:
dataDirs:
- name: "data1"
type: "SSD"
enabled: true
size: "100Gi"
storageClass: "fast-ssd"
mountPath: "/data/data1"
master:
storage:
meta:
storageClass: ""
hostPath: "/mnt/curvine/master/meta"
journal:
storageClass: ""
hostPath: "/mnt/curvine/master/journal"

worker:
storage:
dataDirs:
- name: "data1"
type: "SSD"
enabled: true
size: "100Gi"
storageClass: ""
hostPath: "/mnt/nvme0n1/curvine"
mountPath: "/data/data1"

Using emptyDir (For Testing)​

master:
storage:
meta:
storageClass: ""
hostPath: ""
journal:
storageClass: ""
hostPath: ""

worker:
storage:
dataDirs:
- name: "data1"
storageClass: ""
hostPath: ""

Storage Configuration Examples​

Quick Start with Default PVC​

# Use default storage class (fastest startup method)
helm install curvine ./curvine-runtime -n curvine --create-namespace

Cloud Environment Fast SSD Configuration​

# AWS/GCP/Azure fast SSD storage
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set master.storage.meta.storageClass=fast-ssd \
--set master.storage.journal.storageClass=fast-ssd \
--set 'worker.storage.dataDirs[0].storageClass=fast-ssd' \
--set 'worker.storage.dataDirs[0].size=500Gi'

Bare Metal Multi-Storage Type Configuration​

# Create values-baremetal-multi.yaml:
# master:
# storage:
# meta:
# storageClass: ""
# hostPath: "/mnt/nvme/master/meta"
# journal:
# storageClass: ""
# hostPath: "/mnt/nvme/master/journal"
#
# worker:
# storage:
# dataDirs:
# - name: "nvme"
# type: "SSD"
# enabled: true
# size: "200Gi"
# storageClass: ""
# hostPath: "/mnt/nvme/worker"
# mountPath: "/data/nvme"
# - name: "ssd"
# type: "SSD"
# enabled: true
# size: "500Gi"
# storageClass: ""
# hostPath: "/mnt/ssd/worker"
# mountPath: "/data/ssd"
# - name: "hdd"
# type: "HDD"
# enabled: true
# size: "2000Gi"
# storageClass: ""
# hostPath: "/mnt/hdd/worker"
# mountPath: "/data/hdd"

helm install curvine ./curvine-runtime -n curvine --create-namespace \
-f values-baremetal-multi.yaml

Hybrid Cloud and Local Storage​

# Master uses cloud PVC, Worker uses local hostPath
helm install curvine ./curvine-runtime -n curvine --create-namespace \
--set master.storage.meta.storageClass=cloud-ssd \
--set master.storage.journal.storageClass=cloud-ssd \
--set 'worker.storage.dataDirs[0].storageClass=""' \
--set 'worker.storage.dataDirs[0].hostPath=/mnt/local/data'

Upgrade​

Update Configuration​

# Scale Worker replicas (from Helm repository)
helm upgrade curvine curvine/curvine -n curvine --devel \
--set worker.replicas=15

# Upgrade image version (from Helm repository)
helm upgrade curvine curvine/curvine -n curvine --devel \
--set image.tag=v1.1.0

# Upgrade with new values file (from local Chart, run in helm-charts directory)
helm upgrade curvine ./curvine-runtime -n curvine \
-f ./curvine-runtime/values-new.yaml

Note:

  1. Master replica count and journal storage class cannot be modified during upgrades. To modify, delete and redeploy the cluster.
  2. Parameters not modified during upgrade will be reset to default configuration. If Master replica count and journal storage class were modified during installation, these two parameters need to be included during updates.

Common Upgrade Scenarios​

Scale Worker Nodes​

# Increase Worker replicas from 3 to 10
helm upgrade curvine ./curvine-runtime -n curvine \
--set worker.replicas=10

Increase Resource Limits​

# Increase Master resources for better performance
helm upgrade curvine ./curvine-runtime -n curvine \
--set master.resources.limits.cpu=4000m \
--set master.resources.limits.memory=8Gi

Update Image Version​

# Upgrade to new Curvine version
helm upgrade curvine ./curvine-runtime -n curvine \
--set image.tag=v1.2.0

Enable Debug Logging​

# Temporarily enable debug logging for troubleshooting
helm upgrade curvine ./curvine-runtime -n curvine \
--set config.log.level=DEBUG

Change Storage Configuration​

# Migrate to faster storage class
helm upgrade curvine ./curvine-runtime -n curvine \
--set master.storage.meta.storageClass=ultra-ssd \
--set master.storage.journal.storageClass=ultra-ssd

View Release History​

helm history curvine -n curvine

Rollback​

# Rollback to previous version
helm rollback curvine -n curvine

# Rollback to specific version
helm rollback curvine 2 -n curvine

Uninstall​

# Uninstall Chart (keep PVC)
helm uninstall curvine -n curvine

# Delete PersistentVolumeClaims
kubectl delete pvc -n curvine -l app.kubernetes.io/instance=curvine

# Delete namespace
kubectl delete namespace curvine

Troubleshooting​

Check Pod Status​

kubectl get pods -n curvine
kubectl describe pod <pod-name> -n curvine
kubectl logs <pod-name> -n curvine

View ConfigMap​

kubectl get configmap -n curvine
kubectl describe configmap curvine-config -n curvine

View Events​

kubectl get events -n curvine --sort-by='.lastTimestamp'

Common Issues​

  1. Master Replica Validation Failed

    1. Error: master.replicas must be an odd number

    2. Solution: Ensure Master replica count is odd (1, 3, 5, 7...)

  2. PVC Cannot Bind

    1. Check if StorageClass exists

    2. Verify PV provisioner is working properly

  3. Pod Startup Failed

    1. Verify container image exists

    2. Check if resource quotas are sufficient

    3. View Pod logs for details