From 7cffdc1edf33ebcc674b17197c00041a8cb0d5cc Mon Sep 17 00:00:00 2001 From: chrislu Date: Sat, 6 Dec 2025 11:35:06 -0800 Subject: [PATCH] helm: simplify CI and remove all-in-one ingress Address review comments: - Remove detailed all-in-one template rendering tests from CI - Remove real cluster deployment tests from CI - Remove all-in-one ingress template and values configuration Keep the core improvements: - allInOne.replicas configuration - allInOne.s3.* full configuration - allInOne.sftp.* full configuration - allInOne.extraArgs support - allInOne.updateStrategy configuration - allInOne.secretExtraEnvironmentVars support --- .github/workflows/helm_ci.yml | 382 ------------------ .../all-in-one/all-in-one-ingress.yaml | 154 ------- k8s/charts/seaweedfs/values.yaml | 32 -- 3 files changed, 568 deletions(-) delete mode 100644 k8s/charts/seaweedfs/templates/all-in-one/all-in-one-ingress.yaml diff --git a/.github/workflows/helm_ci.yml b/.github/workflows/helm_ci.yml index 14de77558..ea971aec1 100644 --- a/.github/workflows/helm_ci.yml +++ b/.github/workflows/helm_ci.yml @@ -118,390 +118,8 @@ jobs: echo "" echo "✅ All template rendering tests passed!" - - name: Verify all-in-one template rendering - run: | - set -e - CHART_DIR="k8s/charts/seaweedfs" - - echo "=== Testing all-in-one with custom replicas ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.replicas=2 > /tmp/allinone-replicas.yaml - grep -q "replicas: 2" /tmp/allinone-replicas.yaml - echo "✓ All-in-one replicas configuration works" - - echo "=== Testing all-in-one with S3 enabled ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true > /tmp/allinone-s3.yaml - grep -q "\-s3" /tmp/allinone-s3.yaml - grep -q "swfs-s3" /tmp/allinone-s3.yaml - echo "✓ All-in-one S3 configuration works" - - echo "=== Testing all-in-one with custom S3 port ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true \ - --set allInOne.s3.port=9000 > /tmp/allinone-s3-port.yaml - grep -q "port: 9000" /tmp/allinone-s3-port.yaml - echo "✓ All-in-one custom S3 port works" - - echo "=== Testing all-in-one with S3 auth ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true \ - --set allInOne.s3.enableAuth=true > /tmp/allinone-s3-auth.yaml - grep -q "config-s3-users" /tmp/allinone-s3-auth.yaml - grep -q "s3.config=" /tmp/allinone-s3-auth.yaml - echo "✓ All-in-one S3 auth configuration works" - - echo "=== Testing all-in-one with S3 domainName ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true \ - --set allInOne.s3.domainName=s3.example.com > /tmp/allinone-s3-domain.yaml - grep -q "s3.domainName=s3.example.com" /tmp/allinone-s3-domain.yaml - echo "✓ All-in-one S3 domain name configuration works" - - echo "=== Testing all-in-one with SFTP enabled ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.sftp.enabled=true > /tmp/allinone-sftp.yaml - grep -q "\-sftp" /tmp/allinone-sftp.yaml - grep -q "swfs-sftp" /tmp/allinone-sftp.yaml - echo "✓ All-in-one SFTP configuration works" - - echo "=== Testing all-in-one with custom SFTP port ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.sftp.enabled=true \ - --set allInOne.sftp.port=2222 > /tmp/allinone-sftp-port.yaml - grep -q "sftp.port=2222" /tmp/allinone-sftp-port.yaml - echo "✓ All-in-one custom SFTP port works" - - echo "=== Testing all-in-one with extraArgs ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set 'allInOne.extraArgs[0]=-customFlag' \ - --set 'allInOne.extraArgs[1]=customValue' > /tmp/allinone-extraargs.yaml - grep -q "\-customFlag" /tmp/allinone-extraargs.yaml - echo "✓ All-in-one extraArgs configuration works" - - echo "=== Testing all-in-one with RollingUpdate strategy ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.updateStrategy.type=RollingUpdate > /tmp/allinone-strategy.yaml - grep -q "type: RollingUpdate" /tmp/allinone-strategy.yaml - echo "✓ All-in-one update strategy configuration works" - - echo "=== Testing all-in-one with PVC storage ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.data.type=persistentVolumeClaim \ - --set allInOne.data.size=50Gi \ - --set allInOne.data.storageClass=fast > /tmp/allinone-pvc.yaml - grep -q "PersistentVolumeClaim" /tmp/allinone-pvc.yaml - grep -q "storage: 50Gi" /tmp/allinone-pvc.yaml - grep -q "storageClassName: fast" /tmp/allinone-pvc.yaml - echo "✓ All-in-one PVC configuration works" - - echo "=== Testing all-in-one with existing claim ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.data.type=existingClaim \ - --set allInOne.data.claimName=my-existing-pvc > /tmp/allinone-existing-claim.yaml - grep -q "claimName: my-existing-pvc" /tmp/allinone-existing-claim.yaml - echo "✓ All-in-one existing claim configuration works" - - echo "=== Testing all-in-one with hostPath storage ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.data.type=hostPath \ - --set allInOne.data.hostPathPrefix=/mnt/seaweedfs > /tmp/allinone-hostpath.yaml - grep -q "hostPath:" /tmp/allinone-hostpath.yaml - grep -q "/mnt/seaweedfs/seaweedfs-all-in-one-data" /tmp/allinone-hostpath.yaml - echo "✓ All-in-one hostPath configuration works" - - echo "=== Testing all-in-one with ingress (S3) ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true \ - --set allInOne.ingress.enabled=true \ - --set allInOne.ingress.s3.enabled=true \ - --set allInOne.ingress.host=seaweedfs.example.com > /tmp/allinone-ingress-s3.yaml - grep -q "kind: Ingress" /tmp/allinone-ingress-s3.yaml - grep -q "seaweedfs-all-in-one-s3" /tmp/allinone-ingress-s3.yaml - echo "✓ All-in-one S3 ingress configuration works" - - echo "=== Testing all-in-one with ingress (filer) ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.ingress.enabled=true \ - --set allInOne.ingress.filer.enabled=true > /tmp/allinone-ingress-filer.yaml - grep -q "seaweedfs-all-in-one-filer" /tmp/allinone-ingress-filer.yaml - echo "✓ All-in-one filer ingress configuration works" - - echo "=== Testing all-in-one with ingress (master) ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.ingress.enabled=true \ - --set allInOne.ingress.master.enabled=true > /tmp/allinone-ingress-master.yaml - grep -q "seaweedfs-all-in-one-master" /tmp/allinone-ingress-master.yaml - echo "✓ All-in-one master ingress configuration works" - - echo "=== Testing all-in-one with secretExtraEnvironmentVars ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set 'allInOne.secretExtraEnvironmentVars.DB_PASSWORD.secretKeyRef.name=db-secret' \ - --set 'allInOne.secretExtraEnvironmentVars.DB_PASSWORD.secretKeyRef.key=password' > /tmp/allinone-secret-env.yaml - grep -q "DB_PASSWORD" /tmp/allinone-secret-env.yaml - grep -q "secretKeyRef" /tmp/allinone-secret-env.yaml - echo "✓ All-in-one secretExtraEnvironmentVars configuration works" - - echo "=== Testing all-in-one with security enabled ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set global.enableSecurity=true > /tmp/allinone-security.yaml - grep -q "security-config" /tmp/allinone-security.yaml - grep -q "ca-cert" /tmp/allinone-security.yaml - echo "✓ All-in-one security configuration works" - - echo "=== Testing all-in-one combined configuration ===" - helm template test $CHART_DIR \ - --set allInOne.enabled=true \ - --set allInOne.replicas=1 \ - --set allInOne.s3.enabled=true \ - --set allInOne.s3.port=9000 \ - --set allInOne.s3.enableAuth=true \ - --set allInOne.sftp.enabled=true \ - --set allInOne.sftp.port=2222 \ - --set allInOne.data.type=persistentVolumeClaim \ - --set allInOne.data.size=100Gi \ - --set allInOne.ingress.enabled=true \ - --set allInOne.ingress.s3.enabled=true \ - --set allInOne.ingress.filer.enabled=true > /tmp/allinone-combined.yaml - grep -q "replicas: 1" /tmp/allinone-combined.yaml - grep -q "s3.port=9000" /tmp/allinone-combined.yaml - grep -q "sftp.port=2222" /tmp/allinone-combined.yaml - grep -q "storage: 100Gi" /tmp/allinone-combined.yaml - grep -q "kind: Ingress" /tmp/allinone-combined.yaml - echo "✓ All-in-one combined configuration works" - - echo "" - echo "✅ All all-in-one template rendering tests passed!" - - name: Create kind cluster uses: helm/kind-action@v1.13.0 - name: Run chart-testing (install) run: ct install --target-branch ${{ github.event.repository.default_branch }} --all --chart-dirs k8s/charts - - - name: Deploy all-in-one cluster with S3 - run: | - set -e - echo "=== Deploying SeaweedFS all-in-one cluster with S3 ===" - - # Install the all-in-one chart - helm install seaweedfs-test k8s/charts/seaweedfs \ - --set allInOne.enabled=true \ - --set allInOne.s3.enabled=true \ - --set allInOne.data.type=emptyDir \ - --set master.enabled=false \ - --set volume.enabled=false \ - --set filer.enabled=false \ - --set allInOne.resources.requests.cpu=100m \ - --set allInOne.resources.requests.memory=256Mi \ - --set allInOne.resources.limits.cpu=500m \ - --set allInOne.resources.limits.memory=512Mi \ - --wait \ - --timeout 5m - - echo "✓ Helm install completed" - - - name: Wait for all-in-one pod to be ready - run: | - set -e - echo "=== Waiting for all-in-one pod to be ready ===" - - kubectl wait --for=condition=ready pod \ - -l app.kubernetes.io/component=seaweedfs-all-in-one \ - --timeout=300s - - echo "✓ All-in-one pod is ready" - - # Show pod status - kubectl get pods -l app.kubernetes.io/component=seaweedfs-all-in-one -o wide - - # Show logs - echo "=== Pod logs ===" - kubectl logs -l app.kubernetes.io/component=seaweedfs-all-in-one --tail=50 - - - name: Test Master API - run: | - set -e - echo "=== Testing Master API ===" - - # Port-forward to master - kubectl port-forward svc/seaweedfs-all-in-one 9333:9333 & - PF_PID=$! - sleep 5 - - # Test master cluster status - echo "Testing /cluster/status endpoint..." - RESPONSE=$(curl -s http://localhost:9333/cluster/status) - echo "Response: $RESPONSE" - - if echo "$RESPONSE" | grep -q "IsLeader"; then - echo "✓ Master API is responding correctly" - else - echo "✗ Master API test failed" - kill $PF_PID 2>/dev/null || true - exit 1 - fi - - kill $PF_PID 2>/dev/null || true - - - name: Test Filer API - run: | - set -e - echo "=== Testing Filer API ===" - - # Port-forward to filer - kubectl port-forward svc/seaweedfs-all-in-one 8888:8888 & - PF_PID=$! - sleep 5 - - # Test filer root - echo "Testing filer root endpoint..." - RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" http://localhost:8888/) - echo "Response code: $RESPONSE" - - if [ "$RESPONSE" = "200" ]; then - echo "✓ Filer API is responding correctly" - else - echo "✗ Filer API test failed with code: $RESPONSE" - kill $PF_PID 2>/dev/null || true - exit 1 - fi - - # Test file upload and download - echo "Testing file upload..." - echo "Hello SeaweedFS" > /tmp/test-file.txt - curl -s -F "file=@/tmp/test-file.txt" http://localhost:8888/test-file.txt - - echo "Testing file download..." - CONTENT=$(curl -s http://localhost:8888/test-file.txt) - if [ "$CONTENT" = "Hello SeaweedFS" ]; then - echo "✓ File upload/download works correctly" - else - echo "✗ File content mismatch: $CONTENT" - kill $PF_PID 2>/dev/null || true - exit 1 - fi - - # Cleanup - curl -s -X DELETE http://localhost:8888/test-file.txt - - kill $PF_PID 2>/dev/null || true - - - name: Test S3 API - run: | - set -e - echo "=== Testing S3 API ===" - - # Port-forward to S3 - kubectl port-forward svc/seaweedfs-all-in-one 8333:8333 & - PF_PID=$! - sleep 5 - - # Test S3 status endpoint - echo "Testing S3 /status endpoint..." - RESPONSE=$(curl -s http://localhost:8333/status) - echo "Response: $RESPONSE" - - if echo "$RESPONSE" | grep -q "version"; then - echo "✓ S3 API is responding correctly" - else - echo "✗ S3 API test failed" - kill $PF_PID 2>/dev/null || true - exit 1 - fi - - kill $PF_PID 2>/dev/null || true - - - name: Test S3 operations with AWS CLI - run: | - set -e - echo "=== Testing S3 operations with AWS CLI ===" - - # Install AWS CLI - pip install awscli - - # Port-forward to S3 - kubectl port-forward svc/seaweedfs-all-in-one 8333:8333 & - PF_PID=$! - sleep 5 - - # Configure AWS CLI for local S3 - export AWS_ACCESS_KEY_ID=any - export AWS_SECRET_ACCESS_KEY=any - export AWS_DEFAULT_REGION=us-east-1 - - S3_ENDPOINT="http://localhost:8333" - - # Create a bucket - echo "Creating test bucket..." - aws --endpoint-url $S3_ENDPOINT s3 mb s3://test-bucket || true - echo "✓ Bucket created" - - # List buckets - echo "Listing buckets..." - aws --endpoint-url $S3_ENDPOINT s3 ls - echo "✓ Bucket listing works" - - # Upload a file - echo "Uploading test file..." - echo "Hello from S3 test" > /tmp/s3-test-file.txt - aws --endpoint-url $S3_ENDPOINT s3 cp /tmp/s3-test-file.txt s3://test-bucket/test-file.txt - echo "✓ File uploaded" - - # List objects - echo "Listing objects..." - aws --endpoint-url $S3_ENDPOINT s3 ls s3://test-bucket/ - echo "✓ Object listing works" - - # Download the file - echo "Downloading test file..." - aws --endpoint-url $S3_ENDPOINT s3 cp s3://test-bucket/test-file.txt /tmp/s3-downloaded.txt - - # Verify content - CONTENT=$(cat /tmp/s3-downloaded.txt) - if [ "$CONTENT" = "Hello from S3 test" ]; then - echo "✓ File content matches" - else - echo "✗ File content mismatch: $CONTENT" - kill $PF_PID 2>/dev/null || true - exit 1 - fi - - # Delete the file - echo "Deleting test file..." - aws --endpoint-url $S3_ENDPOINT s3 rm s3://test-bucket/test-file.txt - echo "✓ File deleted" - - # Delete the bucket - echo "Deleting test bucket..." - aws --endpoint-url $S3_ENDPOINT s3 rb s3://test-bucket - echo "✓ Bucket deleted" - - kill $PF_PID 2>/dev/null || true - - echo "" - echo "✅ All S3 operations completed successfully!" - - - name: Cleanup - if: always() - run: | - echo "=== Cleaning up ===" - helm uninstall seaweedfs-test || true - echo "✓ Cleanup completed" diff --git a/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-ingress.yaml b/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-ingress.yaml deleted file mode 100644 index f4b015092..000000000 --- a/k8s/charts/seaweedfs/templates/all-in-one/all-in-one-ingress.yaml +++ /dev/null @@ -1,154 +0,0 @@ -{{- if .Values.allInOne.enabled }} -{{- if .Values.allInOne.ingress.enabled }} -{{- $fullName := printf "%s-all-in-one" (include "seaweedfs.name" .) -}} - -{{- /* S3 Ingress */}} -{{- if and .Values.allInOne.s3.enabled .Values.allInOne.ingress.s3.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }}-s3 - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "seaweedfs.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: seaweedfs-all-in-one - {{- with .Values.allInOne.ingress.s3.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.allInOne.ingress.className }} - ingressClassName: {{ .Values.allInOne.ingress.className }} - {{- end }} - {{- if .Values.allInOne.ingress.s3.tls }} - tls: - {{- range .Values.allInOne.ingress.s3.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- if .Values.allInOne.ingress.host }} - - host: {{ .Values.allInOne.ingress.host | quote }} - http: - {{- else }} - - http: - {{- end }} - paths: - - path: {{ .Values.allInOne.ingress.s3.path }} - pathType: {{ .Values.allInOne.ingress.s3.pathType }} - backend: - service: - name: {{ $fullName }} - port: - number: {{ .Values.allInOne.s3.port | default .Values.s3.port }} -{{- end }} - -{{- /* Filer Ingress */}} -{{- if .Values.allInOne.ingress.filer.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }}-filer - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "seaweedfs.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: seaweedfs-all-in-one - {{- with .Values.allInOne.ingress.filer.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.allInOne.ingress.className }} - ingressClassName: {{ .Values.allInOne.ingress.className }} - {{- end }} - {{- if .Values.allInOne.ingress.filer.tls }} - tls: - {{- range .Values.allInOne.ingress.filer.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- if .Values.allInOne.ingress.host }} - - host: {{ .Values.allInOne.ingress.host | quote }} - http: - {{- else }} - - http: - {{- end }} - paths: - - path: {{ .Values.allInOne.ingress.filer.path }} - pathType: {{ .Values.allInOne.ingress.filer.pathType }} - backend: - service: - name: {{ $fullName }} - port: - number: {{ .Values.filer.port }} -{{- end }} - -{{- /* Master Ingress */}} -{{- if .Values.allInOne.ingress.master.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: {{ $fullName }}-master - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: {{ template "seaweedfs.name" . }} - helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: seaweedfs-all-in-one - {{- with .Values.allInOne.ingress.master.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -spec: - {{- if .Values.allInOne.ingress.className }} - ingressClassName: {{ .Values.allInOne.ingress.className }} - {{- end }} - {{- if .Values.allInOne.ingress.master.tls }} - tls: - {{- range .Values.allInOne.ingress.master.tls }} - - hosts: - {{- range .hosts }} - - {{ . | quote }} - {{- end }} - secretName: {{ .secretName }} - {{- end }} - {{- end }} - rules: - {{- if .Values.allInOne.ingress.host }} - - host: {{ .Values.allInOne.ingress.host | quote }} - http: - {{- else }} - - http: - {{- end }} - paths: - - path: {{ .Values.allInOne.ingress.master.path }} - pathType: {{ .Values.allInOne.ingress.master.pathType }} - backend: - service: - name: {{ $fullName }} - port: - number: {{ .Values.master.port }} -{{- end }} - -{{- end }} -{{- end }} - diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yaml index 97eab5351..697562afb 100644 --- a/k8s/charts/seaweedfs/values.yaml +++ b/k8s/charts/seaweedfs/values.yaml @@ -1286,38 +1286,6 @@ allInOne: cpu: "500m" memory: "1Gi" - # Ingress configuration - ingress: - enabled: false - className: "" - # host: false for "*" hostname - host: "seaweedfs.cluster.local" - # S3 ingress settings - s3: - enabled: false - path: "/" - pathType: Prefix - annotations: {} - tls: [] - # Filer ingress settings - filer: - enabled: false - path: "/sw-filer/?(.*)" - pathType: ImplementationSpecific - annotations: {} - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # nginx.ingress.kubernetes.io/use-regex: "true" - tls: [] - # Master ingress settings - master: - enabled: false - path: "/sw-master/?(.*)" - pathType: ImplementationSpecific - annotations: {} - # nginx.ingress.kubernetes.io/rewrite-target: /$1 - # nginx.ingress.kubernetes.io/use-regex: "true" - tls: [] - # Deploy Kubernetes COSI Driver for SeaweedFS # Requires COSI CRDs and controller to be installed in the cluster # For more information, visit: https://container-object-storage-interface.github.io/docs/deployment-guide