The tenant chart renders the tenant-range-limits LimitRange only next to
the tenant-quota of a tenant that declares resourceQuotas. Since quotas
became hierarchical, an unbounded sub-tenant shares its parent's pool
and gets a controller-owned tenant-quota-allocated ResourceQuota, but
still no LimitRange. A ResourceQuota on limits.cpu or limits.memory
makes admission reject any container that omits that limit, and with
no LimitRange nothing fills it in. Pods that ran before the quota was
introduced fail as soon as they are recreated; the barman-cloud plugin
sidecar, which sets no CPU limit, takes every backed-up postgres
instance in such a namespace down on its next restart.
The controller already knows which namespaces it clamps, so it copies
the pool root's chart LimitRange into each unbounded member, under its
own name so that Helm can still create the chart object if the tenant
later declares a quota of its own, and removes the copy once the
namespace leaves the pool.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit c368c48fd8)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A tenant namespace is meant to go away with its Tenant. The tenant
chart's pre-delete hook deletes the applications first and the tenant
modules such as etcd after them, and helm-controller deletes the
namespace at the end. A direct delete hands the namespace to the
namespace controller instead. It deletes the pods first and then
everything else together, so the tenant etcd and its etcd-ca-tls Secret
can be gone before the TenantControlPlanes that use them. Kamaji then
cannot reach the datastore to clean up, the TenantControlPlane finalizer
never clears and the namespace stays Terminating.
The policy refuses DELETE of a namespace labelled
tenant.cozystack.io/tenant-root, which the tenant chart puts on every
tenant namespace below tenant-root. tenant-root carries no such label
and stays with the no-delete guardrail. Two callers are let through.
helm-controller and its shards run as the flux ServiceAccount in
cozy-fluxcd and delete the namespace during a Tenant uninstall. The
garbage collector runs in kube-system and removes a child namespace
through its ownerReference once the parent namespace is gone. The
namespace controller only finalizes a namespace and never sends a
DELETE for it, so it is not affected. Everyone else is refused,
system:masters included, as with the no-delete guardrail. The message
names the Tenant to delete and the label to remove when the Tenant is
already gone.
The policy test helpers take the template path now, so the new test
compiles the shipped template with the apiserver CEL compiler like the
external TLS policy test does.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 6bb0fda706)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The Service rendered ports 6443 and 50000 under httpAndHttps, while the
Deployment declares the kubernetes and talos container ports and HAProxy
binds those frontends only under kubernetesAndTalos. So with the default
values every Service carried two ports whose targetPort names no
container declares, with no endpoints behind them, and with
external: true the LoadBalancer Service carried them as well. A release
with kubernetesAndTalos and without httpAndHttps got no Service port for
those frontends at all.
kubernetesAndTalos is not documented in values.yaml, but the apps API
keeps the top level of spec open and hands it to the chart as values,
so the key reaches the chart and the Deployment and the ConfigMap
already follow it. Gating the Service on the same key keeps the three
templates in step, while dropping the block would leave HAProxy
listening on ports that no Service exposes.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 78cadf53f9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The foundationdb-operator PackageSource sets no upgradeCRDs policy, so
a cluster installed before v1.6.0 runs the v2.30.0 operator on the
v2.13.0 CRDs it first installed. The apiserver prunes every field added
since, status.backupDetails.restorable on FoundationDBBackup among
them, so a backup never shows as restorable however long it has run.
The v2.30.0 CRDs only add fields. They keep the single v1beta2 version
and drop or retype nothing, and the one new constraint, a pattern on
perpetual_storage_wiggle_locality, sits on a field the platform does
not set, so CreateReplace is safe.
Nothing in the foundationdb-operator package changes here, so a cluster
picks the new CRDs up at the next upgrade of that release, which comes
with the next change to the package.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8e96a3e9b7)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
keycloak-operator ships its CRDs in the chart's crds/ directory and its
PackageSource sets no upgradeCRDs policy, so helm-controller never
replaces them. A cluster installed before v1.2.0 therefore runs the
v1.32.0 operator against the v1.25.0 CRDs, whose ClusterKeycloakRealm
schema has no spec.sessions, spec.login or spec.organizationsEnabled.
The apiserver drops those fields from the realm keycloak-configure
renders, so the operator never applies the session limits the platform
sets. On a v1.6.4 cluster in that state Keycloak also rejected the
dashboard client with HTTP 400, and replacing the CRDs from the chart
by hand, with an operator restart, cleared it.
The v1.32.0 CRDs are not purely additive. They drop the realm,
targetRealm and keycloakOwner fields that v1.25.0 marked deprecated and
require realmRef and keycloakRef instead. Every Keycloak object the
platform renders already uses the refs, and each CRD keeps its single
version, so replacing them loses nothing the platform relies on.
helm-controller applies the policy only when it upgrades the release,
and it runs an upgrade only when the release artifact or its values
change, which a PackageSource edit does not do. The package test added
here also changes the keycloak-operator artifact, so the replace runs
on the upgrade that ships this change even where nothing else in the
package changes. The test itself pins the realm fields
keycloak-configure sets against the CRD the chart ships.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit b74029cb39)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
linstor_error_reports_count comes from the LINSTOR controller, so its
series carry the controller pod's instance and controller_node labels.
When the pod moves to another node, or an external label of the scrape
changes, the existing report counts come back as new series.
VictoriaMetrics' increase() counts the first samples of a series from
zero when they are small, and report counts are small, so
linstorSatelliteErrorRate fires for every node with an old report and
keeps firing for 15 minutes. The up guard matches on instance and lets
the new series through.
The controller also leaves a satellite out of the metric while it is
not connected, so a satellite that comes back after more than five
minutes has its old count counted again in the same way.
Keyed on hostname, a moved controller or a changed label continues the
same series, and holding the last value for an hour bridges a
disconnect or a slow controller restart. The up guard matches on()
because the result no longer has an instance label. The controller
rule takes the same form. Its hostname is the pod name and a new pod
starts with no reports, but a label change hit it the same way.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8502629995)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The apps API admits release names of up to 53 characters, and several
charts name a Job <release>-<suffix>. Kubernetes copies a Job name into
the job-name label of its pods, and a label value takes at most 63
characters, so the apiserver refused these Jobs for the longest names. A
Kafka whose name has 42 to 44 characters could not be installed, a
VMDisk of 37 or more could not grow, a VMInstance of 40 or 41 could not
take an instance type, profile or external change, and a Bucket of 44 or
more or a Qdrant of 42 or more failed its post-delete hook. Those Job
names, and the pod label vm-instance copies from one, are now cut to 63
characters. A release name is never longer than 53, so only the fixed
suffix is cut and two releases still get two Jobs.
A CronJob name is refused over 52 characters, because the controller
names each Job it starts <cronjob>-<timestamp>. With the backup CronJob
on, a MariaDB whose name has 38 characters or more and a ClickHouse of
35 or more failed the whole release. A cut there reaches into the
release name and could give two releases one CronJob, so a name that
does not fit becomes the release name cut to 38 characters, a hash of
the full release name and -backup, the way the ClickHouse Keeper name
is already shortened.
The tenant cleanup Job is named after the tenant namespace, which a
nested tenant can fill to 63 characters by itself. The Job runs in
cozy-system next to that of every other tenant, where a plain cut could
give a parent and its child one name and let the child's
before-hook-creation delete the parent's Job while it runs, so it is
shortened with a hash of the namespace the same way.
Names that fit render exactly as before, and a name that did not fit
never produced an object, so nothing is renamed on upgrade. The hook
ServiceAccounts, Roles and RoleBindings have no such limit and keep
their names.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit a2c9c07a16)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
A VMDisk created with source upload waits in UploadReady for an image,
but no tenant role can fill it. virtctl image-upload reads the disk PVC
and CDI's PVC Prime and requests an upload token, and the tenant roles
grant neither get on persistentvolumeclaims nor create on
uploadtokenrequests, so the command stops on a forbidden PVC read.
cozy:tenant:admin:base now grants both, so tenant admins and
super-admins get them in their own namespaces through the existing
RoleBindings, while the use and view tiers do not. Reading the
DataVolume is already granted for the disk's own name by the vm-disk
chart's dashboard role. The vm-disk notes print the command with
--no-create, because the chart has already created the DataVolume, and
the security self-assessment and threat model list the new grants.
The rules, their tests, the notes change and the docs lines come from
#3847, which also carries a console upload panel and an upload proxy
certificate that are still in review there.
Fixes#3759
Co-authored-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit bcc5f3216a)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The test only looked at the topology key and the label selector, so a
change to maxSkew or to whenUnsatisfiable went unnoticed.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 70e1e8b145)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
With one admission controller and failurePolicy Ignore, a pod created
while that controller is being rescheduled is admitted without its VPA
recommendation, and with updateMode Initial it keeps the defaults for
the rest of its life. On a v1.6.5 cluster a vmstorage pod created during
a node drain got the operator defaults, a 1500Mi limit against a 3.4Gi
recommendation, and was OOMKilled weeks later.
A second replica on another node and a PodDisruptionBudget keep one
controller serving through a drain. The controller still deletes and
recreates its webhook configuration on start, so a restart leaves only
that short gap instead of the whole reschedule.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 34766ff0b5)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The case lists InfoInhibitor in email.alertnames but only asserted the
route order up to the blackhole, so it would still pass if the email
route for a listed name stopped being rendered.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 00c11c7a74)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
InfoInhibitor exists to be the source side of an Alertmanager inhibit
rule and, as its own description says, to go to a null receiver. The
platform Alertmanager config has no inhibit rule, and the rule has
carried severity major since it was imported alongside Alerta, so
Alerta shows it one level below critical. Alerta's Telegram and Slack
plugins forward it by default, and a notify_email label inherited from
the info alert gets it emailed too.
It fires whenever a rule labelled severity="info" is active with no
warning or critical alert in the same namespace and cluster. The
platform's own rules no longer use info, but rules it does not write
still do. CDI generates CDIStorageProfilesIncomplete, KubeVirt
generates KubeVirtVMGuestMemoryAvailableLow, and operators add their
own. Each of them turns into a major InfoInhibitor in Alerta.
none is the severity upstream kube-prometheus gives this rule, and the
platform config already sends severity="none" to the blackhole ahead
of every route that delivers. The severity contract refuses none
because such an alert is never delivered, so InfoInhibitor is named as
the one alert for which that is the point. Tests hold both ends, so
neither the label nor the route order can drift back to delivering it.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 89028b455e)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
Alerta turns the Watchdog into a heartbeat and stores its severity in the
heartbeat attributes. The alerta heartbeats --alert job of the alerta-web
image takes the severity of a stale heartbeat from those attributes ahead
of its HEARTBEAT_SEVERITY default, so with severity ok the HeartbeatFail
it raises is a normal alert and nothing says the alerting pipeline
stopped. Without a timeout label the heartbeat also took a day to go
stale, while Alertmanager refreshes it every minute.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit a7ec05f9eb)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
CDI checks a clone against its source before it creates the claim. When
the golden image's PVC is in Block mode and requests more than the disk,
it records CloneValidationFailed and leaves the DataVolume pending for
good. The DataVolume spec is immutable, so raising storage on the VMDisk
afterwards changes nothing, and the resize hook finds no claim to patch.
Every image in vm-default-images is 20Gi on replicated, where CDI picks
Block mode for the LINSTOR driver, while the chart defaults storage to
5Gi, so a disk created from an image at the default size never comes up.
The chart now refuses such a disk at render time and names both sizes,
so the user sets storage to the golden's size before any DataVolume
exists. It compares what validateClone compares in CDI v1.66.1, the
golden PVC's request against the disk's request raised to the target
StorageProfile's minimumSupportedPvcSize. A Filesystem golden is not
compared, because CDI sizes that clone from the image inside it or with
a filesystem overhead, and neither is a golden whose PVC does not exist
yet. An existing disk is exempt, as for the other golden checks.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 8d82348e85)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The affinity description and the comment above the affinity block
explained the soft default by a member that would stay Pending on its
node-local volume. Now that the spread is DoNotSchedule by default, the
spread keeps such a member Pending as well, once its node holds another
member and some other node holds none. Both texts now explain the soft
default by what is left, that a required rule forbids two members on
one node even when every node has one, and state the node-local case
for both rules.
The description also says that the operator copies affinity into each
EtcdMember when it creates it, so a recreated Pod keeps the rule its
member was created with. README, values.schema.json and the
ApplicationDefinition are regenerated from it.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 9f6fdd77c6)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The default spread of the etcd members was ScheduleAnyway, which only
adds to the score of a node, and other scores can outweigh it. A new
etcd on a three-node cluster got its first two members on one node.
On a node-local StorageClass a member cannot leave its node, so losing
that node takes two of the three members and the quorum.
DoNotSchedule with maxSkew 1 still lets an etcd with more members than
nodes start, because the skew is counted between the nodes that exist.
One node takes all three members and two nodes take two and one.
nodeTaintsPolicy is Ignore, so a cordoned node still counts and a
member waits for it instead of landing next to another member.
The operator copies the constraints into an EtcdMember when it creates
it and builds the Pod from that copy, so members that exist keep the
old setting and only members created later get the new one.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit f1f30b3071)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
ingress-nginx has no ConfigMap key for the client-side keepalive_time,
so nginx applies its 1h default and closes every HTTP/2 connection
that reaches that age with a GOAWAY. Clients that multiplex a long
operation over a single connection see it fail: a kopia repository
maintenance run by Velero against SeaweedFS lasted just over an hour
and died while listing blobs, with "http2: server sent GOAWAY and
closed the connection; ErrCode=NO_ERROR", because the listing is not
retried.
Set keepalive_time to 12h through http-snippet. Idle connections are
still closed by keep-alive after 75s, so this only lengthens the life
of connections that are actually in use.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 5f6679e4cf)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The VMServiceScrape selected app.kubernetes.io/instance=vmalert, while the
chart names the VMAlert vmalert-<first metricsStorages name> and the
operator puts that name into the instance label of its Service. The scrape
matched nothing, so the metrics of vmalert itself were never collected.
The instance stays in the selector so the scrape keeps pointing at the one
VMAlert this release renders.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 7bda2bdbc0)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The hourly defrag pod runs the etcd-defrag client, which only sends
defragment calls to the members, yet it requested 200m CPU and 256Mi
from the tenant quota. On a sandbox tenant whose quota was mostly taken
by its own etcd and SeaweedFS, the job could not create a pod and the
defrag never ran. The client peaked at 5.1 MiB working set over a day
on a v1.6.5 cluster.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
(cherry picked from commit 61289c7210)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The sidecar was left without a CPU limit so that a throttled sidecar
would slow WAL archiving down rather than fail it. In a tenant with
resourceQuotas that does not hold: the tenant LimitRange gives every
container a 250m CPU limit by default, so the sidecar gets it and
compresses full backups and WAL segments on a quarter of a core. A
1.6 GB database took 30 minutes to back up.
Set an explicit one-core limit in both places that build the sidecar
configuration, the backup driver and cozy-lib, the same way the memory
request and limit already override the LimitRange defaults.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f1dd2d17fc)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
SeaweedFS 4.45 updates the crowded-volume map of a volume layout under
the read lock, while Assign reads that map under the same read lock to
count writable volumes. Under a steady write load the Go runtime aborts
the master with "concurrent map read and map write", a fatal error that
recover cannot catch, and the S3 gateway answers 500 until a master is
elected again. Taking the write lock for the update, as every other
mutation of the map already does, removes the race.
Upstream fixed it in seaweedfs/seaweedfs#11216, released in 4.46. The
patch carries that change and its regression test unchanged, so the
build runs the test and the patch stops applying, and is dropped, once
the vendored release carries the fix.
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
Assisted-by: LLM
(cherry picked from commit 9e861c1178)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The API server rejects a Service that declares no port, so a VM switched
to external PortList with an empty port list could not be upgraded: the
release failed and was retried forever, while the old Service kept the
previously listed ports open.
Render a single SCTP placeholder in that case. cozy-proxy only admits
TCP and UDP ports into its PortList filter, so the VM keeps its external
IP for egress and ICMP while all inbound TCP and UDP traffic is dropped,
which is what an empty port list means.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit c6f1d6c559)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
Disabling the Monitoring Agents addon of a tenant cluster removes this
release, the VictoriaMetrics operator and the VPA CRDs together, and
Flux deletes them in parallel without honouring dependsOn. When the
operator goes first, nothing clears apps.victoriametrics.com/finalizer
on the VMAgent and the other VictoriaMetrics objects this chart created,
so they stay Terminating and the release sits in UninstallFailed for
good.
Clearing those finalizers has to happen inside the uninstall and must
never be what blocks it, and a live operator still has to get the first
chance to finalize its objects. Only objects of this release may be
touched, and release names are unique only within a namespace, so the
release name alone does not identify them. kubectl loads in-cluster
credentials only while the client config is otherwise default, which a
--request-timeout breaks. A VPA recorded in the release manifest while
its CRD is not served cannot be mapped at uninstall either.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 4f35af6694)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The S3 Ingress kept rendering with no ingress-nginx to serve it. Now
that seaweedfs-system no longer waits on ingress-nginx-system there, the
release completes and the unserved Ingress would stay behind.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 67fcadf689)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
grafana-operator creates the Ingress from spec.ingress verbatim, so an
empty _namespace.ingress reached the API as ingressClassName "" and was
rejected. With no ingress-nginx in the tenant there is nothing for that
Ingress to attach to.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 275c840a8c)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
An empty _namespace.ingress means no ingress-nginx serves the tenant,
which tenant-root now reports when the root Tenant has ingress off. The
Ingress would carry ingressClassName "", which the API rejects, and the
release would fail to install where it used to leave an unserved
Ingress behind.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit c61e6a842e)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
seaweedfs-system waits on ingress-nginx-system only when _namespace.ingress
names its own namespace. With tenant-root's key now empty when the root
Tenant runs no ingress, an empty value has to drop the dependency, and a
value inherited from a parent must not add it.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit b26001b6f9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
cozystack-basics wrote _namespace.ingress: tenant-root whatever the root
Tenant's spec.ingress said, so applications in tenant-root were told an
ingress-nginx runs there when nothing deploys it. SeaweedFS then waited
forever on ingress-nginx-system, and the platform backup bucket with it.
Every other tenant already derives the key and leaves it empty without
ingress.
cozystack-basics cannot read the root Tenant, so the platform carries
its ingress state the way it carries monitoring: ingress.rootEnabled
reaches the Secret as _cluster.ingress-enabled and gates the key. The
default keeps the value existing clusters render, and a Secret written
before the key existed keeps it too.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit 5b6708c7f9)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
seaweedfs-cosi-driver v0.3.1 grants access by rewriting the legacy
/etc/iam/identity.json. Each S3 gateway migrates that file to
per-identity files and renames it away whenever it changes, so a grant
written while a gateway is migrating is lost: the BucketAccess reports
accessGranted and its Secret is written, but every gateway rejects the
key with InvalidAccessKeyId and never recovers. Users added to a Bucket
in one change lose a key regularly. v0.4.0 also writes the per-identity
file on grant.
The rest of v0.4.0 does not reach the platform. The
readwrite-governance-bypass access policy is opt-in and no
BucketAccessClass uses it. The refusal to delete a bucket that still
holds locked objects applies only to object-lock buckets, and their
classes are Retain, so the sidecar never calls DriverDeleteBucket for
them.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 6a93765351)
Signed-off-by: cozystack-ci[bot] <274107086+cozystack-ci[bot]@users.noreply.github.com>
The Altinity and RabbitMQ strategy Pods ran platform-migrations, a 349 MB
image carrying kubectl, helm and etcd-migrate whose ENTRYPOINT is the
migration runner, and whose pins were stamped from packages/core/platform
so every migration change moved the backup clients too.
Build images/backup-http-client (alpine + curl + jq + ca-certificates,
non-root) from this package's Makefile and stamp both client keys from
it. The cross-package stamp in packages/core/platform/Makefile and the
platform-migrations-specific check in hack/image-pin-consistency.bats go
away; the general one-digest-per-repository check still covers the two
keys sharing one image.
Fixes#3420
Assisted-by: LLM
Signed-off-by: Andrey Kolkov <androndo@gmail.com>
(cherry picked from commit 647407545d)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Chainsaw v0.2.15 ends an assert or error operation on the first API
error other than NotFound. kube-apiserver answers a GET with 500 when
etcd changes its leader, so a leader change that lands inside a poll
fails the step long before its own timeout, on whichever suite happens
to be polling.
The sandbox image now builds v0.2.15 from source with the fix proposed
upstream in kyverno/chainsaw#2761, applied unchanged, until a chainsaw
release carries it. The build runs the tests of the patched packages
and a test that drives chainsaw built from the patched tree against a
fake apiserver: a run of 500s must not fail an assert, and a
persistent one must fail it at its timeout rather than at the first
error.
Closes: #4720
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
(cherry picked from commit 813c618086)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The monitoring-agents chart reads vmagent.remoteWrite.urls as a list and
takes the tenant label from global.target, while the kubernetes app still
passed a single remoteWrite.url and vmagent.externalLabels.tenant. Both
keys were dropped in silence, so the vmagent of every tenant cluster fell
back to the chart defaults: it wrote to vminsert services in
cozy-monitoring that do not exist inside the tenant cluster, queued the
failed writes on the node disk, and labelled every series
tenant="cozy-monitoring". No tenant cluster metric reached the tenant's
Monitoring.
The tenant label has to name the tenant that owns the cluster, which is
not always the tenant whose Monitoring receives the data: a tenant
without its own Monitoring inherits a parent's.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 55d6c52fab)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
postgres, template0 and template1 were accepted in databases and handled
like an application database. The init job made <db>_admin their owner,
installed the auto-grant event trigger in them and, once the entry left
values, ran DROP DATABASE on them. That DROP can only fail (template
databases cannot be dropped, and the job is connected to postgres), so
every later upgrade failed in the init job and the release stayed in
UpgradeFailed even after the entry was put back. template1 also passed
the takeover on to every database created from it afterwards, where the
trigger, naming a role about to be dropped, makes CREATE SCHEMA fail.
A release a previous version let take one of them over has to be
repaired without dropping it, and without touching what this chart did
not create: a role or owner that merely carries an expected name may
belong to a tenant or an administrator, and a role comment can be set
by any CREATEROLE holder, so only the cozystack:managed mark is trusted.
What the marked roles own goes to cozystack:orphaned rather than to the
superuser, since a tenant's SECURITY DEFINER function would otherwise
run with superuser rights. A failed lookup of the databases cloned from
template1 has to stop the run before template1 stops being selected, or
those clones would never be repaired.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f003851338)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The air-gapped note said in-guest image pulls honour no per-tenant
mirror until a Phase 2 that has landed, so an operator setting up an
air-gapped cluster would read that mirroring is unavailable and file
an issue. It now says the Secret and the platform registries value are
removed, that a Package still setting the value keeps installing, and
that worker mirrors are set per pool through talos.registryMirrors of
the KubernetesNodes resource.
Assisted-by: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit 41507e36aa)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Nothing reads the Secret: the kubeadm certs.d mount it fed is gone and
the Talos worker config never took it. The value stayed in the Package
spec as a knob that accepts mirrors and does nothing, which is worse
than no knob for an operator in an air-gapped setup. Mirrors for tenant
workers are a per-pool field of the KubernetesNodes chart.
A Package that still sets registries keeps installing: the platform
chart has no values schema, so the key is ignored.
Assisted-By: LLM
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
(cherry picked from commit e79946e79c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The long-name case checked only that the Job name fits in 63 characters and that the Job targets the right PDB. A Job name that dropped the release, letting two releases' hooks replace each other, or a Role granting a different PDB would both have passed.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 9fba8af69c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The operator runs three Redis pods when the count is zero or negative, but the chart treated any count up to 1 as the single-pod case. Such a cluster got one Sentinel and no Sentinel PDB, while three Redis pods ran under it.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit a7f84242d1)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The API server copies a Job's name into its pods' job-name label, which
takes 63 characters at most, and a release name may take 53, so
<release>-sentinel-pdb could be refused and leave the stale PDB in
place. The Job name is truncated; the ServiceAccount, Role and
RoleBinding keep the full name.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 2541aec625)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Setting sentinel.disablePodDisruptionBudget only stops the operator from
ensuring the PDB; it never deletes the one it created while three
Sentinels ran. An existing instance scaled to one Redis pod therefore
kept minAvailable 1 on its single Sentinel, which refuses every
eviction. A post-upgrade hook deletes rfs-<release> in that case.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 7c1bd33b08)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The chart pinned three Sentinels whatever the replica count, so a
single-pod instance paid for three pods that have nothing to fail over
to. One Sentinel is enough for the operator to locate the master: its
quorum is replicas/2+1, which is 1.
The operator gives the Sentinel Deployment a PodDisruptionBudget with
minAvailable 1 whenever Redis has two replicas or fewer. On a single
Sentinel that budget refuses every eviction and would block node
drains, so it is disabled in that case. From two Redis pods up nothing
changes: three Sentinels, budget kept.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit 48779cc03b)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The helm-unittest sweep reaches a package only through its make test
target, so the suite added with the cluster-name fix would otherwise
never run in CI.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit f21abe0d35)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The package pinned clusterName to cozy.local, so on a cluster installed
with any other networking.clusterDomain the operator resolved its own
MariaDB pods as <name>.<ns>.svc.cozy.local and got NXDOMAIN. Replication
between replicas was never configured, and User, Database and Grant
resources failed to reconcile, with the operator only retrying at a
verbose log level.
clusterName is a vendored subchart value, out of reach of the _cluster
lookup that package templates use, so the platform now carries it under
the subchart key in the shared values Secret, the same route KEDA and
the OpenSearch operator already take. The literal in the package stays
as the default for a render without that Secret.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit c70f83b375)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
keys returns a map's keys in Go's randomized iteration order, so a
release with several databases rendered DEFINED_DBS in a different
order on each upgrade. The init-script Secret, and the checksum the
init Job carries, then changed on upgrades that left the databases
untouched, which makes a no-op upgrade look like a real change in the
release history.
Assisted-by: LLM
Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
(cherry picked from commit dc94660a44)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The values reference read as if the credentials endpoint were always
compared and an object without the endpoint annotation never forced a
render. Operators sizing the force counter or choosing a custom
systemSecretName need both conditions spelled out.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit c6c107fd08)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
The gate forces bucket-<bucketName>-system, which renders the
credentials Secret of that bucket's system user and nothing else. The
COSI Secret name was derived from systemSecretName instead, so a value
naming another bucket's Secret made a lagging endpoint there force the
platform bucket release every throttle window without ever refreshing
the Secret that was compared.
Assisted-by: LLM
Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
(cherry picked from commit dc909c778c)
Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>