hi. can you update this yaml: --- Available parameters and… · The Chat Archive
Explore hi. can you update this yaml: --- Available parameters and their default values for the… Save Share Download ▾ Reporthi. can you update this yaml:
Available parameters and their default values for the SeaweedFS chart.
global:
createClusterRole: true
registry: ""
repository: ""
imageName: chrislusf/seaweedfs
imagePullPolicy: IfNotPresent
imagePullSecrets: ""
restartPolicy: Always
loggingLevel: 1
enableSecurity: false
masterServer: null
securityConfig:
jwtSigning:
volumeWrite: true
volumeRead: false
filerWrite: false
filerRead: false
we will use this serviceAccountName for all ClusterRoles/ClusterRoleBindings
serviceAccountName: "seaweedfs"
automountServiceAccountToken: true
certificates:
alphacrds: false
monitoring:
enabled: false
gatewayHost: null
gatewayPort: null
additionalLabels: {}
if enabled will use global.replicationPlacment and override master & filer defaultReplicaPlacement config
enableReplication: false
replication type is XYZ:
X number of replica in other data centers
Y number of replica in other racks in the same data center
Z number of replica in other servers in the same rack
replicationPlacment: "001"
extraEnvironmentVars:
WEED_CLUSTER_DEFAULT: "sw"
WEED_CLUSTER_SW_MASTER: "seaweedfs-master.seaweedfs:9333"
WEED_CLUSTER_SW_FILER: "seaweedfs-filer-client.seaweedfs:8888"
# WEED_JWT_SIGNING_KEY:
# secretKeyRef:
# name: seaweedfs-signing-key
# key: signingKey
image:
registry: ""
repository: ""
master:
enabled: true
imageOverride: null
restartPolicy: null
replicas: 1
port: 9333
grpcPort: 19333
metricsPort: 9327
ipBind: "0.0.0.0"
volumePreallocate: false
volumeSizeLimitMB: 1000
loggingOverrideLevel: null
number of seconds between heartbeats, default 5
pulseSeconds: null
threshold to vacuum and reclaim spaces, default 0.3 (30%)
garbageThreshold: null
Prometheus push interval in seconds, default 15
metricsIntervalSec: 15
replication type is XYZ:
X number of replica in other data centers
Y number of replica in other racks in the same data center
Z number of replica in other servers in the same rack
defaultReplication: "000"
Disable http request, only gRpc operations are allowed
disableHttp: false
config: |-
# Enter any extra configuration for master.toml here.
# It may be a multi-line string.
You may use ANY storage-class, example with local-path-provisioner
Annotations are optional.
data:
type: "persistentVolumeClaim"
size: "24Ti"
storageClass: "local-path-provisioner"
annotations:
"key": "value"
You may also spacify an existing claim:
Show full message · 975 lines Assistant2024-10-08 10:28 UTC Copy response
Copy first prompt
Details
Provider OpenAI
Model provenance As recorded by source dataset
Turns 1 (2 messages)
Language en
Conversation date Oct 8, 2024
Added to archive Nov 16, 2026
ID 01m7h41x6faktjc0j11jwhmrhtSource & license Imported from WildChat-4.8M (AI2) (source ). Imported records earn no Research Points.
Upstream record: f7200154dd9b56c8a6bdbf3cdac6c4c4
Zhao et al., WildChat: 1M ChatGPT Interaction Logs in the Wild (ICLR 2024). Contains information from WildChat-4.8M, made available under the ODC Attribution License.
License: ODC-BY-1.0
data:
type: "existingClaim"
claimName: "my-pvc"
You can also use emptyDir storage:
data:
type: "emptyDir" data:
type: "hostPath"
storageClass: ""
hostPathPrefix: /ssd
You may use ANY storage-class, example with local-path-provisioner
Annotations are optional.
logs:
type: "persistentVolumeClaim"
size: "24Ti"
storageClass: "local-path-provisioner"
annotations:
"key": "value"
You can also use emptyDir storage:
logs:
type: "emptyDir" logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
@param master.sidecars Add additional sidecar containers to the master pod(s)
e.g:
sidecars:
- name: your-image-name
image: your-image
imagePullPolicy: Always
ports:
- name: portname
containerPort: 1234
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
Labels to be added to the master pods
Annotations to be added to the master pods
Set podManagementPolicy podManagementPolicy: Parallel
Resource requests, limits, etc. for the master cluster placement. This
should map directly to the value of the resources field for a PodSpec,
formatted as a multi-line string. By default no direct resource request
is made.
updatePartition is used to control a careful rolling update of SeaweedFS
masters.
Affinity Settings
Commenting out or setting as empty the affinity variable, will allow
deployment to single node services such as Minikube affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: master
topologyKey: kubernetes.io/hostname
Toleration Settings for master pods
This should be a multi-line string matching the Toleration array
in a PodSpec.
nodeSelector labels for master pod assignment, formatted as a muli-line string.
Example: nodeSelector: |
kubernetes.io/arch: amd64
nodeSelector: |
sw-backend: "true"
used to assign priority to master pods
used to assign a service account.
Configure security context for Pod
Example:
podSecurityContext:
enabled: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
Configure security context for Container
Example:
containerSecurityContext:
enabled: true
runAsUser: 2000
allowPrivilegeEscalation: false containerSecurityContext: {}
ingress:
enabled: false
className: "nginx"
# host: false for "*" hostname
host: "master.seaweedfs.local"
annotations:
nginx.ingress.kubernetes.io/auth-type: "basic"
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Master'
nginx.ingress.kubernetes.io/service-upstream: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/configuration-snippet: |
sub_filter '' ' '; #add base url
sub_filter '="/' '="./'; #make absolute paths to relative
sub_filter '=/' '=./';
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
sub_filter_once off;
tls: []
extraEnvironmentVars:
WEED_MASTER_VOLUME_GROWTH_COPY_1: '7'
WEED_MASTER_VOLUME_GROWTH_COPY_2: '6'
WEED_MASTER_VOLUME_GROWTH_COPY_3: '3'
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: '1'
used to configure livenessProbe on master-server containers
livenessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 10
used to configure readinessProbe on master-server containers
readinessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 45
successThreshold: 2
failureThreshold: 100
timeoutSeconds: 10
volume:
enabled: true
imageOverride: null
restartPolicy: null
port: 8080
grpcPort: 18080
metricsPort: 9327
ipBind: "0.0.0.0"
replicas: 1
loggingOverrideLevel: null
number of seconds between heartbeats, must be smaller than or equal to the master's setting
Choose [memory|leveldb|leveldbMedium|leveldbLarge] mode for memory~performance balance., default memory
limit file size to avoid out of memory, default 256mb
minimum free disk space(in percents). If free disk space lower this value - all volumes marks as ReadOnly
For each data disk you may use ANY storage-class, example with local-path-provisioner
Annotations are optional.
dataDirs:
- name: data:
type: "persistentVolumeClaim"
size: "24Ti"
storageClass: "local-path-provisioner"
annotations:
"key": "value"
maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
You may also spacify an existing claim:
- name: data
type: "existingClaim"
claimName: "my-pvc"
maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
You can also use emptyDir storage:
- name: data
type: "emptyDir"
maxVolumes: 0 # If set to zero on non-windows OS, the limit will be auto configured. (default "7")
name: data1
type: "hostPath"
hostPathPrefix: /ssd
maxVolumes: 0
- name: data2
type: "persistentVolumeClaim"
storageClass: "yourClassNameOfChoice"
size: "800Gi"
maxVolumes: 0
This will automatically create a job for patching Kubernetes resources if the dataDirs type is 'persistentVolumeClaim' and the size has changed. resizeHook:
enabled: true
image: bitnami/kubectl
idx can be defined by:
idx:
type: "hostPath"
hostPathPrefix: /ssd
or
idx:
type: "persistentVolumeClaim"
size: "20Gi"
storageClass: "local-path-provisioner"
or
idx:
type: "existingClaim"
claimName: "myClaim"
or
idx:
type: "emptyDir"
same applies to "logs"
limit background compaction or copying speed in mega bytes per second
Volume server's rack name
Volume server's data center name
Redirect moved or non-local volumes. (default proxy)
Comma separated Ip addresses having write permission. No limit if empty.
Adjust jpg orientation when uploading. imagesFixOrientation: false
@param volume.sidecars Add additional sidecar containers to the volume pod(s)
e.g:
sidecars:
- name: your-image-name
image: your-image
imagePullPolicy: Always
ports:
- name: portname
containerPort: 1234
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
Labels to be added to the volume pods
Annotations to be added to the volume pods
Set podManagementPolicy podManagementPolicy: Parallel
Affinity Settings
Commenting out or setting as empty the affinity variable, will allow
deployment to single node services such as Minikube affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: volume
topologyKey: kubernetes.io/hostname
Resource requests, limits, etc. for the server cluster placement. This
should map directly to the value of the resources field for a PodSpec,
formatted as a multi-line string. By default no direct resource request
is made.
Toleration Settings for server pods
This should be a multi-line string matching the Toleration array
in a PodSpec.
nodeSelector labels for server pod assignment, formatted as a muli-line string.
Example: nodeSelector: |
kubernetes.io/arch: amd64
nodeSelector: |
sw-volume: "true"
used to assign priority to server pods
used to assign a service account.
Configure security context for Pod
Example:
podSecurityContext:
enabled: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
Configure security context for Container
Example:
containerSecurityContext:
enabled: true
runAsUser: 2000
allowPrivilegeEscalation: false containerSecurityContext: {}
used to configure livenessProbe on volume-server containers
livenessProbe:
enabled: true
httpGet:
path: /healthz
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 90
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 30
used to configure readinessProbe on volume-server containers
readinessProbe:
enabled: true
httpGet:
path: /healthz
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 30
filer:
enabled: true
imageOverride: null
restartPolicy: null
replicas: 1
port: 8888
grpcPort: 18888
metricsPort: 9327
loggingOverrideLevel: null
filerGroup: ""
replication type is XYZ:
X number of replica in other data centers
Y number of replica in other racks in the same data center
Z number of replica in other servers in the same rack defaultReplicaPlacement: "000"
turn off directory listing
split files larger than the limit, default 32
encrypt data on volume servers
Whether proxy or redirect to volume server during file GET request
Limit sub dir listing size (default 100000)
Disable http request, only gRpc operations are allowed
DEPRECATE: enablePVC, storage, storageClass
Consider replacing with filer.data section below instead.
Settings for configuring stateful storage of filer pods.
enablePVC will create a pvc for filer for data persistence.
storage should be set to the disk size of the attached volume.
storageClass is the class of storage which defaults to null (the Kube cluster will pick the default).
You may use ANY storage-class, example with local-path-provisioner
Annotations are optional.
data:
type: "persistentVolumeClaim"
size: "24Ti"
storageClass: "local-path-provisioner"
annotations:
"key": "value"
You may also specify an existing claim:
data:
type: "existingClaim"
claimName: "my-pvc"
You can also use emptyDir storage:
data:
type: "emptyDir" data:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
You may use ANY storage-class, example with local-path-provisioner
Annotations are optional.
logs:
type: "persistentVolumeClaim"
size: "24Ti"
storageClass: "local-path-provisioner"
annotations:
"key": "value"
You can also use emptyDir storage:
logs:
type: "emptyDir" logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
@param filer.sidecars Add additional sidecar containers to the filer pod(s)
e.g:
sidecars:
- name: your-image-name
image: your-image
imagePullPolicy: Always
ports:
- name: portname
containerPort: 1234
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
Labels to be added to the filer pods
Annotations to be added to the filer pods
Set podManagementPolicy podManagementPolicy: Parallel
Affinity Settings
Commenting out or setting as empty the affinity variable, will allow
deployment to single node services such as Minikube affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer
topologyKey: kubernetes.io/hostname
updatePartition is used to control a careful rolling update of SeaweedFS
masters.
Resource requests, limits, etc. for the server cluster placement. This
should map directly to the value of the resources field for a PodSpec,
formatted as a multi-line string. By default no direct resource request
is made.
Toleration Settings for server pods
This should be a multi-line string matching the Toleration array
in a PodSpec.
nodeSelector labels for server pod assignment, formatted as a muli-line string.
Example: nodeSelector: |
kubernetes.io/arch: amd64
nodeSelector: |
sw-backend: "true"
used to assign priority to server pods
used to assign a service account.
Configure security context for Pod
Example:
podSecurityContext:
enabled: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
Configure security context for Container
Example:
containerSecurityContext:
enabled: true
runAsUser: 2000
allowPrivilegeEscalation: false containerSecurityContext: {}
ingress:
enabled: false
className: "nginx"
# host: false for "*" hostname
host: "seaweedfs.cluster.local"
annotations:
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/auth-type: "basic"
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Filer'
nginx.ingress.kubernetes.io/service-upstream: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/configuration-snippet: |
sub_filter '' ' '; #add base url
sub_filter '="/' '="./'; #make absolute paths to relative
sub_filter '=/' '=./';
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
sub_filter_once off;
extraEnvVars is a list of extra enviroment variables to set with the stateful set. extraEnvironmentVars:
WEED_MYSQL_ENABLED: "false"
WEED_MYSQL_HOSTNAME: "mysql-db-host"
WEED_MYSQL_PORT: "3306"
WEED_MYSQL_DATABASE: "sw_database"
WEED_MYSQL_CONNECTION_MAX_IDLE: "5"
WEED_MYSQL_CONNECTION_MAX_OPEN: "75"
# "refresh" connection every 10 minutes, eliminating mysql closing "old" connections
WEED_MYSQL_CONNECTION_MAX_LIFETIME_SECONDS: "600"
# enable usage of memsql as filer backend
WEED_MYSQL_INTERPOLATEPARAMS: "true"
# if you want to use leveldb2, then should enable "enablePVC". or you may lose your data.
WEED_LEVELDB2_ENABLED: "true"
# with http DELETE, by default the filer would check whether a folder is empty.
# recursive_delete will delete all sub folders and files, similar to "rm -Rf"
WEED_FILER_OPTIONS_RECURSIVE_DELETE: "false"
# directories under this folder will be automatically creating a separate bucket
WEED_FILER_BUCKETS_FOLDER: "/buckets"
used to configure livenessProbe on filer containers
livenessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 5
timeoutSeconds: 10
used to configure readinessProbe on filer containers
readinessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
secret env variables secretExtraEnvironmentVars: {}
# WEED_POSTGRES_USERNAME:
# secretKeyRef:
# name: postgres-credentials
# key: username
# WEED_POSTGRES_PASSWORD:
# secretKeyRef:
# name: postgres-credentials
# key: password
s3:
enabled: false
port: 8333
# add additional https port
httpsPort: 0
# allow empty folders
allowEmptyFolder: false
# Suffix of the host name, {bucket}.{domainName}
domainName: ""
# enable user & permission to s3 (need to inject to all services)
enableAuth: false
# set to the name of an existing kubernetes Secret with the s3 json config file
# should have a secret key called seaweedfs_s3_config with an inline json configure
existingConfigSecret: null
auditLogConfig: {}
# You may specify buckets to be created during the install process.
# Buckets may be exposed publicly by setting anonymousRead to true
# createBuckets:
# - name: bucket-a
# anonymousRead: true
# - name: bucket-b
# anonymousRead: false
s3:
enabled: false
imageOverride: null
restartPolicy: null
replicas: 1
bindAddress: 0.0.0.0
port: 8333
add additional https port httpsPort: 0
metricsPort: 9327
loggingOverrideLevel: null
allow empty folders
enable user & permission to s3 (need to inject to all services)
set to the name of an existing kubernetes Secret with the s3 json config file
should have a secret key called seaweedfs_s3_config with an inline json config existingConfigSecret: null
auditLogConfig: {}
Suffix of the host name, {bucket}.{domainName}
@param s3.sidecars Add additional sidecar containers to the s3 pod(s)
e.g:
sidecars:
- name: your-image-name
image: your-image
imagePullPolicy: Always
ports:
- name: portname
containerPort: 1234
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
Labels to be added to the s3 pods
Annotations to be added to the s3 pods
Resource requests, limits, etc. for the server cluster placement. This
should map directly to the value of the resources field for a PodSpec,
formatted as a multi-line string. By default no direct resource request
is made.
Toleration Settings for server pods
This should be a multi-line string matching the Toleration array
in a PodSpec.
nodeSelector labels for server pod assignment, formatted as a muli-line string.
Example: nodeSelector: |
kubernetes.io/arch: amd64
nodeSelector: |
sw-backend: "true"
used to assign priority to server pods
used to assign a service account.
Configure security context for Pod
Example:
podSecurityContext:
enabled: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
Configure security context for Container
Example:
containerSecurityContext:
enabled: true
runAsUser: 2000
allowPrivilegeEscalation: false containerSecurityContext: {}
You can also use emptyDir storage:
logs:
type: "emptyDir" logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
used to configure livenessProbe on s3 containers
livenessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 60
successThreshold: 1
failureThreshold: 20
timeoutSeconds: 10
used to configure readinessProbe on s3 containers
readinessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
ingress:
enabled: false
className: "nginx"
# host: false for "*" hostname
host: "seaweedfs.cluster.local"
# additional ingress annotations for the s3 endpoint
annotations: {}
tls: []
Deploy Kubernetes COSI Driver for SeaweedFS
Requires COSI CRDs and controller to be installed in the cluster cosi:
enabled: false
image: "ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.1.2"
driverName: "seaweedfs.objectstorage.k8s.io"
bucketClassName: "seaweedfs"
endpoint: ""
region: ""
sidecar:
image: gcr.io/k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar:v20230130-v0.1.0-24-gc0cf995
enable user & permission to s3 (need to inject to all services)
set to the name of an existing kubernetes Secret with the s3 json config file
should have a secret key called seaweedfs_s3_config with an inline json configure existingConfigSecret: null
podSecurityContext: {}
containerSecurityContext: {}
extraVolumes: ""
extraVolumeMounts: ""
certificates:
commonName: "SeaweedFS CA"
ipAddresses: []
keyAlgorithm: RSA
keySize: 2048
duration: 2160h # 90d
renewBefore: 360h # 15d
externalCertificates:
# This will avoid the need to use cert-manager and will rely on providing your own external certificates and CA
# you will need to store your provided certificates in the secret read by the different services:
# seaweedfs-master-cert, seaweedfs-filer-cert, etc. Can see any statefulset definition to see secret names
enabled: false
Labels to be added to all the created pods
Annotations to be added to all the created pods
podAnnotations: {}
in order to be able to run thses commands: $ cd docs/getting-started
Create a namespace $ kubectl create namespace cortex
We can emulate S3 with SeaweedFS $ kubectl -n cortex apply -f seaweedfs.yaml
Wait for SeaweedFS to be ready $ kubectl -n cortex wait --for=condition=ready pod -l app=seaweedfs
Port-forward to SeaweedFS to create a bucket $ kubectl -n cortex port-forward svc/seaweedfs 8333
Create buckets in SeaweedFS c u r l − − a w s − s i g v 4 " a w s : a m z : l o c a l : s e a w e e d f s " − − u s e r " a n y : a n y " − X P U T h t t p : / / l o c a l h o s t : 8333 / c o r t e x − b l o c k s curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-blocks c u r l − − a w s − s i g v 4" a w s : am z : l oc a l : se a w ee df s " − − u ser " an y : an y " − X P U T h ttp : // l oc a l h os t : 8333/ cor t e x − b l oc k s curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-ruler
$ curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-alertmanager
Go step by step be thorough and accurate, thanks
Sure! I'll help you update your seaweedfs.yaml configuration to ensure it aligns with the provided commands for setting up SeaweedFS with S3 emulation. We'll go step-by-step to make sure everything is configured correctly.
1. Understanding the Requirements
Based on your commands, you intend to:
Set up a Kubernetes cluster using Kind.
Add necessary Helm repositories.
Create a cortex namespace.
Deploy SeaweedFS with S3 emulation enabled.
Port-forward the SeaweedFS service to your local machine.
Create S3 buckets using curl.
To achieve this, the seaweedfs.yaml Helm values file needs to be configured to:
Enable the S3 gateway.
Ensure the S3 service listens on port 8333.
Configure storage appropriately.
Disable ingress for S3 since you'll be using port-forwarding.
Set authentication as needed.
2. Updating the seaweedfs.yaml
Below is the updated seaweedfs.yaml with the necessary configurations:
yaml Copy code
---
# Updated SeaweedFS Helm Chart Values
global:
createClusterRole: true
registry: ""
repository: ""
imageName: chrislusf/seaweedfs
imagePullPolicy: IfNotPresent
imagePullSecrets: ""
restartPolicy: Always
loggingLevel: 1
enableSecurity: false
masterServer: null
securityConfig:
jwtSigning:
volumeWrite: true
volumeRead: false
filerWrite: false
filerRead: false
serviceAccountName: "seaweedfs"
automountServiceAccountToken: true
certificates:
alphacrds: false
monitoring:
enabled: false
gatewayHost: null
gatewayPort: null
additionalLabels: {}
enableReplication: false
replicationPlacment: "001"
extraEnvironmentVars:
WEED_CLUSTER_DEFAULT: "sw"
WEED_CLUSTER_SW_MASTER: "seaweedfs-master.seaweedfs:9333"
WEED_CLUSTER_SW_FILER: "seaweedfs-filer-client.seaweedfs:8888"
# WEED_JWT_SIGNING_KEY:
# secretKeyRef:
# name: seaweedfs-signing-key
# key: signingKey
image:
registry: ""
repository: ""
master:
enabled: true
imageOverride: null
restartPolicy: null
replicas: 1
port: 9333
grpcPort: 19333
metricsPort: 9327
ipBind: "0.0.0.0"
volumePreallocate: false
volumeSizeLimitMB: 1000
loggingOverrideLevel: null
pulseSeconds: null
garbageThreshold: null
metricsIntervalSec: 15
defaultReplication: "000"
disableHttp: false
config: |-
# Enter any extra configuration for master.toml here.
data:
type: "hostPath"
storageClass: ""
hostPathPrefix: /ssd
logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
podLabels: {}
podAnnotations: {}
podManagementPolicy: Parallel
resources: {}
updatePartition: 0
affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: master
topologyKey: kubernetes.io/hostname
tolerations: ""
nodeSelector: |
kubernetes.io/arch: amd64
priorityClassName: ""
serviceAccountName: ""
podSecurityContext: {}
containerSecurityContext: {}
ingress:
enabled: false
className: "nginx"
host: "master.seaweedfs.local"
annotations:
nginx.ingress.kubernetes.io/auth-type: "basic"
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Master'
nginx.ingress.kubernetes.io/service-upstream: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/configuration-snippet: |
sub_filter '<head>' '<head> <base href="/sw-master/">'; #add base url
sub_filter '="/' '="./'; #make absolute paths to relative
sub_filter '=/' '=./';
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
sub_filter_once off;
tls: []
extraEnvironmentVars:
WEED_MASTER_VOLUME_GROWTH_COPY_1: '7'
WEED_MASTER_VOLUME_GROWTH_COPY_2: '6'
WEED_MASTER_VOLUME_GROWTH_COPY_3: '3'
WEED_MASTER_VOLUME_GROWTH_COPY_OTHER: '1'
livenessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 10
readinessProbe:
enabled: true
httpGet:
path: /cluster/status
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 45
successThreshold: 2
failureThreshold: 100
timeoutSeconds: 10
volume:
enabled: true
imageOverride: null
restartPolicy: null
port: 8080
grpcPort: 18080
metricsPort: 9327
ipBind: "0.0.0.0"
replicas: 1
loggingOverrideLevel: null
pulseSeconds: null
index: null
fileSizeLimitMB: null
minFreeSpacePercent: 7
dataDirs:
- name: data1
type: "hostPath"
hostPathPrefix: /ssd
maxVolumes: 0
resizeHook:
enabled: true
image: bitnami/kubectl
idx: {}
logs: {}
compactionMBps: "50"
rack: null
dataCenter: null
readMode: proxy
whiteList: null
imagesFixOrientation: false
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
podLabels: {}
podAnnotations: {}
podManagementPolicy: Parallel
affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: volume
topologyKey: kubernetes.io/hostname
resources: {}
tolerations: ""
nodeSelector: |
kubernetes.io/arch: amd64
priorityClassName: ""
serviceAccountName: ""
extraEnvironmentVars:
podSecurityContext: {}
containerSecurityContext: {}
livenessProbe:
enabled: true
httpGet:
path: /healthz
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 90
successThreshold: 1
failureThreshold: 4
timeoutSeconds: 30
readinessProbe:
enabled: true
httpGet:
path: /healthz
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 30
filer:
enabled: true
imageOverride: null
restartPolicy: null
replicas: 1
port: 8888
grpcPort: 18888
metricsPort: 9327
loggingOverrideLevel: null
filerGroup: ""
defaultReplicaPlacement: "000"
disableDirListing: false
maxMB: null
encryptVolumeData: false
redirectOnRead: false
dirListLimit: 100000
disableHttp: false
enablePVC: false
storage: 25Gi
storageClass: null
data:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
podLabels: {}
podAnnotations: {}
podManagementPolicy: Parallel
affinity: |
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: filer
topologyKey: kubernetes.io/hostname
updatePartition: 0
resources: {}
tolerations: ""
nodeSelector: |
kubernetes.io/arch: amd64
priorityClassName: ""
serviceAccountName: ""
podSecurityContext: {}
containerSecurityContext: {}
ingress:
enabled: false
className: "nginx"
host: "seaweedfs.cluster.local"
annotations:
nginx.ingress.kubernetes.io/backend-protocol: GRPC
nginx.ingress.kubernetes.io/auth-type: "basic"
nginx.ingress.kubernetes.io/auth-secret: "default/ingress-basic-auth-secret"
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - SW-Filer'
nginx.ingress.kubernetes.io/service-upstream: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/enable-rewrite-log: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/configuration-snippet: |
sub_filter '<head>' '<head> <base href="/sw-filer/">'; #add base url
sub_filter '="/' '="./'; #make absolute paths to relative
sub_filter '=/' '=./';
sub_filter '/seaweedfsstatic' './seaweedfsstatic';
sub_filter_once off;
tls: []
extraEnvironmentVars:
WEED_MYSQL_ENABLED: "false"
WEED_MYSQL_HOSTNAME: "mysql-db-host"
WEED_MYSQL_PORT: "3306"
WEED_MYSQL_DATABASE: "sw_database"
WEED_MYSQL_CONNECTION_MAX_IDLE: "5"
WEED_MYSQL_CONNECTION_MAX_OPEN: "75"
WEED_MYSQL_CONNECTION_MAX_LIFETIME_SECONDS: "600"
WEED_MYSQL_INTERPOLATEPARAMS: "true"
WEED_LEVELDB2_ENABLED: "true"
WEED_FILER_OPTIONS_RECURSIVE_DELETE: "false"
WEED_FILER_BUCKETS_FOLDER: "/buckets"
livenessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 30
successThreshold: 1
failureThreshold: 5
timeoutSeconds: 10
readinessProbe:
enabled: true
httpGet:
path: /
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
secretExtraEnvironmentVars: {}
s3:
enabled: true # Enable the S3 gateway
imageOverride: null
restartPolicy: null
replicas: 1
bindAddress: 0.0.0.0
port: 8333 # Ensure it listens on port 8333
httpsPort: 0
metricsPort: 9327
loggingOverrideLevel: null
allowEmptyFolder: true # Allow creation of empty buckets
enableAuth: false # Disable authentication (set to true if needed)
existingConfigSecret: null
auditLogConfig: {}
domainName: ""
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
podLabels: {}
podAnnotations: {}
resources: {}
tolerations: ""
nodeSelector: |
kubernetes.io/arch: amd64
priorityClassName: ""
serviceAccountName: ""
podSecurityContext: {}
containerSecurityContext: {}
logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
extraEnvironmentVars:
livenessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 60
successThreshold: 1
failureThreshold: 20
timeoutSeconds: 10
readinessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
ingress:
enabled: false # Disable ingress for S3 to use port-forwarding
className: "nginx"
host: "seaweedfs.cluster.local"
annotations: {}
tls: []
s3:
enabled: true # Ensure global S3 is enabled
imageOverride: null
restartPolicy: null
replicas: 1
bindAddress: 0.0.0.0
port: 8333 # Port for S3 gateway
httpsPort: 0
metricsPort: 9327
loggingOverrideLevel: null
allowEmptyFolder: true # Allow empty folders
enableAuth: false # Disable authentication (set to true if needed)
existingConfigSecret: null
auditLogConfig: {}
domainName: ""
sidecars: []
initContainers: ""
extraVolumes: ""
extraVolumeMounts: ""
podLabels: {}
podAnnotations: {}
resources: {}
tolerations: ""
nodeSelector: |
kubernetes.io/arch: amd64
priorityClassName: ""
serviceAccountName: ""
podSecurityContext: {}
containerSecurityContext: {}
logs:
type: "hostPath"
size: ""
storageClass: ""
hostPathPrefix: /storage
extraEnvironmentVars:
livenessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 20
periodSeconds: 60
successThreshold: 1
failureThreshold: 20
timeoutSeconds: 10
readinessProbe:
enabled: true
httpGet:
path: /status
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 15
successThreshold: 1
failureThreshold: 100
timeoutSeconds: 10
ingress:
enabled: false # Disable ingress for S3 to use port-forwarding
className: "nginx"
host: "seaweedfs.cluster.local"
annotations: {}
tls: []
cosi:
enabled: false
image: "ghcr.io/seaweedfs/seaweedfs-cosi-driver:v0.1.2"
driverName: "seaweedfs.objectstorage.k8s.io"
bucketClassName: "seaweedfs"
endpoint: ""
region: ""
sidecar:
image: gcr.io/k8s-staging-sig-storage/objectstorage-sidecar/objectstorage-sidecar:v20230130-v0.1.0-24-gc0cf995
enableAuth: false
existingConfigSecret: null
podSecurityContext: {}
containerSecurityContext: {}
extraVolumes: ""
extraVolumeMounts: ""
certificates:
commonName: "SeaweedFS CA"
ipAddresses: []
keyAlgorithm: RSA
keySize: 2048
duration: 2160h # 90d
renewBefore: 360h # 15d
externalCertificates:
enabled: false
podLabels: {}
podAnnotations: {}
3. Detailed Changes Explained
Enable S3 Gateway :
Section : s3 and nested under filer.
Changes :
Set enabled: true to activate the S3 gateway.
Ensure port: 8333 is set for S3 access.
Set allowEmptyFolder: true to permit the creation of empty buckets.
Disabled authentication by setting enableAuth: false. If you require authentication, set this to true and configure accordingly.
Disable Ingress for S3 :
Section : s3.ingress.
Changes :
Set enabled: false to disable ingress. This allows you to use kubectl port-forward instead of exposing S3 via ingress.
Service Configuration :
Ensured that both filer and s3 sections have the correct configurations for ports and storage paths.
Used hostPath storage for simplicity. For production environments, consider using persistentVolumeClaim with appropriate storage classes.
Probe Configurations :
Configured livenessProbe and readinessProbe for both master, volume, filer, and s3 to ensure Kubernetes can monitor the health of the pods.
Environment Variables :
Added relevant environment variables under each section to configure SeaweedFS properly.
Sidecars and Init Containers :
Left sidecars and initContainers empty as they're optional. You can add additional containers here if needed.
Affinities and Tolerations :
Configured affinity to ensure pods are scheduled appropriately.
Left tolerations empty; add them if you have node taints.
4. Step-by-Step Instructions
Now, follow these steps to set up SeaweedFS with S3 emulation:
a. Setup Kind Cluster
bash Copy code
$ kind create cluster
b. Configure Helm Repositories
bash Copy code
$ helm repo add cortex-helm https://cortexproject.github.io/cortex-helm-chart
$ helm repo add grafana https://grafana.github.io/helm-charts
$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
$ helm repo update
c. Create Namespace
bash Copy code
$ kubectl create namespace cortex
d. Apply the Updated SeaweedFS Configuration
Save the updated YAML to a file named seaweedfs.yaml, then apply it:
bash Copy code
$ kubectl -n cortex apply -f seaweedfs.yaml
e. Wait for SeaweedFS Pods to be Ready
bash Copy code
$ kubectl -n cortex wait --for=condition=ready pod -l app=seaweedfs
Note : Ensure that the label app=seaweedfs correctly matches the labels in your deployed pods. Adjust if necessary.
f. Port-Forward the SeaweedFS S3 Service
Forward port 8333 from the SeaweedFS service to your local machine:
bash Copy code
$ kubectl -n cortex port-forward svc/seaweedfs 8333:8333
Note : This command will run in the foreground. It's recommended to run it in a separate terminal window or as a background process.
g. Create S3 Buckets Using curl
In a separate terminal, execute the following commands to create the necessary S3 buckets:
bash Copy code
$ curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-blocks
$ curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-ruler
$ curl --aws-sigv4 "aws:amz:local:seaweedfs" --user "any:any" -X PUT http://localhost:8333/cortex-alertmanager
Explanation of the curl Command :
--aws-sigv4 "aws:amz:local:seaweedfs": Specifies AWS signature version 4 with custom credentials and endpoint.
--user "any:any": Uses any as both the access key and secret key.
-X PUT: Executes a PUT request to create a bucket.
5. Verification
After running the above commands:
Check Pods Status :
bash Copy code
$ kubectl -n cortex get pods
Ensure all SeaweedFS-related pods are in the RUNNING state.
Verify S3 Buckets :
You can list the created buckets by interacting with the SeaweedFS S3 gateway or using compatible S3 clients.
6. Additional Considerations
Authentication : If you wish to secure your S3 gateway, set enableAuth: true and configure the necessary credentials in the seaweedfs.yaml. Update the curl commands accordingly with valid credentials.
Persistent Storage : The current configuration uses hostPath for simplicity. For production environments, consider configuring persistentVolumeClaim with appropriate storage classes to ensure data persistence across pod restarts.
Monitoring & Logging : Enable monitoring and logging if required by setting monitoring.enabled: true and configuring the respective sections.
Resource Allocation : Adjust resource requests and limits under each section (master, volume, filer, s3) based on your cluster's capacity and performance requirements.
Security Contexts : Configure podSecurityContext and containerSecurityContext for enhanced security based on your organizational policies.
7. Troubleshooting
Pods Not Starting : Check pod logs for any errors:
bash Copy code
$ kubectl -n cortex logs <pod-name>
Port-Forward Issues : Ensure no other service is using port 8333 on your local machine. Adjust if necessary.
Bucket Creation Errors : Verify the S3 gateway is running correctly and ports are set up as expected.
8. Summary
By following the updated seaweedfs.yaml and the step-by-step instructions, you should be able to successfully deploy SeaweedFS with S3 emulation on your Kubernetes cluster using Kind. This setup allows you to interact with SeaweedFS as if it were an S3-compatible storage service, enabling you to create and manage buckets as demonstrated with the curl commands.
If you encounter any issues or need further assistance, feel free to ask!
Show full message · 676 lines Copy first response
Not yet included in a published release.