-
Notifications
You must be signed in to change notification settings - Fork 0
Installation Guide
This guide covers different methods to install the SeaweedFS operator in your Kubernetes cluster.
Before installing the SeaweedFS operator, ensure you have:
- Kubernetes cluster (v1.19 or later)
- kubectl configured to access your cluster
- Helm (optional, for Helm installation)
- Sufficient cluster resources for the operator
- CPU: Minimum 2 cores, recommended 4+ cores
- Memory: Minimum 2GB RAM, recommended 4GB+ RAM
- Storage: At least 10GB available storage
- Network: Internet access for pulling container images
Helm is the recommended installation method as it provides easy management and upgrades.
helm repo add seaweedfs-operator https://nnstd.github.io/seaweedfs-operator
helm repo update# Install with default settings
helm install seaweedfs-operator seaweedfs-operator/operator \
--namespace seaweedfs-operator-system \
--create-namespace
# Install with custom values
helm install seaweedfs-operator seaweedfs-operator/operator \
--namespace seaweedfs-operator-system \
--create-namespace \
--values custom-values.yaml# Check operator pods
kubectl get pods -n seaweedfs-operator-system
# Check CRDs
kubectl get crd | grep seaweed
# Check operator deployment
kubectl get deployment -n seaweedfs-operator-systemFor users who prefer direct kubectl installation or don't have Helm available.
# Install Seaweed CRD
kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/crd/bases/seaweed.seaweedfs.com_seaweeds.yaml
# Install BucketClaim CRD
kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/crd/bases/seaweed.seaweedfs.com_bucketclaims.yamlkubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/rbac/kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/manager/# Check operator deployment
kubectl get deployment -n seaweedfs-operator-system
# Check operator pods
kubectl get pods -n seaweedfs-operator-system
# Check operator logs
kubectl logs -n seaweedfs-operator-system deployment/seaweedfs-operator-controller-managerFor clusters with OLM installed.
# Create operator group
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
name: seaweedfs-operator-group
namespace: seaweedfs-operator-system
spec:
targetNamespaces:
- seaweedfs-operator-system
EOF
# Create subscription
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: seaweedfs-operator
namespace: seaweedfs-operator-system
spec:
channel: stable
name: seaweedfs-operator
source: operatorhubio-catalog
sourceNamespace: olm
EOFCreate a custom-values.yaml file to customize the installation:
# Operator configuration
operator:
image:
repository: ghcr.io/seaweedfs/seaweedfs-operator
tag: v0.0.1
pullPolicy: IfNotPresent
# Resource limits
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
# Replica count
replicaCount: 1
# Node selector
nodeSelector: {}
# Tolerations
tolerations: []
# Affinity
affinity: {}
# Webhook configuration
webhook:
enabled: true
port: 9443
certDir: /tmp/certs
# Metrics configuration
metrics:
enabled: true
port: 8080
serviceMonitor:
enabled: false
# Security context
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 1000You can configure the operator using environment variables:
# Set operator image
export OPERATOR_IMAGE=ghcr.io/seaweedfs/seaweedfs-operator:v0.0.1
# Set log level
export LOG_LEVEL=info
# Enable leader election
export ENABLE_LEADER_ELECTION=true
# Set metrics port
export METRICS_PORT=8080Ensure all custom resource definitions are installed:
kubectl get crd | grep seaweedExpected output:
bucketclaims.seaweed.seaweedfs.com
seaweeds.seaweed.seaweedfs.com
Verify the operator is running correctly:
# Check operator deployment
kubectl get deployment seaweedfs-operator-controller-manager -n seaweedfs-operator-system
# Check operator pods
kubectl get pods -n seaweedfs-operator-system -l control-plane=controller-manager
# Check operator logs
kubectl logs -n seaweedfs-operator-system deployment/seaweedfs-operator-controller-managerCreate a simple SeaweedFS cluster to test the installation:
# test-cluster.yaml
apiVersion: seaweed.seaweedfs.com/v1
kind: Seaweed
metadata:
name: test-cluster
namespace: default
spec:
version: "3.67"
master:
replicas: 1
volume:
replicas: 1
filer:
replicas: 1
s3: truekubectl apply -f test-cluster.yaml
kubectl get seaweed test-cluster# Update repository
helm repo update
# Upgrade operator
helm upgrade seaweedfs-operator seaweedfs-operator/operator \
--namespace seaweedfs-operator-system# Apply updated manifests
kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/crd/bases/
kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/manager/# Uninstall operator
helm uninstall seaweedfs-operator -n seaweedfs-operator-system
# Delete namespace
kubectl delete namespace seaweedfs-operator-system# Delete operator deployment
kubectl delete -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/manager/
# Delete RBAC resources
kubectl delete -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/rbac/
# Delete CRDs (this will also delete all custom resources)
kubectl delete -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/crd/bases/
# Delete namespace
kubectl delete namespace seaweedfs-operator-system# Check if CRDs exist
kubectl get crd | grep seaweed
# Reinstall CRDs
kubectl apply -f https://raw.githubusercontent.com/seaweedfs/seaweedfs-operator/main/config/crd/bases/# Check pod status
kubectl get pods -n seaweedfs-operator-system
# Check pod events
kubectl describe pod -n seaweedfs-operator-system <pod-name>
# Check operator logs
kubectl logs -n seaweedfs-operator-system deployment/seaweedfs-operator-controller-manager# Check RBAC resources
kubectl get clusterrole,clusterrolebinding | grep seaweed
# Check service account
kubectl get serviceaccount -n seaweedfs-operator-system# Check image pull policy
kubectl get deployment seaweedfs-operator-controller-manager -n seaweedfs-operator-system -o yaml
# Check image pull secrets
kubectl get secrets -n seaweedfs-operator-system# Check all resources in operator namespace
kubectl get all -n seaweedfs-operator-system
# Check events
kubectl get events -n seaweedfs-operator-system --sort-by='.lastTimestamp'
# Check operator logs with follow
kubectl logs -n seaweedfs-operator-system deployment/seaweedfs-operator-controller-manager -f
# Check CRD status
kubectl get crd seaweed.seaweedfs.com_seaweeds -o yaml
kubectl get crd seaweed.seaweedfs.com_bucketclaims -o yamlThe operator requires the following permissions:
- Create, read, update, delete Seaweed and BucketClaim resources
- Manage StatefulSets, Services, ConfigMaps, and other Kubernetes resources
- Access to secrets for configuration
- Cluster-wide permissions for CRD management
Consider implementing network policies to restrict operator access:
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: seaweedfs-operator-network-policy
namespace: seaweedfs-operator-system
spec:
podSelector:
matchLabels:
control-plane: controller-manager
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: default
egress:
- to:
- namespaceSelector: {}The operator supports Pod Security Standards. Configure appropriate security contexts:
securityContext:
runAsNonRoot: true
runAsUser: 1000
fsGroup: 1000
capabilities:
drop:
- ALLFor installation issues and support:
- Quick Start - Get started with SeaweedFS
- Configuration Reference - Detailed configuration options
- Seaweed Resource - Main SeaweedFS cluster resource
- BucketClaim Resource - Bucket management resource