Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ make uninstall
make undeploy
```

## Connectivity lifecycle

Modules support `spec.disabled` in addition to Stack disable. Connectivity retains its configuration and credentials on either disable and delegates asynchronous deletion cleanup to its controller. See the [lifecycle and upgrade requirements](docs/04-Modules/12-Connectivity.md#disable-and-delete) before upgrading the operators.

## Settings

See defined settings in [Settings](docs/09-Configuration%20reference/01-Settings.md)
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/auth_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ func (in *Auth) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Auth) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Auth) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/connectivity_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (in *Connectivity) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Connectivity) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Connectivity) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/gateway_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ func (in *Gateway) IsEE() bool {
return false
}

func (in *Gateway) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Gateway) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/ledger_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ func (in *Ledger) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Ledger) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Ledger) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/mcp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (in *MCP) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *MCP) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *MCP) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/orchestration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ func (in *Orchestration) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Orchestration) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Orchestration) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/payments_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ func (in *Payments) SetError(s string) {
in.Status.Info = s
}

func (in *Payments) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Payments) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/reconciliation_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (in *Reconciliation) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Reconciliation) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Reconciliation) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/search_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func (in *Search) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Search) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Search) GetVersion() string {
return in.Spec.Version
}
Expand Down
5 changes: 5 additions & 0 deletions api/formance.com/v1beta1/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,17 @@ type AuthConfig struct {
type Module interface {
Dependent
GetVersion() string
IsDisabled() bool
IsDebug() bool
IsDev() bool
IsEE() bool
}

type ModuleProperties struct {
// Disabled stops module workloads while retaining configuration for re-enabling.
// A disabled Stack also disables its modules.
// +optional
Disabled bool `json:"disabled,omitempty"`
DevProperties `json:",inline"`
//+optional
// Version overrides, for a specific module, the global version defined at stack level
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/stargate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (in *Stargate) IsEE() bool {
return false
}

func (in *Stargate) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Stargate) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/transactionplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ func (in *TransactionPlane) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *TransactionPlane) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *TransactionPlane) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/wallets_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func (in *Wallets) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Wallets) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Wallets) GetVersion() string {
return in.Spec.Version
}
Expand Down
4 changes: 4 additions & 0 deletions api/formance.com/v1beta1/webhooks_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func (in *Webhooks) GetConditions() *Conditions {
return &in.Status.Conditions
}

func (in *Webhooks) IsDisabled() bool {
return in.Spec.Disabled
}

func (in *Webhooks) GetVersion() string {
return in.Spec.Version
}
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_auths.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
enableScopes:
default: false
description: |-
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_connectivities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_gateways.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
ingress:
description: Customizes the generated ingress
properties:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_ledgers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_mcps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_orchestrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_payments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
encryptionKey:
type: string
stack:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_reconciliations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_searches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_stargates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
organizationID:
type: string
serverURL:
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_transactionplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_wallets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
5 changes: 5 additions & 0 deletions config/crd/bases/formance.com_webhooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ spec:
Enables dev mode on the module
Dev mode lets an application do custom setup in development mode (allowing insecure certificates, for example)
type: boolean
disabled:
description: |-
Disabled stops module workloads while retaining configuration for re-enabling.
A disabled Stack also disables its modules.
type: boolean
stack:
description: Stack indicates the stack on which the module is installed
type: string
Expand Down
19 changes: 19 additions & 0 deletions docs/04-Modules/01-Stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,22 @@ spec:

During the deployment of the Operator and for its future upgrades, the Versions files are automatically updated following the semver pattern.
It is possible to specify a specific version by using the `versionFromFile` field in the Stack file.

## Disable and deletion

Disabling a Stack retains its namespace and durable resources. Connectivity uses
its delegated disable contract to stop Core, API and all ConnectorInstance
workloads while retaining configuration and credentials. Other modules keep their
existing owned-runtime removal behavior. See [Connectivity lifecycle](12-Connectivity.md#disable-and-delete)
for rollout requirements and observable completion conditions.

Deleting a Stack requests deletion of all modules without imposing a Connectivity
cleanup order, then follows the existing resource and namespace deletion lifecycle.
The Connectivity controller owns its asynchronous cleanup. Namespace deletion also
deletes externally supplied Secrets stored inside it.

Do not create or reassign module attachments while a Stack is deleting. Normal
reconciliation reads the Stack through the manager's cached client and checks its
deletion timestamp; deletion discovers
existing attachments while requesting cleanup. These checks do not provide a
transaction across independent API writers.
23 changes: 23 additions & 0 deletions docs/04-Modules/03-Ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,29 @@ name for Service and NetworkPolicy selectors and does not follow the random
identity. The resolved ID is visible on the child Cluster and supplies Ledger's
default backup namespace unless a backup `bucketId` is configured.

The Operator records the owned child Cluster identity in the Ledger annotation
`formance.com/ledger-v3-cluster-id` before module or Stack disable removes the
child. Enabling it again restores that identity on the recreated Cluster,
keeping the same namespace, Cluster name, and PVC names. Primary and preview
use the same child name and remembered identity. The Ledger Operator storage
retention policy must retain the PVCs for their data to remain available.
After observing an owned primary (non-preview) Cluster, the Operator also
records its ID in `formance.com/ledger-v3-primary-cluster-id`. This matching
primary marker allows recreation when incompatible module CRs remain on the
Stack. An ID from a preview, an older installation without the primary marker,
or a configured clusterID alone does not grant this migration exception.
Existing legacy Ledger Deployments or a Database still require explicit migration.

If writing this annotation fails, disable cleanup stops. Without an explicit
configured ID, cleanup also waits until the existing child has a clusterID;
this prevents deletion racing with its initial identity generation. A disagreement
between the child identity, the remembered identity, and an explicit
`LedgerConfiguration.spec.cluster.clusterID` also stops reconciliation; restore
matching identity values before retrying. The Operator never adopts identity
from a Cluster controlled by another object or without a Ledger controller
reference. If both the child and its remembered identity are lost, this
mechanism cannot recover the identity from the PVC contents.

The Ledger Operator must be installed before the Formance Operator starts so
that the latter can watch `Cluster` resources. If the CRD is unavailable, the
Ledger remains pending and no legacy resources are created.
Expand Down
Loading
Loading