mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 04:06:34 +09:00
fix(seaweedfs): enforce S3 bucket lifecycle rules (#5228)
<!-- Thank you for making a contribution! Here are some tips for you:
- Use Conventional Commits for the PR title: `type(scope): description`
- Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore
- Scopes are not an exhaustive list — pick the most specific scope for
the change and extend the list when a genuinely new area appears.
Examples:
- System components: dashboard, platform, operator, cilium, kube-ovn,
linstor, fluxcd, cluster-api
- Managed apps: postgres, mariadb, redis, kafka, clickhouse,
virtual-machine, kubernetes
- Development and maintenance: api, hack, tests, ci, docs, maintenance
- Breaking changes: append `!` after type/scope (`feat(api)!: ...`) or
add a `BREAKING CHANGE:` footer
- If it's a work in progress, consider creating this PR as a draft.
- Don't hesistate to ask for opinion and review in the community chats,
even if it's still a draft.
- Add the label `kind/backport` if it's a bugfix that needs to be
backported to a previous version.
-->
## What this PR does
SeaweedFS accepts and stores an S3 bucket lifecycle configuration, but
only the `s3_lifecycle` job of its plugin worker applies it, and that
job is scheduled by the admin server. Cozystack deployed neither, so a
lifecycle rule returned 200 and no object ever expired, on the platform
backup bucket and on tenant buckets alike. That also made the documented
way to bound backup storage a no-op.
This PR adds the admin server and a worker to Simple and MultiZone
SeaweedFS instances, behind a new `lifecycle.enabled` value that is
**off by default**. A Client instance is unchanged, because its rules
are enforced where the instance it connects to runs. The worker
registers for `s3_lifecycle` only, so vacuum, balancing and erasure
coding are not started as a side effect. The admin keeps its job state
on a 1Gi volume on `lifecycle.storageClass`, or on the cluster default
when that is empty; `volume.storageClass` is not reused, because in
MultiZone it can name a class local to one zone or node. The admin UI is
protected by a generated password, because a tenant namespace admits
traffic from the whole cluster. The dashboard Role lists the two new
WorkloadMonitors.
Enabling the worker alone was not enough on SeaweedFS 4.45. Its chart
renders no `[grpc.s3]` section, so the s3 gateway served its internal
gRPC in plaintext while the worker dials it with mTLS, and every
lifecycle delete failed the TLS handshake. The section is backported
from upstream (seaweedfs/seaweedfs#11157, released in 4.46) as a chart
patch, applied with `--forward` so the next `make update` stops at the
point where the patch must be dropped instead of silently reversing it.
The s3 pods are restarted once so they load the section. This also
repairs IAM cache propagation between s3 replicas, which failed in the
same way, and it applies whether or not lifecycle is enabled.
The data-plane release now retries a failed install or upgrade in place
(`RetryOnFailure`) instead of rolling it back. With the previous default
remediation and unlimited retries, an upgrade that waited out its
timeout, for example on a tenant quota with no room for the admin
volume, rolled back and retried forever, restarting the s3 pods twice
per cycle. The worker's hostname anti-affinity is relaxed to a
preference so a rollout finishes on a single-node cluster.
#### Why lifecycle is off by default
The daily walk that SeaweedFS uses to expire objects sends its deletes
without an object identity, and the s3 server skips its compare-and-swap
when no identity is given; it does not re-check the object's age either.
A key overwritten between the walk's listing and the delete loses its
new content. This path is unchanged from 4.45 through 4.52 and on
upstream master (`weed/s3api/s3lifecycle/dailyrun/walker_dispatcher.go`,
`identityMatches` in `weed/s3api/s3api_internal_lifecycle.go`). Backup
buckets write unique keys and are barely exposed; a tenant bucket that
rewrites a fixed key is. On top of that, turning enforcement on would
start applying, on upgrade, every rule that was stored and ignored until
now. Both are retention changes an operator should choose, so nothing
changes for existing instances until `lifecycle.enabled` is set. Making
it the default again is left to a separate PR that carries object
identity on the walk path; upstream report:
https://github.com/seaweedfs/seaweedfs/issues/12451.
#### Turning lifecycle on and off
When `lifecycle.enabled` is set, rules that have been stored but ignored
start applying within minutes, and objects they have already expired are
deleted on that first pass, so review existing bucket lifecycle rules
first. Set `lifecycle.storageClass` before enabling, and prefer a
replicated class: the class is part of the admin StatefulSet's volume
claim template, which cannot change, so changing it while lifecycle is
on makes every upgrade of the instance fail until it is reverted. Moving
the volume means disabling lifecycle, deleting the
`admin-data-seaweedfs-admin-0` PVC, changing the class and enabling
lifecycle again. Each instance gains two small pods and a 1Gi PVC; when
the tenant quota has no room for them, the data-plane release keeps
retrying in place until it has.
When `lifecycle.enabled` is turned off again, the parent release removes
the admin credentials Secret while the data-plane release removes the
admin StatefulSet only on its own reconcile, shortly after. An admin pod
that restarts in that window fails to start on the missing Secret until
the StatefulSet is gone; nothing is lost, and the order is left as is.
The admin PVC stays until the instance is deleted, and a later re-enable
starts the admin with a new password.
Verified on a test cluster with the 4.45 chart: without the backport,
the worker found the expired objects and every delete failed with `tls:
first record does not look like a TLS handshake`; with this branch and
lifecycle enabled, a rule with a past expiration date removed the
matching objects and left the others, both on a manual run and on the
first scheduled pass.
### Screenshots
<!-- REQUIRED for UI changes: attach screenshots or screen recordings
demonstrating
the visual impact of your changes. PRs with UI changes without
screenshots will not be merged. -->
### Downstream repositories
<!--
Cozystack is upstream for repositories that are NOT kept in sync with it
automatically, and nothing in CI compares the two sides, so a change
here can break them silently.
Which change forces what, and which file to touch, is the trigger map in
docs/agents/contributing.md under "Downstream Repositories". Walk it
before you tick anything.
IF YOU ARE AN AI AGENT OR AN LLM, THIS IS PART OF THE TASK, NOT A FORM
TO FILL IN:
1. Walk the trigger map against the actual diff of this PR, file by
file. Do not decide from the PR title or from your memory of what you
changed.
2. For every repository you tick, open the follow-up PR there and link
it on the same line. A ticked box with no link claims work that does not
exist, which is worse than an empty box. Search that repository for an
open PR or issue covering it first, and link that instead of filing a
duplicate.
3. When the follow-up is out of scope, or needs a decision that is not
yours to make, open an issue in that repository instead, link that, and
say so in the PR body. Do not push a speculative PR into another
repository just to fill a line here.
4. Do not tick "No downstream repository is affected" to make the
checklist go away. If you are unsure, leave every box empty and say so
in the PR body, so a human decides.
-->
- [ ] No downstream repository is affected by this change
- [ ] [cozystack/website](https://github.com/cozystack/website) -
follow-up needed, not opened yet:
`operations/services/backup-classes.md` (v1.7 and next) advises an S3
lifecycle policy, which the bundled SeaweedFS applies only once
`lifecycle.enabled` is set; the SeaweedFS reference page gains
`lifecycle.enabled` and `lifecycle.storageClass` from the regenerated
README on the next release
- [ ]
[cozystack/terraform-provider-cozystack](https://github.com/cozystack/terraform-provider-cozystack)
- follow-up:
- [ ]
[cozystack/ansible-cozystack](https://github.com/cozystack/ansible-cozystack)
- follow-up:
- [ ] [cozystack/ccp](https://github.com/cozystack/ccp) - follow-up:
- [ ] [cozystack/talm](https://github.com/cozystack/talm) - follow-up:
- [ ] [cozystack/cozyhr](https://github.com/cozystack/cozyhr) -
follow-up:
- [ ] [cozystack/cozy-proxy](https://github.com/cozystack/cozy-proxy) -
follow-up:
- [ ]
[cozystack/cozystack-telemetry-server](https://github.com/cozystack/cozystack-telemetry-server)
- follow-up:
- [ ]
[cozystack/external-apps-example](https://github.com/cozystack/external-apps-example)
- follow-up:
- [ ] [cozystack/examples](https://github.com/cozystack/examples) -
follow-up:
- [ ] [cozystack/community](https://github.com/cozystack/community) -
follow-up:
The terraform provider does not model the SeaweedFS application, so the
new values do not reach it.
### Release note
<!-- Write a release note:
- Explain what has changed internally and for users.
- Start with the same `type(scope):` prefix as in the PR title
- Follow the guidelines at
https://github.com/kubernetes/community/blob/master/contributors/guide/release-notes.md.
-->
```release-note
fix(seaweedfs): S3 bucket lifecycle rules can now be enforced. Simple and MultiZone SeaweedFS instances run the SeaweedFS admin server and a lifecycle worker when the new `lifecycle.enabled` value is set; it is off by default, so existing instances keep their current behaviour. It stays off by default because the upstream daily expiry walk deletes without checking that the object it listed is still the one stored, so an object overwritten in that window can be deleted although it is new. When enabled, rules that were stored but ignored start applying within minutes and objects they have already expired are deleted on that first pass; review existing rules first. Each enabled instance gains two small pods and a 1Gi volume, placed on `lifecycle.storageClass` or the cluster default. Independently of the switch, the s3 gateway now serves its internal gRPC over mTLS, which repairs IAM cache propagation between s3 replicas and restarts the s3 pods once on upgrade.
```
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->
## Summary by CodeRabbit
* **New Features**
* Added optional, daily S3 bucket lifecycle-rule processing for
supported SeaweedFS configurations. It is disabled by default; Client
instances rely on lifecycle rules configured on the connected SeaweedFS.
* Added configurable storage for lifecycle job state and dashboard
visibility for lifecycle components.
* Enabled the S3 gRPC server to use its internal TLS identity when
security is configured.
* **Bug Fixes**
* Improved storage-class handling so numeric-looking names remain
strings and unset classes are omitted where appropriate.
* Clarified backup cleanup guidance, including when lifecycle rules
apply and how to reclaim storage.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Backported-from: 238b3ee491
This commit is contained in:
30 files changed
+1229
-29
No files matched your search
@@ -71,9 +71,6 @@ The script:
|
||||
had already replayed. The Pod log names each topic before its replay and
|
||||
again once it landed; empty or delete every topic it shows as started, not
|
||||
only the one the refusal names, then re-run.
|
||||
- The tarball in object storage is not managed by the Cozystack `Backup`
|
||||
lifecycle: deleting the `Backup` CR removes the reference but leaves the S3
|
||||
object in place. Tenants who need to reclaim space should delete the object
|
||||
(or set a bucket lifecycle policy).
|
||||
- The tarball in object storage is not managed by the Cozystack `Backup` lifecycle: deleting the `Backup` CR removes the reference but leaves the S3 object in place. Tenants who need to reclaim space should delete the object, or set a lifecycle rule on the bucket. A Simple or MultiZone Cozystack SeaweedFS applies such rules once a day only while its `lifecycle.enabled` is on, which is not the default; a Client instance applies none itself, so the SeaweedFS it connects to must have `lifecycle.enabled` on. Another object store applies them only if it implements bucket lifecycle.
|
||||
- Consumer-group offsets, topic configs, ACLs and users are not part of the
|
||||
backup; consumers start from the restored topic's fresh offsets.
|
||||
@@ -55,9 +55,6 @@ The script:
|
||||
|
||||
- Both flows rely on the strategy template branching on `.Mode`. See
|
||||
`01-create-strategy.sh`.
|
||||
- The tarball in object storage is not managed by the Cozystack `Backup`
|
||||
lifecycle: deleting the `Backup` CR removes the reference but leaves the S3
|
||||
object in place. Tenants who need to reclaim space should delete the object
|
||||
(or set a bucket lifecycle policy).
|
||||
- The tarball in object storage is not managed by the Cozystack `Backup` lifecycle: deleting the `Backup` CR removes the reference but leaves the S3 object in place. Tenants who need to reclaim space should delete the object, or set a lifecycle rule on the bucket. A Simple or MultiZone Cozystack SeaweedFS applies such rules once a day only while its `lifecycle.enabled` is on, which is not the default; a Client instance applies none itself, so the SeaweedFS it connects to must have `lifecycle.enabled` on. Another object store applies them only if it implements bucket lifecycle.
|
||||
- `nats stream restore` recreates the stream's configuration from the snapshot;
|
||||
consumers are restored as captured at backup time.
|
||||
@@ -1376,9 +1376,10 @@ func (r *BackupJobReconciler) createMongoDBBackupArtifact(
|
||||
// annotation (honoured before any apiserver read, so it still frees a Backup
|
||||
// whose operator CR has become unreadable) and a going-away namespace (the psmdb
|
||||
// delete-backup exec cannot run there) each make the driver strip its own
|
||||
// finalizer and release, leaving the object for a bucket lifecycle policy. This
|
||||
// bounds only what the driver contributes: a Get that fails with something other
|
||||
// than NotFound/NoMatchError still requeues (below), and the psmdb operator's own
|
||||
// finalizer and release, leaving the object to manual cleanup, or to a
|
||||
// lifecycle rule on the bucket where the object store applies one. This bounds
|
||||
// only what the driver contributes: a Get that fails with something other than
|
||||
// NotFound/NoMatchError still requeues (below), and the psmdb operator's own
|
||||
// release-lock finalizer keeps the CR Terminating while the operator is down,
|
||||
// whatever the driver strips. A down operator in a live namespace is likewise
|
||||
// not auto-released: the Backup stays Terminating as a visible signal until an
|
||||
|
||||
@@ -78,4 +78,7 @@
|
||||
| `s3.resources.cpu` | Number of CPU cores allocated. | `quantity` | `""` |
|
||||
| `s3.resources.memory` | Amount of memory allocated. | `quantity` | `""` |
|
||||
| `s3.resourcesPreset` | Default sizing preset used when `resources` is omitted. | `string` | `t1.small` |
|
||||
| `lifecycle` | S3 bucket lifecycle configuration. | `object` | `{}` |
|
||||
| `lifecycle.enabled` | Run the SeaweedFS admin server and a worker that applies bucket lifecycle rules, once a day. When disabled, rules are still accepted and stored, but not applied. Ignored with the Client topology, whose rules are enforced by the instance it connects to. Rules stored before enabling are applied on the first pass, minutes after the switch. While on, in a bucket without versioning enabled, an object overwritten between the daily listing and its expiry delete can be deleted although it is new. | `bool` | `false` |
|
||||
| `lifecycle.storageClass` | StorageClass of the admin server's 1Gi job-state volume. Empty uses the cluster default; `volume.storageClass` is not used, because in MultiZone it can be local to one zone. Prefer a replicated class: on a node-local one, losing the node stops lifecycle enforcement. Set it before enabling lifecycle: the class is part of the admin StatefulSet's volume claim template, which cannot change, so changing it while lifecycle is on makes every upgrade of the instance fail until it is reverted. To move the volume, disable lifecycle, delete the `admin-data-seaweedfs-admin-0` PVC of the instance, change the class and enable lifecycle again. | `string` | `""` |
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{{- if and .Values.lifecycle.enabled (ne .Values.topology "Client") }}
|
||||
{{- $name := printf "%s-admin-credentials" .Release.Name }}
|
||||
{{- /* The admin reads these into its environment when it starts and nothing
|
||||
restarts it on a Secret change, so a password regenerated on every render
|
||||
would leave the Secret holding one the running server does not accept.
|
||||
Keep the one already issued. */}}
|
||||
{{- $password := randAlphaNum 40 | b64enc }}
|
||||
{{- with lookup "v1" "Secret" .Release.Namespace $name }}
|
||||
{{- with (dig "data" "adminPassword" "" .) }}
|
||||
{{- $password = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ $name }}
|
||||
type: Opaque
|
||||
data:
|
||||
adminUser: {{ "admin" | b64enc }}
|
||||
adminPassword: {{ $password }}
|
||||
{{- end }}
|
||||
@@ -27,6 +27,10 @@ rules:
|
||||
- {{ $.Release.Name }}-filer
|
||||
- {{ $.Release.Name }}-db
|
||||
- {{ $.Release.Name }}-s3
|
||||
{{- if .Values.lifecycle.enabled }}
|
||||
- {{ $.Release.Name }}-admin
|
||||
- {{ $.Release.Name }}-worker
|
||||
{{- end }}
|
||||
{{- if eq .Values.topology "Simple" }}
|
||||
- {{ $.Release.Name }}-volume
|
||||
{{- range $poolName, $pool := .Values.volume.pools }}
|
||||
|
||||
@@ -42,6 +42,6 @@ spec:
|
||||
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.db.resourcesPreset .Values.db.resources $) | nindent 8 }}
|
||||
size: {{ .Values.db.size }}
|
||||
{{- with .Values.db.storageClass }}
|
||||
storageClass: {{ . }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -214,10 +214,21 @@ spec:
|
||||
namespace: cozy-system
|
||||
interval: 30s
|
||||
timeout: 10m
|
||||
{{- /* Flux remediates a failed install by uninstalling and a failed upgrade
|
||||
by rolling back, and with retries: -1 it does so on every attempt. A
|
||||
release waiting on tenant quota for the admin volume would then roll
|
||||
the s3 pods back and forth with the [grpc.s3] restart annotation.
|
||||
RetryOnFailure keeps what was applied and retries it. */}}
|
||||
install:
|
||||
strategy:
|
||||
name: RetryOnFailure
|
||||
retryInterval: 30s
|
||||
remediation:
|
||||
retries: -1
|
||||
upgrade:
|
||||
strategy:
|
||||
name: RetryOnFailure
|
||||
retryInterval: 30s
|
||||
remediation:
|
||||
retries: -1
|
||||
valuesFrom:
|
||||
@@ -249,7 +260,7 @@ spec:
|
||||
type: "persistentVolumeClaim"
|
||||
size: "{{ .Values.volume.size }}"
|
||||
{{- with .Values.volume.storageClass }}
|
||||
storageClass: {{ . }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
maxVolumes: 0
|
||||
{{- if .Values.volume.diskType }}
|
||||
@@ -268,7 +279,7 @@ spec:
|
||||
type: "persistentVolumeClaim"
|
||||
size: "{{ $pool.size | default $.Values.volume.size }}"
|
||||
{{- with ($pool.storageClass | default $.Values.volume.storageClass) }}
|
||||
storageClass: "{{ . }}"
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
maxVolumes: 0
|
||||
extraArgs:
|
||||
@@ -284,7 +295,7 @@ spec:
|
||||
type: "persistentVolumeClaim"
|
||||
size: "{{ $zone.size | default $.Values.volume.size }}"
|
||||
{{- with ($zone.storageClass | default $.Values.volume.storageClass) }}
|
||||
storageClass: "{{ . }}"
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
maxVolumes: 0
|
||||
nodeSelector: |
|
||||
@@ -309,7 +320,7 @@ spec:
|
||||
type: "persistentVolumeClaim"
|
||||
size: "{{ $pool.size | default $zone.size | default $.Values.volume.size }}"
|
||||
{{- with ($pool.storageClass | default $zone.storageClass | default $.Values.volume.storageClass) }}
|
||||
storageClass: "{{ . }}"
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
maxVolumes: 0
|
||||
nodeSelector: |
|
||||
@@ -371,6 +382,16 @@ spec:
|
||||
secretName: {{ .Release.Name }}-s3-ingress-tls
|
||||
{{- end }}
|
||||
resources: {{- include "cozy-lib.resources.defaultingSanitize" (list .Values.s3.resourcesPreset .Values.s3.resources $) | nindent 10 }}
|
||||
admin:
|
||||
enabled: {{ .Values.lifecycle.enabled }}
|
||||
secret:
|
||||
existingSecret: {{ .Release.Name }}-admin-credentials
|
||||
{{- with .Values.lifecycle.storageClass }}
|
||||
data:
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
worker:
|
||||
enabled: {{ .Values.lifecycle.enabled }}
|
||||
cosi:
|
||||
driverName: "{{ .Release.Namespace }}.seaweedfs.objectstorage.k8s.io"
|
||||
bucketClassName: "{{ .Release.Namespace }}"
|
||||
@@ -503,4 +524,22 @@ spec:
|
||||
app.kubernetes.io/component: s3
|
||||
app.kubernetes.io/name: seaweedfs
|
||||
version: {{ $.Chart.Version }}
|
||||
{{- if .Values.lifecycle.enabled }}
|
||||
{{- range $component := list "admin" "worker" }}
|
||||
---
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
kind: WorkloadMonitor
|
||||
metadata:
|
||||
name: {{ $.Release.Name }}-{{ $component }}
|
||||
spec:
|
||||
replicas: 1
|
||||
minReplicas: 1
|
||||
kind: seaweedfs
|
||||
type: {{ $component }}
|
||||
selector:
|
||||
app.kubernetes.io/component: {{ $component }}
|
||||
app.kubernetes.io/name: seaweedfs
|
||||
version: {{ $.Chart.Version }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,30 @@
|
||||
suite: seaweedfs metadata database storage class reaches its release as a string
|
||||
|
||||
templates:
|
||||
- templates/seaweedfs-db.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
# A StorageClass name may be all digits; handed on unquoted it reaches the
|
||||
# database release as a number, and a line break in it would open new keys
|
||||
# in that release's values.
|
||||
- it: hands a numeric storage class name on as a string
|
||||
set:
|
||||
db:
|
||||
storageClass: "123"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.db.storageClass
|
||||
value: "123"
|
||||
|
||||
- it: keeps a storage class with a line break inside its own field
|
||||
set:
|
||||
db:
|
||||
storageClass: "local\n replicas: 9"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.db.storageClass
|
||||
value: "local\n replicas: 9"
|
||||
@@ -0,0 +1,330 @@
|
||||
suite: seaweedfs lifecycle switch reaches the data plane
|
||||
|
||||
# lifecycle.enabled decides whether the data-plane release runs the admin
|
||||
# server and the worker that enforce bucket lifecycle rules. Both flags are
|
||||
# sent either way, so the data-plane chart's own default never decides.
|
||||
|
||||
templates:
|
||||
- templates/seaweedfs.yaml
|
||||
- templates/admin-credentials.yaml
|
||||
- templates/dashboard-resourcemap.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
# The upstream walker deletes without an object identity, so a key
|
||||
# overwritten between its listing and the delete RPC goes too. Applying
|
||||
# stored rules is therefore an operator's decision, not an upgrade's.
|
||||
- it: keeps the lifecycle admin and worker off by default
|
||||
template: templates/seaweedfs.yaml
|
||||
set: &platform
|
||||
_namespace:
|
||||
host: example.org
|
||||
ingress: tenant-root
|
||||
_cluster:
|
||||
issuer-name: letsencrypt-prod
|
||||
solver: http01
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.enabled
|
||||
value: false
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.worker.enabled
|
||||
value: false
|
||||
|
||||
- it: runs the lifecycle admin and worker when lifecycle is enabled
|
||||
template: templates/seaweedfs.yaml
|
||||
set: &enabled
|
||||
<<: *platform
|
||||
lifecycle:
|
||||
enabled: true
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.enabled
|
||||
value: true
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.worker.enabled
|
||||
value: true
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.secret.existingSecret
|
||||
value: seaweedfs-admin-credentials
|
||||
|
||||
- it: turns both off when lifecycle is disabled
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *platform
|
||||
lifecycle:
|
||||
enabled: false
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.enabled
|
||||
value: false
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.worker.enabled
|
||||
value: false
|
||||
|
||||
# volume.storageClass is chosen for volume data, and in MultiZone it can be
|
||||
# a class local to one zone, while the admin is not pinned to any zone. Its
|
||||
# volume therefore takes its own class, and the cluster default otherwise.
|
||||
- it: puts the admin volume on the lifecycle storage class
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
lifecycle:
|
||||
enabled: true
|
||||
storageClass: replicated
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.data.storageClass
|
||||
value: replicated
|
||||
|
||||
- it: does not put the admin volume on the volume storage class
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
topology: MultiZone
|
||||
replicationFactor: 1
|
||||
volume:
|
||||
storageClass: zone-a-local
|
||||
zones:
|
||||
a: {}
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.values.seaweedfs.admin.data
|
||||
|
||||
- it: leaves the admin volume on the cluster default when lifecycle names none
|
||||
template: templates/seaweedfs.yaml
|
||||
set: *enabled
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.values.seaweedfs.admin.data
|
||||
|
||||
# A StorageClass name may be all digits. Handed on unquoted it reaches the
|
||||
# data-plane release as a number, and the claim it ends up in is rejected.
|
||||
- it: hands a numeric storage class name on as a string
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
lifecycle:
|
||||
enabled: true
|
||||
storageClass: "123"
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.admin.data.storageClass
|
||||
value: "123"
|
||||
|
||||
- it: refuses a storage class that is not a StorageClass name
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
lifecycle:
|
||||
enabled: true
|
||||
storageClass: "replicated\n image:\n repository: example/other"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "/lifecycle/storageClass"
|
||||
|
||||
- it: refuses a storage class longer than a StorageClass name can be
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
lifecycle:
|
||||
enabled: true
|
||||
storageClass: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
asserts:
|
||||
- failedTemplate:
|
||||
errorPattern: "/lifecycle/storageClass"
|
||||
|
||||
- it: monitors the admin and the worker while lifecycle is on
|
||||
template: templates/seaweedfs.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: WorkloadMonitor
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
name: seaweedfs-admin
|
||||
any: true
|
||||
- containsDocument:
|
||||
kind: WorkloadMonitor
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
name: seaweedfs-worker
|
||||
any: true
|
||||
- equal:
|
||||
path: spec.selector
|
||||
value:
|
||||
app.kubernetes.io/component: worker
|
||||
app.kubernetes.io/name: seaweedfs
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-worker
|
||||
- equal:
|
||||
path: spec.selector
|
||||
value:
|
||||
app.kubernetes.io/component: admin
|
||||
app.kubernetes.io/name: seaweedfs
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-admin
|
||||
|
||||
- it: does not monitor them when lifecycle is off
|
||||
template: templates/seaweedfs.yaml
|
||||
set:
|
||||
<<: *platform
|
||||
lifecycle:
|
||||
enabled: false
|
||||
asserts:
|
||||
- containsDocument:
|
||||
kind: WorkloadMonitor
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
name: seaweedfs-admin
|
||||
any: true
|
||||
not: true
|
||||
- containsDocument:
|
||||
kind: WorkloadMonitor
|
||||
apiVersion: cozystack.io/v1alpha1
|
||||
name: seaweedfs-worker
|
||||
any: true
|
||||
not: true
|
||||
|
||||
- it: generates admin credentials for a new instance
|
||||
template: templates/admin-credentials.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- isKind:
|
||||
of: Secret
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: seaweedfs-admin-credentials
|
||||
- equal:
|
||||
path: data.adminUser
|
||||
value: YWRtaW4=
|
||||
- matchRegex:
|
||||
path: data.adminPassword
|
||||
pattern: '^.{40,}$'
|
||||
|
||||
# A new password on every render would leave the running admin on the old
|
||||
# one, since it reads the Secret into its environment once at start.
|
||||
- it: keeps the password of an existing Secret
|
||||
template: templates/admin-credentials.yaml
|
||||
set: *enabled
|
||||
kubernetesProvider:
|
||||
scheme:
|
||||
"v1/Secret":
|
||||
gvr:
|
||||
version: v1
|
||||
resource: secrets
|
||||
namespaced: true
|
||||
objects:
|
||||
- apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: seaweedfs-admin-credentials
|
||||
namespace: tenant-root
|
||||
data:
|
||||
adminUser: YWRtaW4=
|
||||
adminPassword: a2VwdA==
|
||||
asserts:
|
||||
- equal:
|
||||
path: data.adminPassword
|
||||
value: a2VwdA==
|
||||
|
||||
- it: renders no credentials when lifecycle is off
|
||||
template: templates/admin-credentials.yaml
|
||||
set:
|
||||
<<: *platform
|
||||
lifecycle:
|
||||
enabled: false
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
# A Client instance runs no data plane of its own; its rules are enforced
|
||||
# where the master it points at runs.
|
||||
- it: renders no credentials for a Client instance
|
||||
template: templates/admin-credentials.yaml
|
||||
set:
|
||||
<<: *enabled
|
||||
topology: Client
|
||||
filer:
|
||||
grpcHost: seaweedfs-filer.tenant-other.svc
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
|
||||
# The admin PVC and the two lifecycle pods can leave an upgrade waiting on a
|
||||
# full tenant quota. Under Flux's default rollback remediation each failed
|
||||
# attempt would roll back the [grpc.s3] section and its restart annotation
|
||||
# and the next one would bring them back, restarting the s3 pods on every
|
||||
# cycle. Retrying in place keeps what was applied while the release waits.
|
||||
- it: retries the data-plane release in place instead of rolling it back
|
||||
template: templates/seaweedfs.yaml
|
||||
set: *platform
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.install.strategy.name
|
||||
value: RetryOnFailure
|
||||
- equal:
|
||||
path: spec.upgrade.strategy.name
|
||||
value: RetryOnFailure
|
||||
- equal:
|
||||
path: spec.upgrade.remediation.retries
|
||||
value: -1
|
||||
|
||||
# The dashboard reads each WorkloadMonitor by name through this Role, so a
|
||||
# monitor missing from it never shows up for the tenant.
|
||||
- it: lets the dashboard read the admin and worker monitors
|
||||
template: templates/dashboard-resourcemap.yaml
|
||||
set: *enabled
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: Role
|
||||
asserts:
|
||||
- contains:
|
||||
path: rules[2].resourceNames
|
||||
content: seaweedfs-admin
|
||||
- contains:
|
||||
path: rules[2].resourceNames
|
||||
content: seaweedfs-worker
|
||||
|
||||
- it: grants no lifecycle monitors when lifecycle is off
|
||||
template: templates/dashboard-resourcemap.yaml
|
||||
set:
|
||||
<<: *platform
|
||||
lifecycle:
|
||||
enabled: false
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: Role
|
||||
asserts:
|
||||
- notContains:
|
||||
path: rules[2].resourceNames
|
||||
content: seaweedfs-admin
|
||||
- notContains:
|
||||
path: rules[2].resourceNames
|
||||
content: seaweedfs-worker
|
||||
@@ -0,0 +1,102 @@
|
||||
suite: seaweedfs volume storage class reaches the data plane as a string
|
||||
|
||||
templates:
|
||||
- templates/seaweedfs.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs
|
||||
namespace: tenant-root
|
||||
|
||||
set: &platform
|
||||
_namespace:
|
||||
host: example.org
|
||||
ingress: tenant-root
|
||||
_cluster:
|
||||
issuer-name: letsencrypt-prod
|
||||
solver: http01
|
||||
|
||||
tests:
|
||||
- it: hands a numeric storage class name on as a string
|
||||
set:
|
||||
<<: *platform
|
||||
volume:
|
||||
storageClass: "123"
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.volume.dataDirs[0].storageClass
|
||||
value: "123"
|
||||
|
||||
# The value is written into the values of another release; a line break in
|
||||
# it must not open new keys there.
|
||||
- it: keeps a storage class with a line break inside its own field
|
||||
set:
|
||||
<<: *platform
|
||||
volume:
|
||||
storageClass: "local\n image: example/other"
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.volume.dataDirs[0].storageClass
|
||||
value: "local\n image: example/other"
|
||||
- notExists:
|
||||
path: spec.values.seaweedfs.volume.dataDirs[0].image
|
||||
|
||||
# A pool or zone class is quoted by hand around the value, which a quote
|
||||
# character inside it closes early, breaking the release values.
|
||||
- it: keeps a pool storage class with a quote inside its own field
|
||||
set:
|
||||
<<: *platform
|
||||
volume:
|
||||
pools:
|
||||
fast:
|
||||
diskType: ssd
|
||||
storageClass: 'local"x'
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.volumes.fast.dataDirs[0].storageClass
|
||||
value: 'local"x'
|
||||
|
||||
- it: keeps a zone storage class with a quote inside its own field
|
||||
set:
|
||||
<<: *platform
|
||||
topology: MultiZone
|
||||
replicationFactor: 1
|
||||
volume:
|
||||
zones:
|
||||
a:
|
||||
storageClass: 'local"x'
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.volumes.a.dataDirs[0].storageClass
|
||||
value: 'local"x'
|
||||
|
||||
- it: keeps a zone pool storage class with a quote inside its own field
|
||||
set:
|
||||
<<: *platform
|
||||
topology: MultiZone
|
||||
replicationFactor: 1
|
||||
volume:
|
||||
zones:
|
||||
a:
|
||||
pools:
|
||||
fast:
|
||||
diskType: ssd
|
||||
storageClass: 'local"x'
|
||||
documentSelector:
|
||||
path: metadata.name
|
||||
value: seaweedfs-system
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.values.seaweedfs.volumes.a-fast.dataDirs[0].storageClass
|
||||
value: 'local"x'
|
||||
@@ -868,6 +868,25 @@
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"lifecycle": {
|
||||
"description": "S3 bucket lifecycle configuration.",
|
||||
"type": "object",
|
||||
"default": {},
|
||||
"properties": {
|
||||
"enabled": {
|
||||
"description": "Run the SeaweedFS admin server and a worker that applies bucket lifecycle rules, once a day. When disabled, rules are still accepted and stored, but not applied. Ignored with the Client topology, whose rules are enforced by the instance it connects to. Rules stored before enabling are applied on the first pass, minutes after the switch. While on, in a bucket without versioning enabled, an object overwritten between the daily listing and its expiry delete can be deleted although it is new.",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"storageClass": {
|
||||
"description": "StorageClass of the admin server's 1Gi job-state volume. Empty uses the cluster default; `volume.storageClass` is not used, because in MultiZone it can be local to one zone. Prefer a replicated class: on a node-local one, losing the node stops lifecycle enforcement. Set it before enabling lifecycle: the class is part of the admin StatefulSet's volume claim template, which cannot change, so changing it while lifecycle is on makes every upgrade of the instance fail until it is reverted. To move the volume, disable lifecycle, delete the `admin-data-seaweedfs-admin-0` PVC of the instance, change the class and enable lifecycle again.",
|
||||
"type": "string",
|
||||
"default": "",
|
||||
"maxLength": 253,
|
||||
"pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?$"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -192,3 +192,21 @@ s3:
|
||||
replicas: 2
|
||||
resources: {}
|
||||
resourcesPreset: "t1.small"
|
||||
|
||||
## @typedef {struct} Lifecycle - Enforcement of S3 bucket lifecycle rules.
|
||||
## @field {bool} [enabled] - Run the SeaweedFS admin server and a worker that applies bucket lifecycle rules, once a day. When disabled, rules are still accepted and stored, but not applied. Ignored with the Client topology, whose rules are enforced by the instance it connects to. Rules stored before enabling are applied on the first pass, minutes after the switch. While on, in a bucket without versioning enabled, an object overwritten between the daily listing and its expiry delete can be deleted although it is new.
|
||||
## @field {string} [storageClass] - StorageClass of the admin server's 1Gi job-state volume. Empty uses the cluster default; `volume.storageClass` is not used, because in MultiZone it can be local to one zone. Prefer a replicated class: on a node-local one, losing the node stops lifecycle enforcement. Set it before enabling lifecycle: the class is part of the admin StatefulSet's volume claim template, which cannot change, so changing it while lifecycle is on makes every upgrade of the instance fail until it is reverted. To move the volume, disable lifecycle, delete the `admin-data-seaweedfs-admin-0` PVC of the instance, change the class and enable lifecycle again.
|
||||
## @maxLength 253
|
||||
## @pattern ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?$
|
||||
|
||||
## @param {Lifecycle} [lifecycle] - S3 bucket lifecycle configuration.
|
||||
lifecycle:
|
||||
# Off by default. The daily walk of SeaweedFS (4.45 through 4.52) sends its
|
||||
# expiry deletes without an object identity, which the s3 server takes as
|
||||
# "skip the check" (weed/s3api/s3lifecycle/dailyrun/walker_dispatcher.go,
|
||||
# identityMatches in weed/s3api/s3api_internal_lifecycle.go), and it does not
|
||||
# re-check the object's age. A key overwritten between the walk's listing and
|
||||
# the delete loses its new content, which a tenant bucket that rewrites a
|
||||
# fixed key can hit. On by default only once that path carries identity.
|
||||
enabled: false
|
||||
storageClass: ""
|
||||
@@ -11,7 +11,7 @@ spec:
|
||||
storage:
|
||||
size: {{ .Values.db.size }}
|
||||
{{- with .Values.db.storageClass }}
|
||||
storageClass: {{ . }}
|
||||
storageClass: {{ . | quote }}
|
||||
{{- end }}
|
||||
|
||||
monitoring:
|
||||
|
||||
@@ -60,3 +60,17 @@ tests:
|
||||
- equal:
|
||||
path: spec.inheritedMetadata.labels["policy.cozystack.io/allow-to-apiserver"]
|
||||
value: "true"
|
||||
|
||||
# A StorageClass name may be all digits; emitted unquoted it renders as a
|
||||
# number, which the Cluster rejects.
|
||||
- it: keeps a numeric storage class name a string
|
||||
release:
|
||||
name: seaweedfs-db
|
||||
namespace: cozy-seaweedfs
|
||||
set:
|
||||
db:
|
||||
storageClass: "123"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.storage.storageClass
|
||||
value: "123"
|
||||
+2
-2
@@ -8,7 +8,7 @@ spec:
|
||||
singular: seaweedfs
|
||||
plural: seaweedfses
|
||||
openAPISchema: |-
|
||||
{"title":"Chart Values","type":"object","properties":{"host":{"description":"The hostname used to access SeaweedFS externally (defaults to 's3' subdomain for the tenant host).","type":"string","default":""},"topology":{"description":"The topology of the SeaweedFS cluster.","type":"string","default":"Simple","enum":["Simple","MultiZone","Client"]},"replicationFactor":{"description":"Replication factor: number of replicas for each volume in the SeaweedFS cluster.","type":"integer","default":2},"db":{"description":"Database configuration.","type":"object","default":{},"properties":{"replicas":{"description":"Number of database replicas.","type":"integer","default":2},"resources":{"description":"Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.small","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"size":{"description":"Persistent Volume size.","default":"10Gi","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"storageClass":{"description":"StorageClass used to store the data.","type":"string","default":""}}},"master":{"description":"Master service configuration.","type":"object","default":{},"properties":{"replicas":{"description":"Number of master replicas.","type":"integer","default":3},"resources":{"description":"Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.small","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"volumeSizeLimitMB":{"description":"Size in MB at which a volume stops taking writes, and the divisor that sets how many buckets a volume server can serve. Lower it to fit more buckets on the same disk, at the cost of more volume files for the same stored data; on a large volume it is worth raising instead. Changing it on an instance that already holds data costs something either way: lowering it stops writes to every bucket whose volumes all reach the new value until that bucket can grow, and raising it takes the room new buckets grow into, so run the check in docs/operations/seaweedfs-lowering-the-volume-size-limit.md first. Must be between 1 and 30000. A value close to or above `volume.size` leaves each volume server a single slot rather than failing, since the server floors its slot count at one.","type":"integer","default":400,"maximum":30000,"minimum":1}}},"filer":{"description":"Filer service configuration.","type":"object","default":{},"properties":{"grpcHost":{"description":"TheLine truncated
|
||||
{"title":"Chart Values","type":"object","properties":{"host":{"description":"The hostname used to access SeaweedFS externally (defaults to 's3' subdomain for the tenant host).","type":"string","default":""},"topology":{"description":"The topology of the SeaweedFS cluster.","type":"string","default":"Simple","enum":["Simple","MultiZone","Client"]},"replicationFactor":{"description":"Replication factor: number of replicas for each volume in the SeaweedFS cluster.","type":"integer","default":2},"db":{"description":"Database configuration.","type":"object","default":{},"properties":{"replicas":{"description":"Number of database replicas.","type":"integer","default":2},"resources":{"description":"Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.small","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"size":{"description":"Persistent Volume size.","default":"10Gi","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"storageClass":{"description":"StorageClass used to store the data.","type":"string","default":""}}},"master":{"description":"Master service configuration.","type":"object","default":{},"properties":{"replicas":{"description":"Number of master replicas.","type":"integer","default":3},"resources":{"description":"Explicit CPU and memory configuration. When omitted, the preset defined in `resourcesPreset` is applied.","type":"object","default":{},"properties":{"cpu":{"description":"Number of CPU cores allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true},"memory":{"description":"Amount of memory allocated.","pattern":"^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$","anyOf":[{"type":"integer"},{"type":"string"}],"x-kubernetes-int-or-string":true}}},"resourcesPreset":{"description":"Default sizing preset used when `resources` is omitted.","type":"string","default":"t1.small","enum":["t1.nano","t1.micro","t1.small","t1.medium","t1.large","t1.xlarge","t1.2xlarge","t1.4xlarge","c1.nano","c1.micro","c1.small","c1.medium","c1.large","c1.xlarge","c1.2xlarge","c1.4xlarge","s1.nano","s1.micro","s1.small","s1.medium","s1.large","s1.xlarge","s1.2xlarge","s1.4xlarge","u1.nano","u1.micro","u1.small","u1.medium","u1.large","u1.xlarge","u1.2xlarge","u1.4xlarge","m1.nano","m1.micro","m1.small","m1.medium","m1.large","m1.xlarge","m1.2xlarge","m1.4xlarge","nano","micro","small","medium","large","xlarge","2xlarge"]},"volumeSizeLimitMB":{"description":"Size in MB at which a volume stops taking writes, and the divisor that sets how many buckets a volume server can serve. Lower it to fit more buckets on the same disk, at the cost of more volume files for the same stored data; on a large volume it is worth raising instead. Changing it on an instance that already holds data costs something either way: lowering it stops writes to every bucket whose volumes all reach the new value until that bucket can grow, and raising it takes the room new buckets grow into, so run the check in docs/operations/seaweedfs-lowering-the-volume-size-limit.md first. Must be between 1 and 30000. A value close to or above `volume.size` leaves each volume server a single slot rather than failing, since the server floors its slot count at one.","type":"integer","default":400,"maximum":30000,"minimum":1}}},"filer":{"description":"Filer service configuration.","type":"object","default":{},"properties":{"grpcHost":{"description":"TheLine truncated
|
||||
release:
|
||||
prefix: ""
|
||||
labels:
|
||||
@@ -26,7 +26,7 @@ spec:
|
||||
description: Seaweedfs
|
||||
module: true
|
||||
icon: PHN2ZyB3aWR0aD0iMTQ0IiBoZWlnaHQ9IjE0NCIgdmlld0JveD0iMCAwIDE0NCAxNDQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxNDQiIGhlaWdodD0iMTQ0IiByeD0iMjQiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl82NzlfMTkxMCkiLz4KPHBhdGggZD0iTTEzOC42ODUgMTIxLjA1N0MxMzguNjg1IDEyNi42NTIgMTM2LjQ2MiAxMzIuMDE3IDEzMi41MDQgMTM1Ljk3M0MxMjguNTQ3IDEzOS45MjkgMTIzLjE3OSAxNDIuMTUxIDExNy41ODIgMTQyLjE1MUMxMTEuOTg1IDE0Mi4xNTEgMTA2LjYxOCAxMzkuOTI5IDEwMi42NiAxMzUuOTczQzk4LjcwMjggMTMyLjAxNyA5Ni40Nzk1IDEyNi42NTIgOTYuNDc5NSAxMjEuMDU3Qzk2LjQ3OTUgMTE4LjI4NyA5Ny4wMjUzIDExNS41NDQgOTguMDg1OCAxMTIuOTg1Qzk5LjE0NjMgMTEwLjQyNSAxMDAuNzAxIDEwOC4xIDEwMi42NiAxMDYuMTQxQzEwNC42MiAxMDQuMTgyIDEwNi45NDYgMTAyLjYyOSAxMDkuNTA3IDEwMS41NjlDMTEyLjA2NyAxMDAuNTA5IDExNC44MTEgOTkuOTYyOSAxMTcuNTgyIDk5Ljk2MjlDMTIwLjM1MyA5OS45NjI5IDEyMy4wOTggMTAwLjUwOSAxMjUuNjU4IDEwMS41NjlDMTI4LjIxOCAxMDIuNjI5IDEzMC41NDQgMTA0LjE4MiAxMzIuNTA0IDEwNi4xNDFDMTM0LjQ2NCAxMDguMSAxMzYuMDE4IDExMC40MjUgMTM3LjA3OSAxMTIuOTg1QzEzOC4xMzkgMTE1LjU0NCAxMzguNjg1IDExOC4yODcgMTM4LjY4NSAxMjEuMDU3WiIgZmlsbD0idXJsKCNwYWludDFfcmFkaWFsXzY3OV8xOTEwKSIvPgo8cGF0aCBkPSJNMTEwLjMzNiAxMjYuMTQ3SDEyMy42OFYxMzYuODIzSDExMC4zMzZWMTI2LjE0N1oiIGZpbGw9IiMwRjVFOUMiLz4KPHBhdGggZD0iTTExOS4yNyAxMTIuMjk0QzExOS4yNyAxMTIuNzE0IDExOS4xNzggMTEzLjEzMSAxMTkgMTEzLjUxOUMxMTguODIxIDExMy45MDggMTE4LjU2IDExNC4yNjEgMTE4LjIzIDExNC41NThDMTE3LjkwMSAxMTQuODU1IDExNy41MDkgMTE1LjA5MSAxMTcuMDc5IDExNS4yNTJDMTE2LjY0OCAxMTUuNDEzIDExNi4xODYgMTE1LjQ5NiAxMTUuNzIgMTE1LjQ5NkMxMTQuNzc4IDExNS40OTYgMTEzLjg3NSAxMTUuMTU4IDExMy4yMSAxMTQuNTU4QzExMi41NDQgMTEzLjk1NyAxMTIuMTcgMTEzLjE0MyAxMTIuMTcgMTEyLjI5NEMxMTIuMTcgMTExLjQ0NSAxMTIuNTQ0IDExMC42MyAxMTMuMjEgMTEwLjAzQzExMy44NzUgMTA5LjQyOSAxMTQuNzc4IDEwOS4wOTIgMTE1LjcyIDEwOS4wOTJDMTE2LjE4NiAxMDkuMDkyIDExNi42NDggMTA5LjE3NSAxMTcuMDc5IDEwOS4zMzZDMTE3LjUwOSAxMDkuNDk2IDExNy45MDEgMTA5LjczMiAxMTguMjMgMTEwLjAzQzExOC41NiAxMTAuMzI3IDExOC44MjEgMTEwLjY4IDExOSAxMTEuMDY4QzExOS4xNzggMTExLjQ1NyAxMTkuMjcgMTExLjg3MyAxMTkuMjcgMTEyLjI5NFoiIGZpbGw9IiM1OTY4NkYiLz4KPHBhdGggZD0iTTEyOC4xMSAxMTQuMTAzQzEyOC4xMSAxMTQuOTUzIDEyNy43MzYgMTE1Ljc2NyAxMjcuMDcgMTE2LjM2OEMxMjYuNDA0IDExNi45NjggMTI1LjUwMSAxMTcuMzA1IDEyNC41NiAxMTcuMzA1QzEyNC4wOTQgMTE3LjMwNSAxMjMuNjMyIDExNy4yMjMgMTIzLjIwMSAxMTcuMDYyQzEyMi43NzEgMTE2LjkwMSAxMjIuMzc5IDExNi42NjUgMTIyLjA1IDExNi4zNjhDMTIxLjcyIDExNi4wNyAxMjEuNDU4IDExNS43MTcgMTIxLjI4IDExNS4zMjlDMTIxLjEwMiAxMTQuOTQgMTIxLjAxIDExNC41MjQgMTIxLjAxIDExNC4xMDNDMTIxLjAxIDExMy42ODMgMTIxLjEwMiAxMTMuMjY2IDEyMS4yOCAxMTIuODc4QzEyMS40NTggMTEyLjQ5IDEyMS43MiAxMTIuMTM3IDEyMi4wNSAxMTEuODM5QzEyMi4zNzkgMTExLjU0MiAxMjIuNzcxIDExMS4zMDYgMTIzLjIwMSAxMTEuMTQ1QzEyMy42MzIgMTEwLjk4NCAxMjQuMDk0IDExMC45MDEgMTI0LjU2IDExMC45MDFDMTI1LjUwMSAxMTAuOTAxIDEyNi40MDQgMTExLjIzOSAxMjcuMDcgMTExLjgzOUMxMjcuNzM2IDExMi40NCAxMjguMTEgMTEzLjI1NCAxMjguMTEgMTE0LjEwM1oiIGZpbGw9IiM1OTY4NkYiLz4KPHBhdGggZD0iTTEyMi4zMzMgMTE4Ljk3NkMxMjIuMzMzIDExOS44MjYgMTIxLjk1OCAxMjAuNjQgMTIxLjI5MyAxMjEuMjQxQzEyMC42MjcgMTIxLjg0MSAxMTkuNzI0IDEyMi4xNzggMTE4Ljc4MiAxMjIuMTc4QzExOC4zMTYgMTIyLjE3OCAxMTcuODU1IDEyMi4wOTYgMTE3LjQyNCAxMjEuOTM1QzExNi45OTMgMTIxLjc3NCAxMTYuNjAyIDEyMS41MzggMTE2LjI3MiAxMjEuMjQxQzExNS45NDMgMTIwLjk0MyAxMTUuNjgxIDEyMC41OSAxMTUuNTAzIDEyMC4yMDJDMTE1LjMyNCAxMTkuODEzIDExNS4yMzIgMTE5LjM5NyAxMTUuMjMyIDExOC45NzZDMTE1LjIzMiAxMTguNTU2IDExNS4zMjQgMTE4LjE0IDExNS41MDMgMTE3Ljc1MUMxMTUuNjgxIDExNy4zNjMgMTE1Ljk0MyAxMTcuMDEgMTE2LjI3MiAxMTYuNzEyQzExNi42MDIgMTE2LjQxNSAxMTYuOTkzIDExNi4xNzkgMTE3LjQyNCAxMTYuMDE4QzExNy44NTUgMTE1Ljg1NyAxMTguMzE2IDExNS43NzQgMTE4Ljc4MiAxMTUuNzc0QzExOS43MjQgMTE1Ljc3NCAxMjAuNjI3IDExNi4xMTIgMTIxLjI5MyAxMTYuNzEyQzEyMS45NTggMTE3LjMxMyAxMjIuMzMzIDExOC4xMjcgMTIyLjMzMyAxMTguOTc2WiIgZmlsbD0iIzU5Njg2RiIvPgo8cGF0aCBkPSJNMTE1LjMwOCAxMjEuOTA1QzExMy43MzUgMTIxLjQyNiAxMTUuNzA3IDEyMC42OCAxMTUuNDI5IDEyMC41NzNDMTE0LjY1MyAxMjAuMjc2IDExNS43MyAxMTkuMzMzIDExNi43NCAxMTguNTM5QzExNy42MjggMTE3Ljg0MSAxMTcuNjU5IDExNy44MzkgMTE3Ljg5MiAxMTguNDY4QzExOC4wMjQgMTE4LjgyMyAxMTguMzcxIDExOS4yMDYgMTE4LjY2NSAxMTkuMzE5QzExOS4yODkgMTE5LjU1OCAxMjAuOTUxIDExOS4yNjkgMTIwLjk1MSAxMTguODM1QzEyMC45NTEgMTE4LjIyMyAxMjEuNDE1IDExOC42OTkgMTIxLjc5NCAxMTkuNTMxQzEyMi40NTcgMTIwLjk4NyAxMjIuNDM3IDEyMi40NzIgMTIxLjQ1IDEyMi40NzJDMTIwLjg1OSAxMjIuNDcyIDEyMC4zMSAxMjIuNjkxIDEyMC4xOSAxMjMuMTQ3QzExNS4wNDYgMTI0LjYgMTE2LjQ3MSAxMjMuMjg0IDExNS4zMDggMTIxLjkwNVpNMTIzLjA5NCAxMTguMDU0QzEyMS42MDkgMTE3LjQ2NiAxMjAuNTQ3IDExNC44MzggMTIwLjU0NyAxMTMuMzA5QzEyMC41NDcgMTExLjMyMyAxMjIuNTQxIDEwOS4wOTUgMTI0LjMxNyAxMDkuMDk1QzEyOC4zMTUgMTA5LjA5NSAxMzAuNjg0IDExMi4yNjEgMTI4LjgzOCAxMTguNDA5QzEyOC4zODUgMTE5LjkxOSAxMjMuOTMzIDExOC4zODcgMTIzLjA5NCAxMTguMDU0Wk0xMjUuODY2IDExNS42NDlDMTI3LjU0NCAxMTQuNDc0IDEyNS44NTcgMTExLjc1NSAxMjMuOTgxIDExMi42MUMxMjIuNDc5IDExMy4yOTQgMTIzLjExOSAxMTYuMTE1IDEyNC43NyAxMTYuMTY0QzEyNC45NjEgMTE2LjE2OSAxMjUuNDU0IDExNS45MzggMTI1Ljg2NiAxMTUuNjQ5Wk0xMjQuMzM5IDExNC41NzlDMTIzLjc3MSAxMTQuMzgxIDEyMy44MDMgMTEzLjI1NiAxMjQuMzgzIDExMy4wMzRDMTI0LjkwMiAxMTIuODM1IDEyNS42MDQgMTEzLjM5OCAxMjUuNjA0IDExNC4wMTRDMTI1LjYwNCAxMTQuNDg5IDEyNC45MzYgMTE0Ljc4NyAxMjQuMzM5IDExNC41NzlaTTExMi4zMTkgMTE2Ljk4QzEwOS45NiAxMTUuNjcgMTEwLjI4NiAxMTEuMDA2IDExMi40MTcgMTA4Ljk2NUMxMLine truncated
|
||||
keysOrder: [["apiVersion"], ["appVersion"], ["kind"], ["metadata"], ["metadata", "name"], ["spec", "host"], ["spec", "topology"], ["spec", "replicationFactor"], ["spec", "db"], ["spec", "db", "replicas"], ["spec", "db", "size"], ["spec", "db", "storageClass"], ["spec", "db", "resources"], ["spec", "db", "resourcesPreset"], ["spec", "master"], ["spec", "master", "replicas"], ["spec", "master", "resources"], ["spec", "master", "resourcesPreset"], ["spec", "master", "volumeSizeLimitMB"], ["spec", "filer"], ["spec", "filer", "replicas"], ["spec", "filer", "resources"], ["spec", "filer", "resourcesPreset"], ["spec", "filer", "grpcHost"], ["spec", "filer", "grpcPort"], ["spec", "filer", "whitelist"], ["spec", "volume"], ["spec", "volume", "replicas"], ["spec", "volume", "size"], ["spec", "volume", "storageClass"], ["spec", "volume", "diskType"], ["spec", "volume", "resources"], ["spec", "volume", "resourcesPreset"], ["spec", "volume", "zones"], ["spec", "volume", "pools"], ["spec", "s3"], ["spec", "s3", "replicas"], ["spec", "s3", "resources"], ["spec", "s3", "resourcesPreset"]]
|
||||
keysOrder: [["apiVersion"], ["appVersion"], ["kind"], ["metadata"], ["metadata", "name"], ["spec", "host"], ["spec", "topology"], ["spec", "replicationFactor"], ["spec", "db"], ["spec", "db", "replicas"], ["spec", "db", "size"], ["spec", "db", "storageClass"], ["spec", "db", "resources"], ["spec", "db", "resourcesPreset"], ["spec", "master"], ["spec", "master", "replicas"], ["spec", "master", "resources"], ["spec", "master", "resourcesPreset"], ["spec", "master", "volumeSizeLimitMB"], ["spec", "filer"], ["spec", "filer", "replicas"], ["spec", "filer", "resources"], ["spec", "filer", "resourcesPreset"], ["spec", "filer", "grpcHost"], ["spec", "filer", "grpcPort"], ["spec", "filer", "whitelist"], ["spec", "volume"], ["spec", "volume", "replicas"], ["spec", "volume", "size"], ["spec", "volume", "storageClass"], ["spec", "volume", "diskType"], ["spec", "volume", "resources"], ["spec", "volume", "resourcesPreset"], ["spec", "volume", "zones"], ["spec", "volume", "pools"], ["spec", "s3"], ["spec", "s3", "replicas"], ["spec", "s3", "resources"], ["spec", "s3", "resourcesPreset"], ["spec", "lifecycle"], ["spec", "lifecycle", "enabled"], ["spec", "lifecycle", "storageClass"]]
|
||||
secrets:
|
||||
exclude: []
|
||||
include: []
|
||||
|
||||
@@ -61,6 +61,12 @@ update:
|
||||
patch --no-backup-if-mismatch -p4 < patches/s3-service-name.patch
|
||||
patch --no-backup-if-mismatch -p4 < patches/s3-service-name-consumers.patch
|
||||
patch --no-backup-if-mismatch -p4 < patches/cluster-scoped-names-per-namespace.patch
|
||||
# Backport of seaweedfs/seaweedfs#11157, released in 4.46: drop the patch
|
||||
# once the vendored chart carries [grpc.s3]. --forward makes that point
|
||||
# fail here, where BSD patch would otherwise reverse it and remove the
|
||||
# section without an error.
|
||||
patch --forward --no-backup-if-mismatch -p4 < patches/s3-grpc-tls.patch
|
||||
patch --forward --no-backup-if-mismatch -p4 < patches/storage-class-string.patch
|
||||
#patch --no-backup-if-mismatch -p4 < patches/retention-policy-delete.yaml
|
||||
$(MAKE) update-image
|
||||
|
||||
|
||||
@@ -330,7 +330,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.admin.data.storageClass }}
|
||||
{{- with .Values.admin.data.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.data.size }}
|
||||
@@ -344,7 +346,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.admin.logs.storageClass }}
|
||||
{{- with .Values.admin.logs.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.logs.size }}
|
||||
|
||||
@@ -19,7 +19,7 @@ spec:
|
||||
accessModes:
|
||||
{{- toYaml (.Values.allInOne.data.accessModes | default (list "ReadWriteOnce")) | nindent 4 }}
|
||||
{{- if .Values.allInOne.data.storageClass }}
|
||||
storageClassName: {{ .Values.allInOne.data.storageClass }}
|
||||
storageClassName: {{ .Values.allInOne.data.storageClass | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
|
||||
@@ -451,7 +451,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.filer.data.storageClass }}
|
||||
{{- with .Values.filer.data.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.data.size }}
|
||||
@@ -467,7 +469,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.filer.logs.storageClass }}
|
||||
{{- with .Values.filer.logs.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.logs.size }}
|
||||
|
||||
@@ -336,7 +336,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.master.data.storageClass }}
|
||||
{{- with .Values.master.data.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.data.size }}
|
||||
@@ -352,7 +354,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ .Values.master.logs.storageClass }}
|
||||
{{- with .Values.master.logs.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.logs.size }}
|
||||
|
||||
@@ -97,6 +97,19 @@ data:
|
||||
cert = "/usr/local/share/ca-certificates/worker/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/worker/tls.key"
|
||||
|
||||
{{- /* S3 gRPC server identity (weed s3 -port.grpc, default httpPort+10000).
|
||||
Without this section, LoadServerTLS("grpc.s3") returns nil and the S3
|
||||
server serves its internal gRPC (IAM cache propagation, s3 lifecycle
|
||||
delete RPCs) as plaintext, while peers dial it with mTLS credentials:
|
||||
"tls: first record does not look like a TLS handshake".
|
||||
Always uses the internal CA-signed client certificate (already mounted
|
||||
on s3 pods by s3-deployment.yaml). Deliberately NOT s3.tlsSecret: that
|
||||
secret is for the public HTTPS listener and may be issued by a public
|
||||
CA which internal gRPC peers (trusting only grpc.ca) would reject. */}}
|
||||
[grpc.s3]
|
||||
cert = "/usr/local/share/ca-certificates/client/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/client/tls.key"
|
||||
|
||||
# use this for any place needs a grpc client
|
||||
# i.e., "weed backup|benchmark|filer.copy|filer.replicate|mount|s3|upload"
|
||||
[grpc.client]
|
||||
|
||||
@@ -404,7 +404,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $dir.storageClass }}
|
||||
{{- with $dir.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $dir.size }}
|
||||
@@ -422,7 +424,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $volume.idx.storageClass }}
|
||||
{{- with $volume.idx.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.idx.size }}
|
||||
@@ -438,7 +442,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
storageClassName: {{ $volume.logs.storageClass }}
|
||||
{{- with $volume.logs.storageClass }}
|
||||
storageClassName: {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.logs.size }}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
|
||||
index a067e1de9..17b82cca0 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/shared/security-configmap.yaml
|
||||
@@ -97,6 +97,19 @@ data:
|
||||
cert = "/usr/local/share/ca-certificates/worker/tls.crt"
|
||||
key = "/usr/local/share/ca-certificates/worker/tls.key"
|
||||
|
||||
+ {{- /* S3 gRPC server identity (weed s3 -port.grpc, default httpPort+10000).
|
||||
+ Without this section, LoadServerTLS("grpc.s3") returns nil and the S3
|
||||
+ server serves its internal gRPC (IAM cache propagation, s3 lifecycle
|
||||
+ delete RPCs) as plaintext, while peers dial it with mTLS credentials:
|
||||
+ "tls: first record does not look like a TLS handshake".
|
||||
+ Always uses the internal CA-signed client certificate (already mounted
|
||||
+ on s3 pods by s3-deployment.yaml). Deliberately NOT s3.tlsSecret: that
|
||||
+ secret is for the public HTTPS listener and may be issued by a public
|
||||
+ CA which internal gRPC peers (trusting only grpc.ca) would reject. */}}
|
||||
+ [grpc.s3]
|
||||
+ cert = "/usr/local/share/ca-certificates/client/tls.crt"
|
||||
+ key = "/usr/local/share/ca-certificates/client/tls.key"
|
||||
+
|
||||
# use this for any place needs a grpc client
|
||||
# i.e., "weed backup|benchmark|filer.copy|filer.replicate|mount|s3|upload"
|
||||
[grpc.client]
|
||||
@@ -0,0 +1,128 @@
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/admin/admin-statefulset.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
index ad112981f..1ce6f3cab 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
@@ -330,7 +330,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.admin.data.storageClass }}
|
||||
+ {{- with .Values.admin.data.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.data.size }}
|
||||
@@ -344,7 +346,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.admin.logs.storageClass }}
|
||||
+ {{- with .Values.admin.logs.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.admin.logs.size }}
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml
|
||||
index 4a402f318..f5329a24e 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml
|
||||
@@ -19,7 +19,7 @@ spec:
|
||||
accessModes:
|
||||
{{- toYaml (.Values.allInOne.data.accessModes | default (list "ReadWriteOnce")) | nindent 4 }}
|
||||
{{- if .Values.allInOne.data.storageClass }}
|
||||
- storageClassName: {{ .Values.allInOne.data.storageClass }}
|
||||
+ storageClassName: {{ .Values.allInOne.data.storageClass | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/filer/filer-statefulset.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
index e505faf1c..ced2d597a 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
@@ -451,7 +451,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.filer.data.storageClass }}
|
||||
+ {{- with .Values.filer.data.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.data.size }}
|
||||
@@ -467,7 +469,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.filer.logs.storageClass }}
|
||||
+ {{- with .Values.filer.logs.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.filer.logs.size }}
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/master/master-statefulset.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
index 914f0dfd1..5df83e687 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
@@ -336,7 +336,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.master.data.storageClass }}
|
||||
+ {{- with .Values.master.data.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.data.size }}
|
||||
@@ -352,7 +354,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ .Values.master.logs.storageClass }}
|
||||
+ {{- with .Values.master.logs.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.master.logs.size }}
|
||||
diff --git a/packages/system/seaweedfs/charts/seaweedfs/templates/volume/volume-statefulset.yaml b/packages/system/seaweedfs/charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
index 04011d1d6..88b13822d 100644
|
||||
--- a/packages/system/seaweedfs/charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
+++ b/packages/system/seaweedfs/charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
@@ -404,7 +404,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ $dir.storageClass }}
|
||||
+ {{- with $dir.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $dir.size }}
|
||||
@@ -422,7 +424,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ $volume.idx.storageClass }}
|
||||
+ {{- with $volume.idx.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.idx.size }}
|
||||
@@ -438,7 +442,9 @@ spec:
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
- storageClassName: {{ $volume.logs.storageClass }}
|
||||
+ {{- with $volume.logs.storageClass }}
|
||||
+ storageClassName: {{ . | quote }}
|
||||
+ {{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $volume.logs.size }}
|
||||
@@ -0,0 +1,175 @@
|
||||
suite: seaweedfs runs the S3 lifecycle worker
|
||||
|
||||
# SeaweedFS stores a bucket lifecycle configuration on PUT and acts on it only
|
||||
# from the s3_lifecycle job of the plugin worker, which the admin server
|
||||
# schedules (weed/worker/tasks/s3_lifecycle/handler.go). Without an admin and a
|
||||
# worker in the release, a rule is accepted and nothing ever expires.
|
||||
|
||||
templates:
|
||||
- charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs-system
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
- it: runs the admin server that schedules lifecycle jobs
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set: &enabled
|
||||
seaweedfs:
|
||||
admin:
|
||||
enabled: true
|
||||
secret:
|
||||
existingSecret: seaweedfs-admin-credentials
|
||||
worker:
|
||||
enabled: true
|
||||
asserts:
|
||||
- isKind:
|
||||
of: StatefulSet
|
||||
- equal:
|
||||
path: metadata.name
|
||||
value: seaweedfs-admin
|
||||
|
||||
# The admin keeps its job state and any change an operator makes in its UI
|
||||
# in -dataDir; on an emptyDir a restart would silently undo them.
|
||||
- it: keeps the admin data directory on a persistent volume
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].command[2]
|
||||
pattern: '-dataDir=/data'
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].metadata.name
|
||||
value: admin-data
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.resources.requests.storage
|
||||
value: 1Gi
|
||||
|
||||
- it: runs the worker against the admin of the same release
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- isKind:
|
||||
of: Deployment
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].command[2]
|
||||
pattern: '-admin=seaweedfs-admin\.tenant-root:23646\.33646 '
|
||||
|
||||
# The worker executes every job type it registers for. Lifecycle is the only
|
||||
# one this release asks for: vacuum, balance and erasure coding move data and
|
||||
# are not something enabling lifecycle should start doing as a side effect.
|
||||
- it: registers the worker for the s3_lifecycle job only
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].command[2]
|
||||
pattern: '-jobType=s3_lifecycle '
|
||||
|
||||
- it: runs no Lance worker container, since the Lance catalog is off
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- lengthEqual:
|
||||
path: spec.template.spec.containers
|
||||
count: 1
|
||||
|
||||
- it: gives the admin and the worker explicit resources
|
||||
set: *enabled
|
||||
asserts:
|
||||
- exists:
|
||||
path: spec.template.spec.containers[0].resources.requests.memory
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- exists:
|
||||
path: spec.template.spec.containers[0].resources.limits.memory
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].resources.requests.memory
|
||||
value: 64Mi
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
|
||||
# The admin serves an unauthenticated UI unless a password is set, and a
|
||||
# tenant namespace admits ingress from the whole cluster. The credentials come
|
||||
# from a Secret the parent release keeps; the values here only wire them in.
|
||||
- it: reads the admin credentials from the named Secret
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: WEED_ADMIN_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: seaweedfs-admin-credentials
|
||||
key: adminPassword
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].env
|
||||
content:
|
||||
name: WEED_ADMIN_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: seaweedfs-admin-credentials
|
||||
key: adminUser
|
||||
|
||||
- it: renders neither the admin nor the worker unless the parent turns them on
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
|
||||
# Every other component here logs to stderr; the upstream default for these
|
||||
# two writes to a file in an emptyDir that kubectl logs never shows.
|
||||
- it: logs the admin and the worker to stderr
|
||||
set: *enabled
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].command[2]
|
||||
pattern: '-logtostderr=true'
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- matchRegex:
|
||||
path: spec.template.spec.containers[0].command[2]
|
||||
pattern: '-logtostderr=true'
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
|
||||
# One worker replica rolls out by surging a second pod. The subchart's hard
|
||||
# hostname anti-affinity keeps that pod off the only node of a single-node
|
||||
# cluster, so every later change to the worker template would hang the
|
||||
# release on its rollout.
|
||||
- it: lets the worker roll out on a single node
|
||||
template: charts/seaweedfs/templates/worker/worker-deployment.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution
|
||||
|
||||
# The parent hands the class on as a string, and a class name may be all
|
||||
# digits; emitted unquoted it turns back into a number the claim rejects.
|
||||
- it: keeps a numeric admin storage class name a string
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set:
|
||||
seaweedfs:
|
||||
admin:
|
||||
enabled: true
|
||||
secret:
|
||||
existingSecret: seaweedfs-admin-credentials
|
||||
data:
|
||||
storageClass: "123"
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
value: "123"
|
||||
|
||||
# An empty storageClassName disables dynamic provisioning; with no class
|
||||
# named, the claim must leave the field out so the cluster default applies.
|
||||
- it: leaves the admin claim on the cluster default when no class is named
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set: *enabled
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
@@ -0,0 +1,32 @@
|
||||
suite: seaweedfs s3 gRPC listener speaks mTLS
|
||||
|
||||
templates:
|
||||
- charts/seaweedfs/templates/shared/security-configmap.yaml
|
||||
- charts/seaweedfs/templates/s3/s3-deployment.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs-system
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
# weed s3 serves its internal gRPC (the LifecycleDelete RPC among it) with
|
||||
# the [grpc.s3] identity and as plaintext without one, while the worker dials
|
||||
# it with [grpc.worker] mTLS credentials, so every delete failed the TLS
|
||||
# handshake. patches/s3-grpc-tls.patch backports the section from upstream.
|
||||
- it: gives the s3 gRPC server a TLS identity signed by the internal CA
|
||||
template: charts/seaweedfs/templates/shared/security-configmap.yaml
|
||||
asserts:
|
||||
- matchRegex:
|
||||
path: data["security.toml"]
|
||||
pattern: '\[grpc\.s3\]\s+cert = "/usr/local/share/ca-certificates/client/tls\.crt"\s+key = "/usr/local/share/ca-certificates/client/tls\.key"'
|
||||
|
||||
# security.toml reaches the s3 pods through a subPath mount, which a running
|
||||
# container never re-reads, so an upgrade that only changes the ConfigMap
|
||||
# leaves s3 serving plaintext gRPC until something restarts it. The pod
|
||||
# template has to change in the same release.
|
||||
- it: rolls the s3 pods so they load the new section
|
||||
template: charts/seaweedfs/templates/s3/s3-deployment.yaml
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.template.metadata.annotations["seaweedfs.cozystack.io/grpc-s3-tls"]
|
||||
value: "true"
|
||||
@@ -0,0 +1,123 @@
|
||||
suite: seaweedfs claims keep the storage class a string
|
||||
|
||||
# A StorageClass name may be all digits. Emitted unquoted it renders as a
|
||||
# number, which the claim rejects; and an empty storageClassName disables
|
||||
# dynamic provisioning, so with no class named the field has to stay out for
|
||||
# the cluster default to apply.
|
||||
|
||||
templates:
|
||||
- charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
- charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
- charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
- charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
- charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml
|
||||
# filer-statefulset includes it for its checksum annotation.
|
||||
- charts/seaweedfs/templates/s3/s3-secret.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs-system
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
- it: keeps numeric master data and logs storage class names strings
|
||||
template: charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.master.data: {type: persistentVolumeClaim, size: 1Gi, storageClass: "123"}
|
||||
seaweedfs.master.logs: {type: persistentVolumeClaim, size: 1Gi, storageClass: "456"}
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[?(@.metadata.name == "data-tenant-root")].spec.storageClassName
|
||||
value: "123"
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[?(@.metadata.name == "seaweedfs-master-log-volume")].spec.storageClassName
|
||||
value: "456"
|
||||
|
||||
- it: leaves the master claims on the cluster default when no class is named
|
||||
template: charts/seaweedfs/templates/master/master-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.master.data: {type: persistentVolumeClaim, size: 1Gi}
|
||||
seaweedfs.master.logs: {type: persistentVolumeClaim, size: 1Gi}
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
|
||||
- it: keeps numeric filer data and logs storage class names strings
|
||||
template: charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.filer.data: {type: persistentVolumeClaim, size: 1Gi, storageClass: "123"}
|
||||
seaweedfs.filer.logs: {type: persistentVolumeClaim, size: 1Gi, storageClass: "456"}
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
value: "123"
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
value: "456"
|
||||
|
||||
- it: leaves the filer claims on the cluster default when no class is named
|
||||
template: charts/seaweedfs/templates/filer/filer-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.filer.data: {type: persistentVolumeClaim, size: 1Gi}
|
||||
seaweedfs.filer.logs: {type: persistentVolumeClaim, size: 1Gi}
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
|
||||
- it: keeps numeric volume idx and logs storage class names strings
|
||||
template: charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.volume.dataDirs: []
|
||||
seaweedfs.volume.idx: {type: persistentVolumeClaim, size: 1Gi, storageClass: "123"}
|
||||
seaweedfs.volume.logs: {type: persistentVolumeClaim, size: 1Gi, storageClass: "456"}
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
value: "123"
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
value: "456"
|
||||
|
||||
- it: leaves the volume idx and logs claims on the cluster default when no class is named
|
||||
template: charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.volume.dataDirs: []
|
||||
seaweedfs.volume.idx: {type: persistentVolumeClaim, size: 1Gi}
|
||||
seaweedfs.volume.logs: {type: persistentVolumeClaim, size: 1Gi}
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
|
||||
- it: keeps a numeric admin logs storage class name a string
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.admin.enabled: true
|
||||
seaweedfs.admin.logs: {type: persistentVolumeClaim, size: 1Gi, storageClass: "456"}
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
value: "456"
|
||||
|
||||
- it: leaves the admin logs claim on the cluster default when no class is named
|
||||
template: charts/seaweedfs/templates/admin/admin-statefulset.yaml
|
||||
set:
|
||||
seaweedfs.admin.enabled: true
|
||||
seaweedfs.admin.logs: {type: persistentVolumeClaim, size: 1Gi}
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[1].spec.storageClassName
|
||||
|
||||
- it: keeps a numeric all-in-one storage class name a string
|
||||
template: charts/seaweedfs/templates/all-in-one/all-in-one-pvc.yaml
|
||||
set:
|
||||
seaweedfs.allInOne.enabled: true
|
||||
seaweedfs.allInOne.data: {type: persistentVolumeClaim, size: 1Gi, storageClass: "123"}
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.storageClassName
|
||||
value: "123"
|
||||
@@ -0,0 +1,42 @@
|
||||
suite: seaweedfs volume claims keep the storage class a string
|
||||
|
||||
templates:
|
||||
- charts/seaweedfs/templates/volume/volume-statefulset.yaml
|
||||
|
||||
release:
|
||||
name: seaweedfs-system
|
||||
namespace: tenant-root
|
||||
|
||||
tests:
|
||||
# The parent hands volume.storageClass on as a string, and a class name may
|
||||
# be all digits; emitted unquoted it turns back into a number the claim
|
||||
# rejects.
|
||||
- it: keeps a numeric volume storage class name a string
|
||||
set:
|
||||
seaweedfs:
|
||||
volume:
|
||||
dataDirs:
|
||||
- name: data1
|
||||
type: persistentVolumeClaim
|
||||
size: 10Gi
|
||||
storageClass: "123"
|
||||
maxVolumes: 0
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
value: "123"
|
||||
|
||||
# An empty storageClassName disables dynamic provisioning; with no class
|
||||
# named, the claim must leave the field out so the cluster default applies.
|
||||
- it: leaves the volume claim on the cluster default when no class is named
|
||||
set:
|
||||
seaweedfs:
|
||||
volume:
|
||||
dataDirs:
|
||||
- name: data1
|
||||
type: persistentVolumeClaim
|
||||
size: 10Gi
|
||||
maxVolumes: 0
|
||||
asserts:
|
||||
- notExists:
|
||||
path: spec.volumeClaimTemplates[0].spec.storageClassName
|
||||
@@ -207,6 +207,14 @@ seaweedfs:
|
||||
# weed skip startLanceServer and drops the container port and Service port
|
||||
# with it.
|
||||
lancePort: 0
|
||||
# patches/s3-grpc-tls.patch adds [grpc.s3] to security.toml, which the s3
|
||||
# pods mount by subPath and so never re-read. This annotation changes the
|
||||
# pod template in the release that brings the section, so an upgrade
|
||||
# restarts s3 onto it instead of leaving its gRPC in plaintext. The
|
||||
# upstream s3 template carries no checksum of that ConfigMap, and adding
|
||||
# one would be another vendored patch for a change made once.
|
||||
podAnnotations:
|
||||
seaweedfs.cozystack.io/grpc-s3-tls: "true"
|
||||
# Keep S3 traffic on same-zone endpoints. Native chart support landed in 4.12
|
||||
# (replaces the former s3-traffic-distribution.patch); the chart gates the
|
||||
# field on Kubernetes >=1.31 and auto-converts to PreferSameZone on >=1.35.
|
||||
@@ -314,6 +322,62 @@ seaweedfs:
|
||||
region: ""
|
||||
sidecar:
|
||||
image: "ghcr.io/cozystack/cozystack/objectstorage-sidecar:v1.7.1@sha256:b7b0d339e0e2c5043eb03b6d78e05437daae1116c0e1a6a1d88ae4f70b296534"
|
||||
# A bucket lifecycle rule is stored on PUT and acted on only by the
|
||||
# s3_lifecycle job of the plugin worker, scheduled by the admin server once a
|
||||
# day (weed/worker/tasks/s3_lifecycle/handler.go at 4.45). The parent chart
|
||||
# sends both enabled flags from its lifecycle.enabled, together with the
|
||||
# admin password below; off here, so a render without the parent never
|
||||
# starts an admin without one.
|
||||
admin:
|
||||
enabled: false
|
||||
# Without a password weed admin serves its UI unauthenticated, and a tenant
|
||||
# namespace admits ingress from the whole cluster. The parent chart names
|
||||
# the Secret it keeps; these are the keys it writes.
|
||||
secret:
|
||||
userKey: adminUser
|
||||
pwKey: adminPassword
|
||||
# Job state and anything changed in the admin UI live in -dataDir.
|
||||
data:
|
||||
type: "persistentVolumeClaim"
|
||||
size: "1Gi"
|
||||
logs:
|
||||
type: ""
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: "64Mi"
|
||||
limits:
|
||||
cpu: "500m"
|
||||
memory: "256Mi"
|
||||
worker:
|
||||
enabled: false
|
||||
# Vacuum, balance and erasure coding move data; enabling lifecycle must
|
||||
# not start them.
|
||||
jobType: "s3_lifecycle"
|
||||
# The subchart's hard hostname anti-affinity keeps the surge pod of a
|
||||
# rollout off the node the running worker holds, so on a single-node
|
||||
# cluster any change to the worker template never finishes rolling out.
|
||||
# Only required -> preferred, as for the master above.
|
||||
affinity: |
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ template "seaweedfs.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/component: worker
|
||||
topologyKey: kubernetes.io/hostname
|
||||
logs:
|
||||
type: ""
|
||||
resources:
|
||||
requests:
|
||||
cpu: "50m"
|
||||
memory: "64Mi"
|
||||
limits:
|
||||
cpu: "1"
|
||||
memory: "512Mi"
|
||||
certificates:
|
||||
commonName: "SeaweedFS CA"
|
||||
ipAddresses: []
|
||||
|
||||
Reference in new issue
Block a user