From 3564bbb7348e35266a00e59543b38dc70adf726f Mon Sep 17 00:00:00 2001 From: jdupas22 <106673437+jdupas22@users.noreply.github.com> Date: Thu, 6 Jul 2023 15:06:07 +0200 Subject: [PATCH] refactor: move CRD parts in the correct part to be followed in order --- .../deployment/cloudprem/cluster-config.mdx | 138 ------------------ docs/docs/deployment/cloudprem/operator.mdx | 138 ++++++++++++++++++ 2 files changed, 138 insertions(+), 138 deletions(-) diff --git a/docs/docs/deployment/cloudprem/cluster-config.mdx b/docs/docs/deployment/cloudprem/cluster-config.mdx index e2f98b21fd..36c100767b 100644 --- a/docs/docs/deployment/cloudprem/cluster-config.mdx +++ b/docs/docs/deployment/cloudprem/cluster-config.mdx @@ -74,143 +74,6 @@ Using Temporal is only required for stacks using the flows service. It can be om The recommended way to spin up a Temporal deployment is through Temporal Cloud, or by using the official Temporal helm [chart](https://github.com/temporalio/helm-charts). -## Custom resource definitions - -Two CRDs will be used by the Formance Operator to provision resources in our cluster: the configuration CRD, and the versions CRD. - -### Versions CRD - -The "Versions" CRD defines the versions that we want to deploy — this allows the operator to provision the created stacks with a fixed set of versions for each stack service. - -```yaml -# versions.crd.yml -apiVersion: stack.formance.com/v1beta3 -kind: Versions -metadata: - name: default -spec: - auth: latest - control: latest - gateway: latest - ledger: latest - orchestration: latest - payments: latest - search: latest - wallets: latest - webhooks: latest -``` - -:::tip -Thanks to this CRD, you can also deploy a custom version of a service, including one you've modified yourself. -::: - -Saving the CRD is as simple as running the following command: - -```bash -kubectl apply -f versions.crd.yml -``` - -### Configuration CRD - -The "Configuration" CRD defines the configuration of our application. This includes configuration settings such as listening ports, environment variables, and secrets. - -```yaml -# configuration.crd.yaml -apiVersion: stack.formance.com/v1beta3 -kind: Configuration -metadata: - name: stacks -spec: - broker: - nats: - url: NATS_URL - ingress: - annotations: - traefik.ingress.kubernetes.io/router.entrypoints: web - light: true - services: - auth: - postgres: - disableSSLMode: true - host: POSTGRESQL_HOST - port: POSTGRESQL_PORT - username: POSTGRESQL_USERNAME - password: POSTGRESQL_PASSWORD - control: {} - ledger: - postgres: - disableSSLMode: true - host: POSTGRESQL_HOST - port: POSTGRESQL_PORT - username: POSTGRESQL_USERNAME - password: POSTGRESQL_PASSWORD - orchestration: - postgres: - disableSSLMode: true - host: POSTGRESQL_HOST - port: POSTGRESQL_PORT - username: POSTGRESQL_USERNAME - password: POSTGRESQL_PASSWORD - payments: - encryptionKey: DEFAULT_ENCRYPTION_KEY - postgres: - disableSSLMode: true - host: POSTGRESQL_HOST - port: POSTGRESQL_PORT - username: POSTGRESQL_USERNAME - password: POSTGRESQL_PASSWORD - search: - batching: - count: 50 - period: 1s - elasticSearch: - host: ELASTICSEARCH_URL - pathPrefix: '' - port: 443 - scheme: https - tls: {} - wallets: - debug: false - dev: false - webhooks: - debug: false - dev: false - postgres: - disableSSLMode: true - host: POSTGRESQL_HOST - port: POSTGRESQL_PORT - username: POSTGRESQL_USERNAME - password: POSTGRESQL_PASSWORD - temporal: - address: TEMPORAL_ADDRESS - namespace: TEMPORAL_NAMESPACE - tls: - crt: TEMPORAL_TLS_CERT - key: TEMPORAL_TLS_KEY -``` - -Before saving the CRD, make sure to replace the following values with your own: - -- `NATS_URL`: The URL of your NATS instance -- `POSTGRESQL_HOST`: The host of your PostgreSQL instance -- `POSTGRESQL_PORT`: The port of your PostgreSQL instance -- `POSTGRESQL_USERNAME`: The username of your PostgreSQL instance -- `POSTGRESQL_PASSWORD`: The password of your PostgreSQL instance -- `DEFAULT_ENCRYPTION_KEY`: The encryption key to use for the payments service -- `ELASTICSEARCH_URL`: The URL of your Elasticsearch instance - -And the following values if you want to use Temporal: -- `TEMPORAL_ADDRESS`: The address of your Temporal instance -- `TEMPORAL_NAMESPACE`: The namespace of your Temporal instance -- `TEMPORAL_TLS_CERT`: The TLS certificate of your Temporal instance -- `TEMPORAL_TLS_KEY`: The TLS key of your Temporal instance - -Saving the CRD is then simply done by running the following command: - -```bash -kubectl apply -f configuration.crd.yml -``` - ## Summary Before moving on to the next step, make sure that you have: @@ -218,6 +81,5 @@ Before moving on to the next step, make sure that you have: - Set up an ingress controller, with SSL enabled - Installed cert-manager (or had it already installed) - Deployed the required stateful dependencies -- Created the versions and configuration CRDs With these steps completed, we can now move on to creating our very own Formance Cloud private region and deploying the Formance Operator. \ No newline at end of file diff --git a/docs/docs/deployment/cloudprem/operator.mdx b/docs/docs/deployment/cloudprem/operator.mdx index 19290523df..a3b8172aff 100644 --- a/docs/docs/deployment/cloudprem/operator.mdx +++ b/docs/docs/deployment/cloudprem/operator.mdx @@ -47,6 +47,144 @@ helm upgrade --install regions oci://ghcr.io/formancehq/helm/regions \ --values region.values.yaml ``` +## Custom resource definitions + +Two CRDs will be used by the Formance Operator to provision resources in our cluster: the configuration CRD, and the versions CRD. + +### Versions CRD + +The "Versions" CRD defines the versions that we want to deploy — this allows the operator to provision the created stacks with a fixed set of versions for each stack service. + +```yaml +# versions.crd.yml +apiVersion: stack.formance.com/v1beta3 +kind: Versions +metadata: + name: default +spec: + auth: latest + control: latest + gateway: latest + ledger: latest + orchestration: latest + payments: latest + search: latest + wallets: latest + webhooks: latest +``` + +:::tip +Thanks to this CRD, you can also deploy a custom version of a service, including one you've modified yourself. +::: + +Saving the CRD is as simple as running the following command: + +```bash +kubectl apply -f versions.crd.yml +``` + +### Configuration CRD + +The "Configuration" CRD defines the configuration of our application. This includes configuration settings such as listening ports, environment variables, and secrets. + +```yaml +# configuration.crd.yaml +apiVersion: stack.formance.com/v1beta3 +kind: Configuration +metadata: + name: stacks +spec: + broker: + nats: + url: NATS_URL + ingress: + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + light: true + services: + auth: + postgres: + disableSSLMode: true + host: POSTGRESQL_HOST + port: POSTGRESQL_PORT + username: POSTGRESQL_USERNAME + password: POSTGRESQL_PASSWORD + control: {} + ledger: + postgres: + disableSSLMode: true + host: POSTGRESQL_HOST + port: POSTGRESQL_PORT + username: POSTGRESQL_USERNAME + password: POSTGRESQL_PASSWORD + orchestration: + postgres: + disableSSLMode: true + host: POSTGRESQL_HOST + port: POSTGRESQL_PORT + username: POSTGRESQL_USERNAME + password: POSTGRESQL_PASSWORD + payments: + encryptionKey: DEFAULT_ENCRYPTION_KEY + postgres: + disableSSLMode: true + host: POSTGRESQL_HOST + port: POSTGRESQL_PORT + username: POSTGRESQL_USERNAME + password: POSTGRESQL_PASSWORD + search: + batching: + count: 50 + period: 1s + elasticSearch: + host: ELASTICSEARCH_URL + pathPrefix: '' + port: 443 + scheme: https + tls: {} + wallets: + debug: false + dev: false + webhooks: + debug: false + dev: false + postgres: + disableSSLMode: true + host: POSTGRESQL_HOST + port: POSTGRESQL_PORT + username: POSTGRESQL_USERNAME + password: POSTGRESQL_PASSWORD + temporal: + address: TEMPORAL_ADDRESS + namespace: TEMPORAL_NAMESPACE + tls: + crt: TEMPORAL_TLS_CERT + key: TEMPORAL_TLS_KEY +``` + +Before saving the CRD, make sure to replace the following values with your own: + +- `NATS_URL`: The URL of your NATS instance +- `POSTGRESQL_HOST`: The host of your PostgreSQL instance +- `POSTGRESQL_PORT`: The port of your PostgreSQL instance +- `POSTGRESQL_USERNAME`: The username of your PostgreSQL instance +- `POSTGRESQL_PASSWORD`: The password of your PostgreSQL instance +- `DEFAULT_ENCRYPTION_KEY`: The encryption key to use for the payments service +- `ELASTICSEARCH_URL`: The URL of your Elasticsearch instance + +And the following values if you want to use Temporal: +- `TEMPORAL_ADDRESS`: The address of your Temporal instance +- `TEMPORAL_NAMESPACE`: The namespace of your Temporal instance +- `TEMPORAL_TLS_CERT`: The TLS certificate of your Temporal instance +- `TEMPORAL_TLS_KEY`: The TLS key of your Temporal instance + +Saving the CRD is then simply done by running the following command: + +```bash +kubectl apply -f configuration.crd.yml +``` + + ## Liveness check We now have a private region running on our cluster — let's check that it is active, and that it has successfully bind itself to the Formance Cloud control plane. We can do so by inspecting the region with fctl: