diff --git a/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/gateway-config.yaml index 3b7ea30589..8f145b472d 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-disabled-one-service/results/configmaps--v1/gateway-config.yaml @@ -214,12 +214,22 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10004/_info http://127.0.0.1:10004/_healthcheck - payments-api http://127.0.0.1:10002/_info http://127.0.0.1:10002/_health - payments-connectors http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - search http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - wallets http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - webhooks http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + auth { + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_healthcheck + } + payments { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_health + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + } + search { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + wallets { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + webhooks { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/gateway-config.yaml index 9da7548cb8..eb5ee8bf61 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-latest/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - ledger http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck - payments-api http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - payments-connectors http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health - search http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck - wallets http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck - webhooks http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + auth { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + ledger { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + orchestration { + http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck + } + payments { + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health + } + search { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } + wallets { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck + } + webhooks { + http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/gateway-config.yaml index 52f3002a9e..84c7cbe5aa 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-ledgerv1/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - ledger http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck - payments-api http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - payments-connectors http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health - search http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck - wallets http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck - webhooks http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + auth { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + ledger { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + orchestration { + http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck + } + payments { + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health + } + search { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } + wallets { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck + } + webhooks { + http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml index ec7a5c80ec..16f1e082ee 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-payments-after-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - ledger http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck - payments-api http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - payments-connectors http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health - search http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck - wallets http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck - webhooks http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + auth { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + ledger { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + orchestration { + http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck + } + payments { + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health + } + search { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } + wallets { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck + } + webhooks { + http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml index 6aba2845dd..d68610a2d2 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-payments-before-v1.0.0-alpha.6/results/configmaps--v1/gateway-config.yaml @@ -128,13 +128,27 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10004/_info http://127.0.0.1:10004/_healthcheck - ledger http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck - payments http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - search http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - wallets http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck - webhooks http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + auth { + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_healthcheck + } + ledger { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + orchestration { + http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck + } + payments { + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + } + search { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + wallets { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck + } + webhooks { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/gateway-config.yaml index b9549092f5..75386a2c0e 100644 --- a/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/monopod-search-before-v0.7.0/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck - ledger http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck - orchestration http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck - payments-api http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health - payments-connectors http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health - search http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck - wallets http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck - webhooks http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + auth { + http://127.0.0.1:10005/_info http://127.0.0.1:10005/_healthcheck + } + ledger { + http://127.0.0.1:10001/_info http://127.0.0.1:10001/_healthcheck + } + orchestration { + http://127.0.0.1:8080/_info http://127.0.0.1:8080/_healthcheck + } + payments { + http://127.0.0.1:10003/_info http://127.0.0.1:10003/_health + http://127.0.0.1:10004/_info http://127.0.0.1:10004/_health + } + search { + http://127.0.0.1:10006/_info http://127.0.0.1:10006/_healthcheck + } + wallets { + http://127.0.0.1:10002/_info http://127.0.0.1:10002/_healthcheck + } + webhooks { + http://127.0.0.1:10007/_info http://127.0.0.1:10007/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/gateway-config.yaml index 91d161650b..e797adcffe 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/configmaps--v1/gateway-config.yaml @@ -237,14 +237,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/gateway.yaml index 40f23282cb..29a40b15f1 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-debug/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: Q7NvcI6vScfjeoxdoeqyJuU8FPmESLvZheX7qHUTBrg= + stack.formance.cloud/volumes-hash: 9xebK6N2cZar3audOZIoMJuHUdlnw7W6Zktt5rewn5Y= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/gateway-config.yaml index f6dd20d0a7..8597c96ccf 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/configmaps--v1/gateway-config.yaml @@ -225,13 +225,25 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/gateway.yaml index e087125036..008274c78c 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-disabled-one-service/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: ewu4VkaeYQe8ylOOrA0ld396O3Y2ZkfotGuVE9HDwHw= + stack.formance.cloud/volumes-hash: O2wSHZvTjKpciRKExI9BiFy8Tg6kfU6YhrPgP4QTwTs= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/gateway-config.yaml index 22eb8be6ca..1f9b1196bc 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/gateway.yaml index 4d32ffd1fa..ad54111c12 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-no-monitoring/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/configmaps--v1/gateway-config.yaml index cc522a572f..336d755036 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/configmaps--v1/gateway-config.yaml @@ -238,14 +238,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/deployments-apps-v1/gateway.yaml index db31c81f2c..446656cf0e 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-check-scopes/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: RDMxfRXs1D0-3FGmRo5HN2f4uMIpozhhWfcRt_Z_OMU= + stack.formance.cloud/volumes-hash: 33PmJbU6BHSkDI-2cUBn7LL1WYvhbD0vE7qoYpAhbpM= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/gateway-config.yaml index 0eae9c17e3..2a8948ce28 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/gateway.yaml index 81446cabe7..1f6fb338e0 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-custom-registry/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/configmaps--v1/gateway-config.yaml index d0895784a4..0f57284355 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/deployments-apps-v1/gateway.yaml index 245fc338c0..d45048e22e 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-gateway-fallback/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: -NLmqqMuQI9KmxWlfQuUANRZLUDraOPb5tr2ilDifHI= + stack.formance.cloud/volumes-hash: HZh9oYnDYekFNdumZtKE1-Hpu_qxVFFIdjnjh2AkjgI= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/gateway-config.yaml index 0227bc6d95..29de80fc6b 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/gateway.yaml index 7e8876ce68..50252d738c 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest-with-secrets/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/gateway-config.yaml index 19725a72f8..5a3df50f7e 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/gateway.yaml index 8de021f369..b71000bcbd 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-latest/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/configmaps--v1/gateway-config.yaml index bf7b64a4a5..dbe0abb63d 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/deployments-apps-v1/gateway.yaml index 1ce734ddbd..1dfb57995f 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-orchestration-v0.2.0/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/gateway-config.yaml index 484e620d13..1f8922ddd2 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/gateway.yaml index ed5d9ab4e2..b9ac88bf4c 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-service-annotation/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/configmaps--v1/gateway-config.yaml index ff80b7cd51..9539f5e632 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/configmaps--v1/gateway-config.yaml @@ -251,14 +251,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/deployments-apps-v1/gateway.yaml index 62359c0442..8d2df29fc5 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log-unvalid-tag/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: B3X5ATO2r4Ogb6QrEUPHh3iKzg-_izo94xrQnA55kwM= + stack.formance.cloud/volumes-hash: 1Xa2rNk4Wz6mgUGg0qZ6X30UWW89fMs-Ur7vDHiBxtU= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/configmaps--v1/gateway-config.yaml index 3e694ca0ab..1325c07d40 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/configmaps--v1/gateway-config.yaml @@ -251,14 +251,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/deployments-apps-v1/gateway.yaml index c324f67213..d53f7df744 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-audit-log/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: B3X5ATO2r4Ogb6QrEUPHh3iKzg-_izo94xrQnA55kwM= + stack.formance.cloud/volumes-hash: 1Xa2rNk4Wz6mgUGg0qZ6X30UWW89fMs-Ur7vDHiBxtU= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/configuration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/configuration.yaml new file mode 100644 index 0000000000..baadf182b5 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/configuration.yaml @@ -0,0 +1,69 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Configuration +metadata: + name: default +spec: + broker: + kafka: + brokers: + - kafka:1234 + services: + auth: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + control: {} + ledger: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + orchestration: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + payments: + encryptionKey: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + search: + batching: + count: + period: + elasticSearch: + host: elasticsearch + pathPrefix: '' + port: 9200 + scheme: http + stargate: + wallets: + gateway: + enableAuditPlugin: true + annotations: + service: + traefik.ingress.kubernetes.io/router.entrypoints: web + webhooks: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + temporal: + address: + namespace: + tls: + crt: + key: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml new file mode 100644 index 0000000000..35b7dffe3c --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +data: + config.yaml: | + clients: + - public: false + description: null + redirectUris: + - http://example.net/auth/login + PostLogoutRedirectUris: + - http://example.net/auth/destroy + scopes: + - openid + - profile + - email + - offline + id: control + secrets: + - mocked-secret + - public: false + description: null + redirectUris: [] + PostLogoutRedirectUris: [] + scopes: + - openid + - ledger:read + - ledger:write + - wallets:read + - wallets:write + - payments:read + - payments:write + id: orchestration + secrets: + - mocked-secret + - public: false + description: null + redirectUris: [] + PostLogoutRedirectUris: [] + scopes: + - openid + - ledger:read + - ledger:write + id: wallets + secrets: + - mocked-secret +kind: ConfigMap +metadata: + labels: + stack: "true" + name: auth-config + namespace: multipod-with-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml new file mode 100644 index 0000000000..c879c18f69 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml @@ -0,0 +1,282 @@ +apiVersion: v1 +data: + Caddyfile: |- + (cors) { + header { + Access-Control-Allow-Methods "GET,OPTIONS,PUT,POST,DELETE,HEAD,PATCH" + Access-Control-Allow-Headers content-type + Access-Control-Max-Age 100 + Access-Control-Allow-Origin * + } + } + + (auth) { + auth { + issuer http://example.net/api/auth + + read_key_set_max_retries 10 + } + } + + { + + # Many directives manipulate the HTTP handler chain and the order in which + # those directives are evaluated matters. So the jwtauth directive must be + # ordered. + # c.f. https://caddyserver.com/docs/caddyfile/directives#directive-order + order auth before basicauth + order versions after metrics + } + + :8000 { + tracing { + span gateway + } + log { + output stdout + } + + @authmatcher { + path /api/auth* + } + handle @authmatcher { + uri strip_prefix /api/auth + reverse_proxy auth:8080 + + import cors + } + + @ledgermatcher { + path /api/ledger* + } + handle @ledgermatcher { + uri strip_prefix /api/ledger + reverse_proxy ledger:8080 + + import cors + import auth ledger + } + + @orchestrationmatcher { + path /api/orchestration* + } + handle @orchestrationmatcher { + uri strip_prefix /api/orchestration + reverse_proxy orchestration:8080 + + import cors + import auth orchestration + } + @paymentsmatcher { + path /api/payments/payments* + method POST GET PATCH + } + handle @paymentsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @poolsmatcher { + path /api/payments/pools* + method POST GET DELETE + } + handle @poolsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @accountsmatcher { + path /api/payments/accounts* + method GET + } + handle @accountsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @bank-accounts-readmatcher { + path /api/payments/bank-accounts* + method GET + } + handle @bank-accounts-readmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @transfer-initiations-readmatcher { + path /api/payments/transfer-initiations* + method GET + } + handle @transfer-initiations-readmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + + @payments-apimatcher { + path /api/payments* + } + handle @payments-apimatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + + import cors + import auth payments + } + @connectorsmatcher { + path /api/payments/connectors* + } + handle @connectorsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @paymentWebhooksmatcher { + path /api/payments/connectors/webhooks* + method POST + } + handle @paymentWebhooksmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + } + @configsmatcher { + path /api/payments/configs* + } + handle @configsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @transfer-initiations-writematcher { + path /api/payments/transfer-initiations* + method POST DELETE + } + handle @transfer-initiations-writematcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @bank-accounts-writematcher { + path /api/payments/bank-accounts* + method POST + } + handle @bank-accounts-writematcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + + @payments-connectorsmatcher { + path /api/payments* + } + handle @payments-connectorsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + + import cors + import auth payments + } + + @searchmatcher { + path /api/search* + } + handle @searchmatcher { + uri strip_prefix /api/search + reverse_proxy search:8080 + + import cors + import auth search + } + + @search-benthosmatcher { + path /api/search-benthos* + } + handle @search-benthosmatcher { + uri strip_prefix /api/search-benthos + reverse_proxy search-benthos:4195 + + import cors + import auth search + } + + @walletsmatcher { + path /api/wallets* + } + handle @walletsmatcher { + uri strip_prefix /api/wallets + reverse_proxy wallets:8080 + + import cors + import auth wallets + } + + @webhooksmatcher { + path /api/webhooks* + } + handle @webhooksmatcher { + uri strip_prefix /api/webhooks + reverse_proxy webhooks:8080 + + import cors + import auth webhooks + } + + handle /versions { + versions { + region "us-west-1" + env "staging" + endpoints { + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } + } + } + } + + # Respond 502 if service does not exists + handle /api/* { + respond "Bad Gateway" 502 + } + + # handle all other requests + handle { + reverse_proxy control:3000 + import cors + } + + } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: gateway-config + namespace: multipod-with-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml new file mode 100644 index 0000000000..8200ceebdc --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +data: + output_elasticsearch.yaml: |- + output_resources: + - label: elasticsearch + processors: + - mapping: | + root = match { + this.action == "update" => if this.exists("upsert") { this.merge({ + "upsert": { + "stack": env("STACK") + } + }) } else { this }, + _ => this.merge({ + "document": { + "stack": env("STACK") + } + }) + } + root.id = "%s-%s".format(env("STACK"), this.id) + - log: + message: "Will write: ${! this }" + elasticsearch: + urls: + - ${OPENSEARCH_URL} + id: ${! json().id } + sniff: false + healthcheck: false + index: ${OPENSEARCH_INDEX} + action: ${! json().action } + tls: + enabled: true + skip_cert_verify: true + basic_auth: + enabled: ${BASIC_AUTH_ENABLED} + username: ${BASIC_AUTH_USERNAME} + password: ${BASIC_AUTH_PASSWORD} + batching: + count: ${OPENSEARCH_BATCHING_COUNT:10} + period: ${OPENSEARCH_BATCHING_PERIOD:1s} + multipart: true + doc: ${! if json().exists("document") { json("document") } else {""} } + script: ${! if json().exists("script") { json("script") } else {""} } + upsert: ${! if json().exists("upsert") { json("upsert") } else {""} } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-resources + namespace: multipod-with-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml new file mode 100644 index 0000000000..c7305a8af8 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml @@ -0,0 +1,302 @@ +apiVersion: v1 +data: + ledger_ingestion_v1.yaml: "input:\n event_bus:\n topic: ledger\n consumer_group: search\n\npipeline:\n processors:\n - switch_event_type:\n events:\n - label: COMMITTED_TRANSACTIONS\n version: v1\n processors:\n - bloblang: |\n map account {\n root = this.map_each(v -> v.value.map_each(v2 -> {\n \"action\": \"upsert\",\n \"id\": v.key,\n \"document\": {\n \"data\": {\n \"address\": v.key\n },\n \"indexed\": {\n \"address\": v.key\n },\n \"kind\": \"ACCOUNT\"\n }\n }).values()).values().flatten()\n }\n\n map tx {\n root = {\n \"action\": \"index\",\n \"id\": \"%s\".format(this.txid),\n \"document\": {\n \"data\": {\n \"postings\": this.postings,\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"metadata\": if this.metadata { this.metadata } else {{}}\n },\n \"indexed\": {\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"asset\": this.postings.map_each(p -> p.asset),\n \"source\": this.postings.map_each(p -> p.source),\n \"destination\": this.postings.map_each(p -> p.destination),\n \"amount\": this.postings.map_each(p -> if p.asset.contains(\"/\") {\n [\n p.amount,\n p.amount / if p.asset.split(\"/\").index(1).number(){ range(0, p.asset.split(\"/\").index(1).number()).fold(1, t -> t.tally * 10) } else { 1 } # amount / pow(10, decimal part of asset)\n ]\n } else { [ p.amount ] }).flatten().map_each(v -> \"%v\".format(v))\n },\n \"kind\": \"TRANSACTION\"\n }\n }\n }\n\n map committedTransactions {\n root = [\n this.payload.transactions.map_each(t -> t.apply(\"tx\")).map_each(t -> t.assign({\n \"id\": \"TRANSACTION-%s-%s\".format(this.payload.ledger, t.id)\n })),\n this.payload.transactions.map_each(t -> t.postings.map_each(p -> [{\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, p.source),\n \"document\": {\n \"data\": {\n \"address\": p.source,\n \"metadata\": {}\n },\n \"indexed\": {\n \"address\": p.source\n },\n \"kind\": \"ACCOUNT\"\n }\n }, {\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, p.destination),\n \"document\": {\n \"data\": {\n \"address\": p.destination,\n \"metadata\": {}\n },\n \"indexed\": {\n \"address\": p.destination\n },\n \"kind\": \"ACCOUNT\"\n }\n }])).flatten().flatten()\n ].flatten().map_each(t -> t.merge({\n \"document\": {\n \"when\": this.date,\n \"ledger\": this.payload.ledger,\n \"data\": {\n \"ledger\": this.payload.ledger\n },\n \"indexed\": {\n \"ledger\": this.payload.ledger\n }\n },\n }))\n }\n\n root = this.apply(\"committedTransactions\")\n - unarchive:\n format: json_array\n - label: SAVED_METADATA\n version: v1\n processors:\n - bloblang: |\n root = this.payload.metadata.map_each(item -> {\n \"script\": \"if (ctx._source.data.metadata == null) { ctx._source.data.metadata = ['\" + item.key + \"': '\" + item.value.string() + \"'] } ctx._source.data.metadata['\" + item.key + \"']='\" + item.value.string() + \"'\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId),\n \"upsert\": {\n \"data\": {\n \"address\": this.payload.targetId,\n \"metadata\": { item.key: \"\\\"\" + item.value.string() + \"\\\"\" },\n \"ledger\": this.payload.ledger\n },\n \"indexed\": { \n \"address\": this.payload.targetId,\n \"ledger\": this.payload.ledger\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()\n - unarchive:\n format: json_array\n\noutput:\n resource: elasticsearch\n" + ledger_ingestion_v2.yaml: "input:\n event_bus:\n topic: ledger\n consumer_group: search-ledgerv2\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: COMMITTED_TRANSACTIONS\n version: v2\n processors:\n - bloblang: |\n map amount {\n root = [this.amount]\n let hasDecimals = this.asset.split(\"/\").length() > 1\n let decimals = if $hasDecimals { this.asset.split(\"/\").index(1).number() } else { 0 }\n root = if $decimals > 0 {\n root.append(\n this.amount / range(0, $decimals).fold(1, t -> t.tally * 10) # Just a pow...\n )\n }\n root = root.flatten()\n }\n \n map tx {\n root = {\n \"action\": \"index\",\n \"id\": \"TRANSACTION-%s-%s\".format(this.ledger, this.transaction.id),\n \"document\": {\n \"data\": {\n \"postings\": this.transaction.postings,\n \"reference\": this.transaction.reference,\n \"txid\": this.transaction.id,\n \"timestamp\": this.transaction.timestamp,\n \"metadata\": if this.transaction.metadata { this.transaction.metadata } else {{}}\n },\n \"indexed\": {\n \"reference\": this.transaction.reference,\n \"txid\": this.transaction.id,\n \"timestamp\": this.transaction.timestamp,\n \"asset\": this.transaction.postings.map_each(p -> p.asset),\n \"source\": this.transaction.postings.map_each(p -> p.source),\n \"destination\": this.transaction.postings.map_each(p -> p.destination),\n \"amount\": this.transaction.postings.map_each(p -> p.apply(\"amount\"))\n },\n \"kind\": \"TRANSACTION\",\n \"when\": this.date\n }\n }\n }\n \n map account {\n root = {\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.ledger, this.account),\n \"document\": {\n \"data\": { \n \"address\": this.account,\n \"metadata\": {}\n },\n \"indexed\": { \n \"address\": this.account\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }\n }\n \n root = []\n root = root.append(\n this.payload.transactions.map_each(transaction -> {\n \"transaction\": transaction,\n \"ledger\": this.payload.ledger\n }.apply(\"tx\"))\n )\n root = root.append(\n this.payload.transactions.\n map_each(transaction -> transaction.postings.map_each(posting -> [\n posting.source,\n posting.destination\n ]).\n flatten().\n map_each(account -> {\n \"account\": account,\n \"ledger\": this.payload.ledger\n }.apply(\"account\"))\n ).\n flatten()\n )\n root = root.append(\n this.payload.accountMetadata.map_each(item -> item.value.map_each(metadata -> {\n \"script\": \"ctx._source.data.metadata[\\\"\" + metadata.key + \"\\\"]=\\\"\" + metadata.value + \"\\\"\",\n \"action\": \"update\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, item.key),\n \"upsert\": {\n \"data\": { \n \"address\": item.key,\n \"metadata\": { metadata.key: metadata.value }\n },\n \"indexed\": { \n \"address\": item.key\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()).values().flatten()\n )\n root = root.flatten()\n \n let overlay = {\n \"data\": {\n \"ledger\": this.payload.ledger\n },\n \"indexed\": {\n \"ledger\": this.payload.ledger \n }\n }\n \n root = root.map_each(cmd -> match cmd.action {\n cmd.action == \"update\" => if cmd.exists(\"upsert\") { cmd.merge({\n \"upsert\": $overlay\n }) } else { cmd },\n _ => cmd.merge({\n \"document\": $overlay\n }) \n })\n - log:\n message: \"Computed: ${! this }\"\n - unarchive:\n format: json_array\n - label: SAVED_METADATA\n version: v2\n processors:\n - bloblang: |\n root = this.payload.metadata.map_each(item -> {\n \"script\": \"if (ctx._source.data.metadata == null) { ctx._source.data.metadata = ['\" + item.key + \"': '\" + item.value + \"'] } ctx._source.data.metadata['\" + item.key + \"']='\" + item.value + \"'\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId),\n \"upsert\": {\n \"data\": { \n \"address\": this.payload.targetId,\n \"metadata\": { item.key: item.value },\n \"ledger\": this.payload.ledger\n },\n \"indexed\": { \n \"address\": this.payload.targetId,\n \"ledger\": this.payload.ledger\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()\n - unarchive:\n format: json_array\n - label: DELETED_METADATA\n version: v2\n processors:\n - bloblang: |\n root = {\n \"script\": \"ctx._source.data.metadata.remove(\\\"\" + this.payload.key + \"\\\")\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId)\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_accounts_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as accounts_count from \"${! meta(\"ledger\") }\".accounts'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.accounts_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select address, metadata\n from \"${! meta(\"ledger\") }\".accounts\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"document\": {\n \"data\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\"),\n \"metadata\": this.metadata\n },\n \"indexed\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ACCOUNT\",\n \"ledger\": meta(\"ledger\")\n },\n \"id\": \"ACCOUNT-%s-%s\".format(meta(\"ledger\"), this.address),\n \"action\": \"upsert\"\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_accounts_v2.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n - postgres_query:\n service: ledger\n query: |\n select address, metadata\n from \"${! meta(\"ledger\") }\".accounts\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"document\": {\n \"data\": { \n \"address\": this.address,\n \"ledger\": meta(\"ledger\"),\n \"metadata\": this.metadata\n },\n \"indexed\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ACCOUNT\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n },\n \"id\": \"ACCOUNT-%s-%s\".format(meta(\"ledger\"), this.address),\n \"action\": \"upsert\"\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_all_v1.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - postgres_query: + service: ledger + query: 'select * from "_system".ledgers' + - unarchive: + format: json_array + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_v1 + ledger_reindex_all_v2.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - postgres_query: + service: ledger + query: 'select * from "_system".ledgers' + - unarchive: + format: json_array + - log: + message: "Process ledger: ${! this.ledger }" + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_v2 + ledger_reindex_transactions_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as transactions_count from \"${! meta(\"ledger\") }\".transactions'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.transactions_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select id, timestamp, reference, metadata, postings\n from \"${! meta(\"ledger\") }\".transactions\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"postings\": this.postings.parse_json(),\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"id\": \"TRANSACTION-%s-%s\".format(meta(\"ledger\"), this.id),\n \"action\": \"upsert\",\n \"document\": {\n \"data\": {\n \"postings\": this.postings,\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"metadata\": if this.metadata { this.metadata } else {{}},\n \"ledger\": meta(\"ledger\")\n },\n \"indexed\": {\n \"reference\": this.reference,\n \"txid\": this.id,\n \"timestamp\": this.timestamp,\n \"asset\": this.postings.map_each(p -> p.asset),\n \"source\": this.postings.map_each(p -> p.source),\n \"destination\": this.postings.map_each(p -> p.destination),\n \"amount\": this.postings.map_each(p -> if p.asset.contains(\"/\") {\n [\n p.amount,\n p.amount / range(0, p.asset.split(\"/\").index(1).number()).fold(1, t -> t.tally * 10) # amount / pow(10, decimal part of asset)\n ]\n } else { [ p.amount ] }).flatten().map_each(v -> \"%v\".format(v)),\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"TRANSACTION\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n }\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_transactions_v2.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - bloblang: | + meta ledger = this.ledger + - postgres_query: + service: ledger + query: | + select id::varchar as id, timestamp, reference, metadata, postings + from "${! meta("ledger") }".transactions; + - unarchive: + format: json_array + - bloblang: | + root = this.assign({ + "postings": this.postings.parse_json(), + "metadata": this.metadata.parse_json() + }) + - bloblang: | + root = { + "id": "TRANSACTION-%s-%s".format(meta("ledger"), this.id), + "action": "upsert", + "document": { + "data": { + "postings": this.postings, + "reference": this.reference, + "txid": this.id, + "timestamp": this.timestamp, + "metadata": if this.metadata { this.metadata } else {{}}, + "ledger": meta("ledger") + }, + "indexed": { + "reference": this.reference, + "txid": this.id, + "timestamp": this.timestamp, + "asset": this.postings.map_each(p -> p.asset), + "source": this.postings.map_each(p -> p.source), + "destination": this.postings.map_each(p -> p.destination), + "amount": this.postings.map_each(p -> if p.asset.contains("/") { + [ + p.amount, + p.amount / range(0, p.asset.split("/").index(1).number()).fold(1, t -> t.tally * 10) # amount / pow(10, decimal part of asset) + ] + } else { [ p.amount ] }).flatten().map_each(v -> "%v".format(v)), + "ledger": meta("ledger") + }, + "kind": "TRANSACTION", + "ledger": meta("ledger"), + "when": this.date + } + } + + output: + resource: elasticsearch + ledger_reindex_v1.yaml: | + input: + http_server: + path: / + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_volumes_v1 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_transactions_v1 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_accounts_v1 + ledger_reindex_v2.yaml: | + input: + http_server: + path: / + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_transactions_v2 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_accounts_v2 + ledger_reindex_volumes_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as volumes_count from \"${! meta(\"ledger\") }\".volumes'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.volumes_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select account, asset, input, output\n from \"${! meta(\"ledger\") }\".volumes\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = {\n \"id\": \"ASSET-%s-%s-%s\".format(meta(\"ledger\"), this.account, this.asset),\n \"action\": \"upsert\",\n \"document\": {\n \"data\": {\n \"name\": this.asset,\n \"input\": this.input,\n \"output\": this.output,\n \"account\": this.account,\n \"ledger\": meta(\"ledger\")\n },\n \"indexed\": {\n \"account\": this.account,\n \"name\": this.asset,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ASSET\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n }\n }\n\noutput:\n resource: elasticsearch\n" + payments_deletion.yaml: "input:\n event_bus:\n topic: payments\n consumer_group: search-payments-resets\n\npipeline:\n processors:\n - switch_event_type:\n events:\n - label: CONNECTOR_RESET\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"bool\": {\n \"should\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_POOL\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_ACCOUNT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_BALANCE\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_BANK_ACCOUNT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_TRANSFER_INITIATION\"\n }\n }\n ]\n }\n },\n {\n \"match\": {\n \"indexed.connectorId\": this.payload.connectorId\n }\n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\n - label: DELETED_POOL\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT_POOL\"\n }\n },\n {\n \"match\": {\n \"indexed.id\": this.payload.id\n } \n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\n - label: DELETED_TRANSFER_INITIATION\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT_TRANSFER_INITIATION\"\n }\n },\n {\n \"should\": [\n {\n \"match\": {\n \"indexed.id\": this.payload.id\n }\n },\n {\n \"match\": {\n \"indexed.provider\": this.payload.provider\n }\n }\n ]\n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\noutput:\n http_client:\n url: ${OPENSEARCH_URL}/${OPENSEARCH_INDEX}/_delete_by_query\n verb: POST\n headers:\n Content-Type: application/json\n basic_auth:\n enabled: ${BASIC_AUTH_ENABLED}\n username: ${BASIC_AUTH_USERNAME}\n password: ${BASIC_AUTH_PASSWORD}\n" + payments_ingestion.yaml: | + input: + event_bus: + topic: payments + consumer_group: search + + pipeline: + processors: + - switch_event_type: + events: + - label: SAVED_PAYMENT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload.without("rawData"), + "indexed": { + "id": this.payload.id, + "reference": this.payload.reference, + "provider": this.payload.provider, + "createdAt": this.payload.createdAt, + "connectorId": this.payload.connectorId, + "type": this.payload.type, + "status": this.payload.status, + "scheme": this.payload.scheme, + "asset": this.payload.asset, + "initialAmount": this.payload.initialAmount, + "amount": this.payload.amount + }, + "kind": "PAYMENT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-%s".format(this.payload.id) + } + - label: SAVED_ACCOUNT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "provider": this.payload.provider, + "createdAt": this.payload.createdAt, + "reference": this.payload.reference, + "connectorId": this.payload.connectorId, + "defaultAsset": this.payload.defaultAsset, + "accountName": this.payload.accountName, + "type": this.payload.type + }, + "kind": "PAYMENT_ACCOUNT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-ACCOUNT-%s".format(this.payload.id) + } + - label: SAVED_BALANCE + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "accountId": this.payload.accountID, + "provider": this.payload.provider, + "connectorId": this.payload.connectorId, + "createdAt": this.payload.createdAt, + "asset": this.payload.asset, + "balance": this.payload.balance + }, + "kind": "PAYMENT_BALANCE", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-BALANCE-%s-%s".format(this.payload.accountID, this.payload.asset) + } + - label: SAVED_BANK_ACCOUNT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "connectorId": this.payload.connectorId, + "provider": this.payload.provider, + "name": this.payload.name, + "accountNumber": this.payload.accountNumber, + "iban": this.payload.iban, + "swiftBicCode": this.payload.swiftBicCode, + "country": this.payload.country, + "provider": this.payload.provider, + "accountId": this.payload.accountID + }, + "kind": "PAYMENT_BANK_ACCOUNT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-BANK-ACCOUNT-%s".format(this.payload.id) + } + - label: SAVED_POOL + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "name": this.payload.name, + "accountIDs": this.payload.accountIDs, + }, + "kind": "PAYMENT_POOL", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-POOL-%s".format(this.payload.id) + } + - label: SAVED_TRANSFER_INITIATION + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "scheduledAt": this.payload.scheduledAt, + "updatedAt": this.payload.updatedAt, + "connectorId": this.payload.connectorId, + "description": this.payload.description, + "type": this.payload.type, + "provider": this.payload.provider, + "sourceAccountId": this.payload.sourceAccountID, + "destinationAccountId": this.payload.destinationAccountID, + "amount": this.payload.amount, + "asset": this.payload.asset, + "attempts": this.payload.attempts, + "status": this.payload.status, + "error": this.payload.error, + "relatedPayment": this.payload.relatedPayment + }, + "kind": "PAYMENT_TRANSFER_INITIATION", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-TRANSFER-INITIATION-%s".format(this.payload.id) + } + + output: + resource: elasticsearch +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-streams + namespace: multipod-with-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml new file mode 100644 index 0000000000..81ed2b9880 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml @@ -0,0 +1,90 @@ +apiVersion: v1 +data: + event_bus.yaml: | + name: event_bus + type: input + + fields: + - name: topic + type: string + - name: consumer_group + type: string + + mapping: | + root = if env("BROKER") == "kafka" {{ + "kafka": { + "addresses": [ env("KAFKA_ADDRESS") ], + "topics": [ env("TOPIC_PREFIX") + this.topic ], + "target_version": env("KAFKA_VERSION"), + "consumer_group": this.consumer_group, + "checkpoint_limit": 1024, + "sasl": { + "mechanism": env("KAFKA_SASL_MECHANISM"), + "password": env("KAFKA_SASL_PASSWORD"), + "user": env("KAFKA_SASL_USERNAME") + }, + "tls": { + "enabled": env("KAFKA_TLS_ENABLED") == "true" + }, + "extract_tracing_map": "root = meta()" + } + }} else {{ + "nats_jetstream": { + "urls": [env("NATS_URL")], + "queue": this.consumer_group, + "subject": env("TOPIC_PREFIX") + this.topic, + "durable": this.consumer_group + } + }} + postgres_query.yaml: | + name: postgres_query + type: processor + + fields: + - name: query + type: string + - name: service + type: string + + mapping: | + root = { + "sql_raw": { + "dsn": env("%s_POSTGRES_URI".format(this.service.uppercase())), + "driver": "postgres", + "query": this.query, + "unsafe_dynamic_query": true + } + } + switch_event_type.yaml: | + name: switch_event_type + type: processor + + fields: + - kind: list + type: unknown + name: events + + mapping: | + root = { + "switch": this.events.map_each(eventDefinition -> { + "check": "this.type == \"%s\" && this.version == \"%s\"".format(eventDefinition.label, eventDefinition.version), + "processors": eventDefinition.processors + }).append({ + "processors": [ + { + "log": { + "message": "unable to handle message ${! content() }" + } + }, + { + "bloblang": "root = deleted()" + } + ] + }) + } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-templates + namespace: multipod-with-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml new file mode 100644 index 0000000000..e7f7b586bf --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml @@ -0,0 +1,39 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + generation: 1 + labels: + stack: "true" + name: reindex-ledger + namespace: multipod-with-new-versions-per-module-gateway +spec: + concurrencyPolicy: Allow + failedJobsHistoryLimit: 1 + jobTemplate: + metadata: + creationTimestamp: null + spec: + template: + metadata: + creationTimestamp: null + spec: + containers: + - command: + - sh + - -c + - "/bin/sh <<'EOF'\n\n\t\t\n\t\t\t\t\tcurl http://search-benthos.multipod-with-new-versions-per-module-gateway.svc.cluster.local:4195/ledger_reindex_all -X POST -H 'Content-Type: application/json' -d '{}'\n \t\t\t\t\t\t \nEOF" + image: curlimages/curl:8.2.1 + imagePullPolicy: IfNotPresent + name: reindex-ledger + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Never + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + schedule: '* * * * *' + successfulJobsHistoryLimit: 3 + suspend: true +status: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml new file mode 100644 index 0000000000..3168c1ed36 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml @@ -0,0 +1,115 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: auth + formance.com/monopod: "false" + stack: "true" + name: auth + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: auth + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: oQpoLrzV7V5HyafDUh_DPOoleiB93uWbpo-iGuO9NSw= + creationTimestamp: null + labels: + app.kubernetes.io/name: auth + spec: + containers: + - args: + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-auth + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: auth + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: CONFIG + value: /config/config/config.yaml + - name: DELEGATED_CLIENT_SECRET + - name: DELEGATED_CLIENT_ID + - name: DELEGATED_ISSUER + - name: BASE_URL + value: http://example.net/api/auth + - name: SIGNING_KEY + valueFrom: + secretKeyRef: + key: signingKey + name: auth-secret + image: ghcr.io/formancehq/auth:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: auth + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/config + name: config + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: auth-config + name: config +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml new file mode 100644 index 0000000000..8ea4910c30 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml @@ -0,0 +1,80 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: control + formance.com/monopod: "false" + stack: "true" + name: control + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: control + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: control + spec: + containers: + - env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: control + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: API_URL + value: http://example.net + - name: ENCRYPTION_KEY + value: 9h44y2ZqrDuUy5R9NGLA9hca7uRUr932 + - name: ENCRYPTION_IV + value: b6747T6eP9DnMvEw + - name: CLIENT_ID + value: control + - name: CLIENT_SECRET + value: mocked-secret + - name: REDIRECT_URI + value: http://example.net + - name: UNSECURE_COOKIES + value: "false" + image: ghcr.io/formancehq/control:latest + imagePullPolicy: Always + name: control + ports: + - containerPort: 3000 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 512Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml new file mode 100644 index 0000000000..b1cb6b130a --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: gateway + formance.com/monopod: "false" + stack: "true" + name: gateway + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: gateway + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= + creationTimestamp: null + labels: + app.kubernetes.io/name: gateway + spec: + containers: + - args: + - run + - --config + - /config/config/Caddyfile + - --adapter + - caddyfile + command: + - /usr/bin/caddy + env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: gateway + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + image: ghcr.io/formancehq/gateway:v0.1.8 + imagePullPolicy: IfNotPresent + name: gateway + ports: + - containerPort: 8000 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/config + name: config + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: gateway-config + name: config +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml new file mode 100644 index 0000000000..c19e2dfb33 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml @@ -0,0 +1,104 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: ledger + formance.com/monopod: "false" + stack: "true" + name: ledger + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: ledger + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: ledger + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: ledger + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: STORAGE_DRIVER + value: postgres + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-with-new-versions-per-module-gateway-ledger' + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/ledger:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: ledger + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml new file mode 100644 index 0000000000..6b94e6cbbf --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml @@ -0,0 +1,98 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: orchestration + formance.com/monopod: "false" + stack: "true" + name: orchestration-worker + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: orchestration-worker + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: orchestration-worker + spec: + containers: + - args: + - worker + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: orchestration-worker + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: POSTGRES_DSN + value: $(POSTGRES_URI) + - name: TEMPORAL_TASK_QUEUE + value: multipod-with-new-versions-per-module-gateway + - name: TEMPORAL_ADDRESS + - name: TEMPORAL_NAMESPACE + - name: STACK_CLIENT_ID + value: orchestration + - name: STACK_CLIENT_SECRET + value: mocked-secret + - name: TEMPORAL_SSL_CLIENT_KEY + - name: TEMPORAL_SSL_CLIENT_CERT + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: TOPICS + value: multipod-with-new-versions-per-module-gateway-ledger multipod-with-new-versions-per-module-gateway-payments + image: ghcr.io/formancehq/orchestration:latest + imagePullPolicy: Always + name: orchestration-worker + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml new file mode 100644 index 0000000000..ff64d0f205 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: orchestration + formance.com/monopod: "false" + stack: "true" + name: orchestration + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: orchestration + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: orchestration + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: orchestration + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: POSTGRES_DSN + value: $(POSTGRES_URI) + - name: TEMPORAL_TASK_QUEUE + value: multipod-with-new-versions-per-module-gateway + - name: TEMPORAL_ADDRESS + - name: TEMPORAL_NAMESPACE + - name: STACK_CLIENT_ID + value: orchestration + - name: STACK_CLIENT_SECRET + value: mocked-secret + - name: TEMPORAL_SSL_CLIENT_KEY + - name: TEMPORAL_SSL_CLIENT_CERT + image: ghcr.io/formancehq/orchestration:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: orchestration + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml new file mode 100644 index 0000000000..b9ed41d38e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: payments + formance.com/monopod: "false" + stack: "true" + name: payments-api + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: payments-api + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: payments-api + spec: + containers: + - args: + - api + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: payments-api + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: POSTGRES_DATABASE_NAME + value: $(POSTGRES_DATABASE) + - name: CONFIG_ENCRYPTION_KEY + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-with-new-versions-per-module-gateway-payments' + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_health + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: payments-api + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml new file mode 100644 index 0000000000..c7776c90f1 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: payments + formance.com/monopod: "false" + stack: "true" + name: payments-connectors + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: payments-connectors + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: payments-connectors + spec: + containers: + - args: + - connectors + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: payments-connectors + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: POSTGRES_DATABASE_NAME + value: $(POSTGRES_DATABASE) + - name: CONFIG_ENCRYPTION_KEY + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-with-new-versions-per-module-gateway-payments' + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_health + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: payments-connectors + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml new file mode 100644 index 0000000000..662dd1bf4a --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml @@ -0,0 +1,129 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: search + formance.com/monopod: "false" + stack: "true" + name: search-benthos + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: search-benthos + strategy: + type: Recreate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: iXL4EcTjD7D2Zkq9Qb1D6Bctp8pGhkzkiwtjjBeKSnU= + creationTimestamp: null + labels: + app.kubernetes.io/name: search-benthos + spec: + containers: + - command: + - /benthos + - -r + - /config/resources/*.yaml + - -t + - /config/templates/*.yaml + - --log.level + - trace + - streams + - /config/streams/*.yaml + env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: search-benthos + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: OPENSEARCH_URL + value: http://elasticsearch:9200 + - name: OPENSEARCH_BATCHING_COUNT + value: "0" + - name: OPENSEARCH_BATCHING_PERIOD + - name: TOPIC_PREFIX + value: multipod-with-new-versions-per-module-gateway- + - name: OPENSEARCH_INDEX + value: stacks + - name: KAFKA_ADDRESS + value: kafka:1234 + - name: BASIC_AUTH_ENABLED + value: "false" + - name: BASIC_AUTH_USERNAME + value: username + - name: BASIC_AUTH_PASSWORD + value: password + - name: LEDGER_POSTGRES_HOST + value: localhost + - name: LEDGER_POSTGRES_PORT + value: "5432" + - name: LEDGER_POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-ledger + - name: LEDGER_POSTGRES_USERNAME + value: root + - name: LEDGER_POSTGRES_PASSWORD + value: root + - name: LEDGER_POSTGRES_NO_DATABASE_URI + value: postgresql://$(LEDGER_POSTGRES_USERNAME):$(LEDGER_POSTGRES_PASSWORD)@$(LEDGER_POSTGRES_HOST):$(LEDGER_POSTGRES_PORT) + - name: LEDGER_POSTGRES_URI + value: $(LEDGER_POSTGRES_NO_DATABASE_URI)/$(LEDGER_POSTGRES_DATABASE)?sslmode=disable + - name: BROKER + value: kafka + image: public.ecr.aws/formance-internal/jeffail/benthos:v4.23.0-es + imagePullPolicy: IfNotPresent + name: search-benthos + ports: + - containerPort: 4195 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/resources + name: resources + readOnly: true + - mountPath: /config/streams + name: streams + readOnly: true + - mountPath: /config/templates + name: templates + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: search-benthos-resources + name: resources + - configMap: + defaultMode: 420 + name: search-benthos-streams + name: streams + - configMap: + defaultMode: 420 + name: search-benthos-templates + name: templates +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml new file mode 100644 index 0000000000..7dd54e1450 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: search + formance.com/monopod: "false" + stack: "true" + name: search + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: search + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: search + spec: + containers: + - env: + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: search + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: OPENSEARCH_URL + value: http://elasticsearch:9200 + - name: OPENSEARCH_BATCHING_COUNT + value: "0" + - name: OPENSEARCH_BATCHING_PERIOD + - name: TOPIC_PREFIX + value: multipod-with-new-versions-per-module-gateway- + - name: OPENSEARCH_INDEX + value: stacks + - name: KAFKA_ADDRESS + value: kafka:1234 + - name: BASIC_AUTH_ENABLED + value: "false" + - name: BASIC_AUTH_USERNAME + value: username + - name: BASIC_AUTH_PASSWORD + value: password + - name: OPEN_SEARCH_SERVICE + value: elasticsearch:9200 + - name: OPEN_SEARCH_SCHEME + value: http + - name: MAPPING_INIT_DISABLED + value: "true" + - name: ES_INDICES + value: stacks + image: ghcr.io/formancehq/search:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: search + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml new file mode 100644 index 0000000000..e2dc9313e0 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml @@ -0,0 +1,88 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: stargate + formance.com/monopod: "false" + stack: "true" + name: stargate + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: stargate + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: stargate + spec: + containers: + - env: + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: stargate + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: ORGANIZATION_ID + value: multipod + - name: STACK_ID + value: with + - name: STARGATE_SERVER_URL + - name: GATEWAY_URL + value: http://gateway:8000 + - name: STARGATE_AUTH_CLIENT_ID + - name: STARGATE_AUTH_CLIENT_SECRET + - name: STARGATE_AUTH_ISSUER_URL + image: ghcr.io/formancehq/stargate:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: stargate + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml new file mode 100644 index 0000000000..f742e0907f --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml @@ -0,0 +1,84 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: wallets + formance.com/monopod: "false" + stack: "true" + name: wallets + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: wallets + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: wallets + spec: + containers: + - env: + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: wallets + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + - name: STACK_CLIENT_ID + value: wallets + - name: STACK_CLIENT_SECRET + value: mocked-secret + image: ghcr.io/formancehq/wallets:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: wallets + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml new file mode 100644 index 0000000000..8b65726b99 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: webhooks + formance.com/monopod: "false" + stack: "true" + name: webhooks-worker + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: webhooks-worker + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: webhooks-worker + spec: + containers: + - args: + - worker + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :0 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: webhooks-worker + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + - name: KAFKA_TOPICS + value: multipod-with-new-versions-per-module-gateway-ledger multipod-with-new-versions-per-module-gateway-payments + image: ghcr.io/formancehq/webhooks:latest + imagePullPolicy: Always + name: webhooks-worker + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml new file mode 100644 index 0000000000..e2f7157b56 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml @@ -0,0 +1,100 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: webhooks + formance.com/monopod: "false" + stack: "true" + name: webhooks + namespace: multipod-with-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: webhooks + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: webhooks + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: webhooks + - name: STACK + value: multipod-with-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/webhooks:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: webhooks + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml new file mode 100644 index 0000000000..3f90b4ebbc --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + generation: 1 + labels: + stack: "true" + name: gateway + namespace: multipod-with-new-versions-per-module-gateway +spec: + rules: + - host: example.net + http: + paths: + - backend: + service: + name: gateway + port: + name: http + path: / + pathType: Prefix +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml new file mode 100644 index 0000000000..92044ceb35 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: auth-create-database + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: auth-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-auth + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml new file mode 100644 index 0000000000..c561d092dc --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: ledger-create-database + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: ledger-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml new file mode 100644 index 0000000000..377eb15815 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml @@ -0,0 +1,56 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: ledger-latest-db-migration + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: ledger-latest-db-migration + spec: + containers: + - args: + - buckets + - upgrade-all + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/ledger:latest + imagePullPolicy: Always + name: migrate + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml new file mode 100644 index 0000000000..5179e35747 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: orchestration-create-database + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: orchestration-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml new file mode 100644 index 0000000000..451b18dff7 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: payments-create-database + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: payments-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml new file mode 100644 index 0000000000..d31c6fac83 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml @@ -0,0 +1,54 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: payments-latest-db-migration + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: payments-latest-db-migration + spec: + containers: + - args: + - migrate + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: CONFIG_ENCRYPTION_KEY + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + name: migrate + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml new file mode 100644 index 0000000000..071e8ed97d --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: webhooks-create-database + namespace: multipod-with-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: webhooks-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-with-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml new file mode 100644 index 0000000000..be01b6ee28 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.6.5-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.6.5 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml new file mode 100644 index 0000000000..deab43a434 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.7.0-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.7.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml new file mode 100644 index 0000000000..caf1dff0d1 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.8.0-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.8.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml new file mode 100644 index 0000000000..743ee5e1eb --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.8.1-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.8.1 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml new file mode 100644 index 0000000000..71c0a2c699 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v1.0.0-beta.3-pre-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: false + targetedVersion: v1.0.0-beta.3 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml new file mode 100644 index 0000000000..439a7763d6 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.0.0-pre-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.0.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml new file mode 100644 index 0000000000..e9bb2bccb6 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.10.0-pre-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.10.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml new file mode 100644 index 0000000000..ac1b81a2c0 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.7.0-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: true + targetedVersion: v0.7.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml new file mode 100644 index 0000000000..eb726b55c9 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.7.0-pre-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.7.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml new file mode 100644 index 0000000000..de6bed2810 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.4.3-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.4.3 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml new file mode 100644 index 0000000000..007f3f074e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.4.4-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.4.4 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml new file mode 100644 index 0000000000..5740137115 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.5.0-post-upgrade + namespace: multipod-with-new-versions-per-module-gateway +spec: + configuration: multipod-with-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.5.0 + version: multipod-with-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml new file mode 100644 index 0000000000..1f159e3964 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +data: + signingKey: ZmFrZS1yc2Eta2V5 +kind: Secret +metadata: + labels: + stack: "true" + name: auth-secret + namespace: multipod-with-new-versions-per-module-gateway +type: Opaque diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/auth.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/auth.yaml new file mode 100644 index 0000000000..2e3bb9c5a7 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/auth.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: auth + name: auth + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: auth + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/control.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/control.yaml new file mode 100644 index 0000000000..a09eb8ccfc --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/control.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: control + name: control + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app.kubernetes.io/name: control + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/gateway.yaml new file mode 100644 index 0000000000..82f0207fea --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/gateway.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + labels: + app.kubernetes.io/service-name: gateway + name: gateway + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8000 + protocol: TCP + targetPort: 8000 + selector: + app.kubernetes.io/name: gateway + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/ledger.yaml new file mode 100644 index 0000000000..7c4d27a50b --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/ledger.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: ledger + name: ledger + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: ledger + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/orchestration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/orchestration.yaml new file mode 100644 index 0000000000..48af13478e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/orchestration.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: orchestration + name: orchestration + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: orchestration + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-api.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-api.yaml new file mode 100644 index 0000000000..c66748d1b7 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-api.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: payments-api + name: payments-api + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: payments-api + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml new file mode 100644 index 0000000000..a05247dc55 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: payments-connectors + name: payments-connectors + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: payments-connectors + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml new file mode 100644 index 0000000000..001cc247b4 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: search-benthos + name: search-benthos + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 4195 + protocol: TCP + targetPort: 4195 + selector: + app.kubernetes.io/name: search-benthos + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search.yaml new file mode 100644 index 0000000000..c484b94d3c --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/search.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: search + name: search + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: search + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/wallets.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/wallets.yaml new file mode 100644 index 0000000000..60b28343ea --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/wallets.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: wallets + name: wallets + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: wallets + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/webhooks.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/webhooks.yaml new file mode 100644 index 0000000000..474e14b54c --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/results/services--v1/webhooks.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: webhooks + name: webhooks + namespace: multipod-with-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: webhooks + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/stack.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/stack.yaml new file mode 100644 index 0000000000..cc9a37df15 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/stack.yaml @@ -0,0 +1,11 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Stack +metadata: + name: stack1 +spec: + debug: false + dev: false + scheme: http + host: example.net + seed: stacks + versions: default diff --git a/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/versions.yaml b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/versions.yaml new file mode 100644 index 0000000000..21d720376b --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-with-new-versions-per-module-gateway/versions.yaml @@ -0,0 +1,8 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Versions +metadata: + name: default +spec: + gateway: v0.1.8 + ledger: latest + payments: latest \ No newline at end of file diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/configmaps--v1/gateway-config.yaml index 698bbb323c..a0e4fa7cce 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/configmaps--v1/gateway-config.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/configmaps--v1/gateway-config.yaml @@ -236,14 +236,28 @@ data: region "us-west-1" env "staging" endpoints { - auth http://auth:8080/_info http://auth:8080/_healthcheck - ledger http://ledger:8080/_info http://ledger:8080/_healthcheck - orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck - payments-api http://payments-api:8080/_info http://payments-api:8080/_health - payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health - search http://search:8080/_info http://search:8080/_healthcheck - wallets http://wallets:8080/_info http://wallets:8080/_healthcheck - webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + auth { + http://auth:8080/_info http://auth:8080/_healthcheck + } + ledger { + http://ledger:8080/_info http://ledger:8080/_healthcheck + } + orchestration { + http://orchestration:8080/_info http://orchestration:8080/_healthcheck + } + payments { + http://payments-api:8080/_info http://payments-api:8080/_health + http://payments-connectors:8080/_info http://payments-connectors:8080/_health + } + search { + http://search:8080/_info http://search:8080/_healthcheck + } + wallets { + http://wallets:8080/_info http://wallets:8080/_healthcheck + } + webhooks { + http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } } } } diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/deployments-apps-v1/gateway.yaml index 86a16c2296..34da226602 100644 --- a/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/deployments-apps-v1/gateway.yaml +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-audit-log/results/deployments-apps-v1/gateway.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + stack.formance.cloud/volumes-hash: a02vArrsq93-75hyQhELsvTZMzQ2y30-Eia8NlYPQDk= creationTimestamp: null labels: app.kubernetes.io/name: gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/configuration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/configuration.yaml new file mode 100644 index 0000000000..baadf182b5 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/configuration.yaml @@ -0,0 +1,69 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Configuration +metadata: + name: default +spec: + broker: + kafka: + brokers: + - kafka:1234 + services: + auth: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + control: {} + ledger: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + orchestration: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + payments: + encryptionKey: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + search: + batching: + count: + period: + elasticSearch: + host: elasticsearch + pathPrefix: '' + port: 9200 + scheme: http + stargate: + wallets: + gateway: + enableAuditPlugin: true + annotations: + service: + traefik.ingress.kubernetes.io/router.entrypoints: web + webhooks: + postgres: + disableSSLMode: true + host: localhost + password: root + port: 5432 + username: root + temporal: + address: + namespace: + tls: + crt: + key: diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml new file mode 100644 index 0000000000..9287f57b0c --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/auth-config.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +data: + config.yaml: | + clients: + - public: false + description: null + redirectUris: + - http://example.net/auth/login + PostLogoutRedirectUris: + - http://example.net/auth/destroy + scopes: + - openid + - profile + - email + - offline + id: control + secrets: + - mocked-secret + - public: false + description: null + redirectUris: [] + PostLogoutRedirectUris: [] + scopes: + - openid + - ledger:read + - ledger:write + - wallets:read + - wallets:write + - payments:read + - payments:write + id: orchestration + secrets: + - mocked-secret + - public: false + description: null + redirectUris: [] + PostLogoutRedirectUris: [] + scopes: + - openid + - ledger:read + - ledger:write + id: wallets + secrets: + - mocked-secret +kind: ConfigMap +metadata: + labels: + stack: "true" + name: auth-config + namespace: multipod-without-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml new file mode 100644 index 0000000000..eca1c56bd0 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/gateway-config.yaml @@ -0,0 +1,268 @@ +apiVersion: v1 +data: + Caddyfile: |- + (cors) { + header { + Access-Control-Allow-Methods "GET,OPTIONS,PUT,POST,DELETE,HEAD,PATCH" + Access-Control-Allow-Headers content-type + Access-Control-Max-Age 100 + Access-Control-Allow-Origin * + } + } + + (auth) { + auth { + issuer http://example.net/api/auth + + read_key_set_max_retries 10 + } + } + + { + + # Many directives manipulate the HTTP handler chain and the order in which + # those directives are evaluated matters. So the jwtauth directive must be + # ordered. + # c.f. https://caddyserver.com/docs/caddyfile/directives#directive-order + order auth before basicauth + order versions after metrics + } + + :8000 { + tracing { + span gateway + } + log { + output stdout + } + + @authmatcher { + path /api/auth* + } + handle @authmatcher { + uri strip_prefix /api/auth + reverse_proxy auth:8080 + + import cors + } + + @ledgermatcher { + path /api/ledger* + } + handle @ledgermatcher { + uri strip_prefix /api/ledger + reverse_proxy ledger:8080 + + import cors + import auth ledger + } + + @orchestrationmatcher { + path /api/orchestration* + } + handle @orchestrationmatcher { + uri strip_prefix /api/orchestration + reverse_proxy orchestration:8080 + + import cors + import auth orchestration + } + @paymentsmatcher { + path /api/payments/payments* + method POST GET PATCH + } + handle @paymentsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @poolsmatcher { + path /api/payments/pools* + method POST GET DELETE + } + handle @poolsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @accountsmatcher { + path /api/payments/accounts* + method GET + } + handle @accountsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @bank-accounts-readmatcher { + path /api/payments/bank-accounts* + method GET + } + handle @bank-accounts-readmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + @transfer-initiations-readmatcher { + path /api/payments/transfer-initiations* + method GET + } + handle @transfer-initiations-readmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + import cors + import auth payments + } + + @payments-apimatcher { + path /api/payments* + } + handle @payments-apimatcher { + uri strip_prefix /api/payments + reverse_proxy payments-api:8080 + + import cors + import auth payments + } + @connectorsmatcher { + path /api/payments/connectors* + } + handle @connectorsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @paymentWebhooksmatcher { + path /api/payments/connectors/webhooks* + method POST + } + handle @paymentWebhooksmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + } + @configsmatcher { + path /api/payments/configs* + } + handle @configsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @transfer-initiations-writematcher { + path /api/payments/transfer-initiations* + method POST DELETE + } + handle @transfer-initiations-writematcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + @bank-accounts-writematcher { + path /api/payments/bank-accounts* + method POST + } + handle @bank-accounts-writematcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + import cors + import auth payments + } + + @payments-connectorsmatcher { + path /api/payments* + } + handle @payments-connectorsmatcher { + uri strip_prefix /api/payments + reverse_proxy payments-connectors:8080 + + import cors + import auth payments + } + + @searchmatcher { + path /api/search* + } + handle @searchmatcher { + uri strip_prefix /api/search + reverse_proxy search:8080 + + import cors + import auth search + } + + @search-benthosmatcher { + path /api/search-benthos* + } + handle @search-benthosmatcher { + uri strip_prefix /api/search-benthos + reverse_proxy search-benthos:4195 + + import cors + import auth search + } + + @walletsmatcher { + path /api/wallets* + } + handle @walletsmatcher { + uri strip_prefix /api/wallets + reverse_proxy wallets:8080 + + import cors + import auth wallets + } + + @webhooksmatcher { + path /api/webhooks* + } + handle @webhooksmatcher { + uri strip_prefix /api/webhooks + reverse_proxy webhooks:8080 + + import cors + import auth webhooks + } + + handle /versions { + versions { + region "us-west-1" + env "staging" + endpoints { + auth http://auth:8080/_info http://auth:8080/_healthcheck + ledger http://ledger:8080/_info http://ledger:8080/_healthcheck + orchestration http://orchestration:8080/_info http://orchestration:8080/_healthcheck + payments-api http://payments-api:8080/_info http://payments-api:8080/_health + payments-connectors http://payments-connectors:8080/_info http://payments-connectors:8080/_health + search http://search:8080/_info http://search:8080/_healthcheck + wallets http://wallets:8080/_info http://wallets:8080/_healthcheck + webhooks http://webhooks:8080/_info http://webhooks:8080/_healthcheck + } + } + } + + # Respond 502 if service does not exists + handle /api/* { + respond "Bad Gateway" 502 + } + + # handle all other requests + handle { + reverse_proxy control:3000 + import cors + } + + } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: gateway-config + namespace: multipod-without-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml new file mode 100644 index 0000000000..780e50a1ab --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-resources.yaml @@ -0,0 +1,50 @@ +apiVersion: v1 +data: + output_elasticsearch.yaml: |- + output_resources: + - label: elasticsearch + processors: + - mapping: | + root = match { + this.action == "update" => if this.exists("upsert") { this.merge({ + "upsert": { + "stack": env("STACK") + } + }) } else { this }, + _ => this.merge({ + "document": { + "stack": env("STACK") + } + }) + } + root.id = "%s-%s".format(env("STACK"), this.id) + - log: + message: "Will write: ${! this }" + elasticsearch: + urls: + - ${OPENSEARCH_URL} + id: ${! json().id } + sniff: false + healthcheck: false + index: ${OPENSEARCH_INDEX} + action: ${! json().action } + tls: + enabled: true + skip_cert_verify: true + basic_auth: + enabled: ${BASIC_AUTH_ENABLED} + username: ${BASIC_AUTH_USERNAME} + password: ${BASIC_AUTH_PASSWORD} + batching: + count: ${OPENSEARCH_BATCHING_COUNT:10} + period: ${OPENSEARCH_BATCHING_PERIOD:1s} + multipart: true + doc: ${! if json().exists("document") { json("document") } else {""} } + script: ${! if json().exists("script") { json("script") } else {""} } + upsert: ${! if json().exists("upsert") { json("upsert") } else {""} } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-resources + namespace: multipod-without-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml new file mode 100644 index 0000000000..b597216161 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-streams.yaml @@ -0,0 +1,302 @@ +apiVersion: v1 +data: + ledger_ingestion_v1.yaml: "input:\n event_bus:\n topic: ledger\n consumer_group: search\n\npipeline:\n processors:\n - switch_event_type:\n events:\n - label: COMMITTED_TRANSACTIONS\n version: v1\n processors:\n - bloblang: |\n map account {\n root = this.map_each(v -> v.value.map_each(v2 -> {\n \"action\": \"upsert\",\n \"id\": v.key,\n \"document\": {\n \"data\": {\n \"address\": v.key\n },\n \"indexed\": {\n \"address\": v.key\n },\n \"kind\": \"ACCOUNT\"\n }\n }).values()).values().flatten()\n }\n\n map tx {\n root = {\n \"action\": \"index\",\n \"id\": \"%s\".format(this.txid),\n \"document\": {\n \"data\": {\n \"postings\": this.postings,\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"metadata\": if this.metadata { this.metadata } else {{}}\n },\n \"indexed\": {\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"asset\": this.postings.map_each(p -> p.asset),\n \"source\": this.postings.map_each(p -> p.source),\n \"destination\": this.postings.map_each(p -> p.destination),\n \"amount\": this.postings.map_each(p -> if p.asset.contains(\"/\") {\n [\n p.amount,\n p.amount / if p.asset.split(\"/\").index(1).number(){ range(0, p.asset.split(\"/\").index(1).number()).fold(1, t -> t.tally * 10) } else { 1 } # amount / pow(10, decimal part of asset)\n ]\n } else { [ p.amount ] }).flatten().map_each(v -> \"%v\".format(v))\n },\n \"kind\": \"TRANSACTION\"\n }\n }\n }\n\n map committedTransactions {\n root = [\n this.payload.transactions.map_each(t -> t.apply(\"tx\")).map_each(t -> t.assign({\n \"id\": \"TRANSACTION-%s-%s\".format(this.payload.ledger, t.id)\n })),\n this.payload.transactions.map_each(t -> t.postings.map_each(p -> [{\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, p.source),\n \"document\": {\n \"data\": {\n \"address\": p.source,\n \"metadata\": {}\n },\n \"indexed\": {\n \"address\": p.source\n },\n \"kind\": \"ACCOUNT\"\n }\n }, {\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, p.destination),\n \"document\": {\n \"data\": {\n \"address\": p.destination,\n \"metadata\": {}\n },\n \"indexed\": {\n \"address\": p.destination\n },\n \"kind\": \"ACCOUNT\"\n }\n }])).flatten().flatten()\n ].flatten().map_each(t -> t.merge({\n \"document\": {\n \"when\": this.date,\n \"ledger\": this.payload.ledger,\n \"data\": {\n \"ledger\": this.payload.ledger\n },\n \"indexed\": {\n \"ledger\": this.payload.ledger\n }\n },\n }))\n }\n\n root = this.apply(\"committedTransactions\")\n - unarchive:\n format: json_array\n - label: SAVED_METADATA\n version: v1\n processors:\n - bloblang: |\n root = this.payload.metadata.map_each(item -> {\n \"script\": \"if (ctx._source.data.metadata == null) { ctx._source.data.metadata = ['\" + item.key + \"': '\" + item.value.string() + \"'] } ctx._source.data.metadata['\" + item.key + \"']='\" + item.value.string() + \"'\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId),\n \"upsert\": {\n \"data\": {\n \"address\": this.payload.targetId,\n \"metadata\": { item.key: \"\\\"\" + item.value.string() + \"\\\"\" },\n \"ledger\": this.payload.ledger\n },\n \"indexed\": { \n \"address\": this.payload.targetId,\n \"ledger\": this.payload.ledger\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()\n - unarchive:\n format: json_array\n\noutput:\n resource: elasticsearch\n" + ledger_ingestion_v2.yaml: "input:\n event_bus:\n topic: ledger\n consumer_group: search-ledgerv2\n\npipeline:\n processors:\n - log:\n message: \"receive message: ${! this }\"\n - switch_event_type:\n events:\n - label: COMMITTED_TRANSACTIONS\n version: v2\n processors:\n - bloblang: |\n map amount {\n root = [this.amount]\n let hasDecimals = this.asset.split(\"/\").length() > 1\n let decimals = if $hasDecimals { this.asset.split(\"/\").index(1).number() } else { 0 }\n root = if $decimals > 0 {\n root.append(\n this.amount / range(0, $decimals).fold(1, t -> t.tally * 10) # Just a pow...\n )\n }\n root = root.flatten()\n }\n \n map tx {\n root = {\n \"action\": \"index\",\n \"id\": \"TRANSACTION-%s-%s\".format(this.ledger, this.transaction.id),\n \"document\": {\n \"data\": {\n \"postings\": this.transaction.postings,\n \"reference\": this.transaction.reference,\n \"txid\": this.transaction.id,\n \"timestamp\": this.transaction.timestamp,\n \"metadata\": if this.transaction.metadata { this.transaction.metadata } else {{}}\n },\n \"indexed\": {\n \"reference\": this.transaction.reference,\n \"txid\": this.transaction.id,\n \"timestamp\": this.transaction.timestamp,\n \"asset\": this.transaction.postings.map_each(p -> p.asset),\n \"source\": this.transaction.postings.map_each(p -> p.source),\n \"destination\": this.transaction.postings.map_each(p -> p.destination),\n \"amount\": this.transaction.postings.map_each(p -> p.apply(\"amount\"))\n },\n \"kind\": \"TRANSACTION\",\n \"when\": this.date\n }\n }\n }\n \n map account {\n root = {\n \"action\": \"upsert\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.ledger, this.account),\n \"document\": {\n \"data\": { \n \"address\": this.account,\n \"metadata\": {}\n },\n \"indexed\": { \n \"address\": this.account\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }\n }\n \n root = []\n root = root.append(\n this.payload.transactions.map_each(transaction -> {\n \"transaction\": transaction,\n \"ledger\": this.payload.ledger\n }.apply(\"tx\"))\n )\n root = root.append(\n this.payload.transactions.\n map_each(transaction -> transaction.postings.map_each(posting -> [\n posting.source,\n posting.destination\n ]).\n flatten().\n map_each(account -> {\n \"account\": account,\n \"ledger\": this.payload.ledger\n }.apply(\"account\"))\n ).\n flatten()\n )\n root = root.append(\n this.payload.accountMetadata.map_each(item -> item.value.map_each(metadata -> {\n \"script\": \"ctx._source.data.metadata[\\\"\" + metadata.key + \"\\\"]=\\\"\" + metadata.value + \"\\\"\",\n \"action\": \"update\",\n \"id\": \"ACCOUNT-%s-%s\".format(this.payload.ledger, item.key),\n \"upsert\": {\n \"data\": { \n \"address\": item.key,\n \"metadata\": { metadata.key: metadata.value }\n },\n \"indexed\": { \n \"address\": item.key\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()).values().flatten()\n )\n root = root.flatten()\n \n let overlay = {\n \"data\": {\n \"ledger\": this.payload.ledger\n },\n \"indexed\": {\n \"ledger\": this.payload.ledger \n }\n }\n \n root = root.map_each(cmd -> match cmd.action {\n cmd.action == \"update\" => if cmd.exists(\"upsert\") { cmd.merge({\n \"upsert\": $overlay\n }) } else { cmd },\n _ => cmd.merge({\n \"document\": $overlay\n }) \n })\n - log:\n message: \"Computed: ${! this }\"\n - unarchive:\n format: json_array\n - label: SAVED_METADATA\n version: v2\n processors:\n - bloblang: |\n root = this.payload.metadata.map_each(item -> {\n \"script\": \"if (ctx._source.data.metadata == null) { ctx._source.data.metadata = ['\" + item.key + \"': '\" + item.value + \"'] } ctx._source.data.metadata['\" + item.key + \"']='\" + item.value + \"'\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId),\n \"upsert\": {\n \"data\": { \n \"address\": this.payload.targetId,\n \"metadata\": { item.key: item.value },\n \"ledger\": this.payload.ledger\n },\n \"indexed\": { \n \"address\": this.payload.targetId,\n \"ledger\": this.payload.ledger\n },\n \"kind\": \"ACCOUNT\",\n \"when\": this.date\n }\n }).values()\n - unarchive:\n format: json_array\n - label: DELETED_METADATA\n version: v2\n processors:\n - bloblang: |\n root = {\n \"script\": \"ctx._source.data.metadata.remove(\\\"\" + this.payload.key + \"\\\")\",\n \"action\": \"update\",\n \"id\": \"%s-%s-%s\".format(this.payload.targetType, this.payload.ledger, this.payload.targetId)\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_accounts_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as accounts_count from \"${! meta(\"ledger\") }\".accounts'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.accounts_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select address, metadata\n from \"${! meta(\"ledger\") }\".accounts\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"document\": {\n \"data\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\"),\n \"metadata\": this.metadata\n },\n \"indexed\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ACCOUNT\",\n \"ledger\": meta(\"ledger\")\n },\n \"id\": \"ACCOUNT-%s-%s\".format(meta(\"ledger\"), this.address),\n \"action\": \"upsert\"\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_accounts_v2.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n - postgres_query:\n service: ledger\n query: |\n select address, metadata\n from \"${! meta(\"ledger\") }\".accounts\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"document\": {\n \"data\": { \n \"address\": this.address,\n \"ledger\": meta(\"ledger\"),\n \"metadata\": this.metadata\n },\n \"indexed\": {\n \"address\": this.address,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ACCOUNT\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n },\n \"id\": \"ACCOUNT-%s-%s\".format(meta(\"ledger\"), this.address),\n \"action\": \"upsert\"\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_all_v1.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - postgres_query: + service: ledger + query: 'select * from "_system".ledgers' + - unarchive: + format: json_array + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_v1 + ledger_reindex_all_v2.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - postgres_query: + service: ledger + query: 'select * from "_system".ledgers' + - unarchive: + format: json_array + - log: + message: "Process ledger: ${! this.ledger }" + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_v2 + ledger_reindex_transactions_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as transactions_count from \"${! meta(\"ledger\") }\".transactions'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.transactions_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select id, timestamp, reference, metadata, postings\n from \"${! meta(\"ledger\") }\".transactions\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = this.assign({\n \"postings\": this.postings.parse_json(),\n \"metadata\": this.metadata.parse_json()\n })\n - bloblang: |\n root = {\n \"id\": \"TRANSACTION-%s-%s\".format(meta(\"ledger\"), this.id),\n \"action\": \"upsert\",\n \"document\": {\n \"data\": {\n \"postings\": this.postings,\n \"reference\": this.reference,\n \"txid\": this.txid,\n \"timestamp\": this.timestamp,\n \"metadata\": if this.metadata { this.metadata } else {{}},\n \"ledger\": meta(\"ledger\")\n },\n \"indexed\": {\n \"reference\": this.reference,\n \"txid\": this.id,\n \"timestamp\": this.timestamp,\n \"asset\": this.postings.map_each(p -> p.asset),\n \"source\": this.postings.map_each(p -> p.source),\n \"destination\": this.postings.map_each(p -> p.destination),\n \"amount\": this.postings.map_each(p -> if p.asset.contains(\"/\") {\n [\n p.amount,\n p.amount / range(0, p.asset.split(\"/\").index(1).number()).fold(1, t -> t.tally * 10) # amount / pow(10, decimal part of asset)\n ]\n } else { [ p.amount ] }).flatten().map_each(v -> \"%v\".format(v)),\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"TRANSACTION\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n }\n }\n\noutput:\n resource: elasticsearch\n" + ledger_reindex_transactions_v2.yaml: | + input: + http_server: + path: / + + pipeline: + processors: + - bloblang: | + meta ledger = this.ledger + - postgres_query: + service: ledger + query: | + select id::varchar as id, timestamp, reference, metadata, postings + from "${! meta("ledger") }".transactions; + - unarchive: + format: json_array + - bloblang: | + root = this.assign({ + "postings": this.postings.parse_json(), + "metadata": this.metadata.parse_json() + }) + - bloblang: | + root = { + "id": "TRANSACTION-%s-%s".format(meta("ledger"), this.id), + "action": "upsert", + "document": { + "data": { + "postings": this.postings, + "reference": this.reference, + "txid": this.id, + "timestamp": this.timestamp, + "metadata": if this.metadata { this.metadata } else {{}}, + "ledger": meta("ledger") + }, + "indexed": { + "reference": this.reference, + "txid": this.id, + "timestamp": this.timestamp, + "asset": this.postings.map_each(p -> p.asset), + "source": this.postings.map_each(p -> p.source), + "destination": this.postings.map_each(p -> p.destination), + "amount": this.postings.map_each(p -> if p.asset.contains("/") { + [ + p.amount, + p.amount / range(0, p.asset.split("/").index(1).number()).fold(1, t -> t.tally * 10) # amount / pow(10, decimal part of asset) + ] + } else { [ p.amount ] }).flatten().map_each(v -> "%v".format(v)), + "ledger": meta("ledger") + }, + "kind": "TRANSACTION", + "ledger": meta("ledger"), + "when": this.date + } + } + + output: + resource: elasticsearch + ledger_reindex_v1.yaml: | + input: + http_server: + path: / + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_volumes_v1 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_transactions_v1 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_accounts_v1 + ledger_reindex_v2.yaml: | + input: + http_server: + path: / + + output: + broker: + outputs: + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_transactions_v2 + - http_client: + verb: POST + url: http://localhost:4195/ledger_reindex_accounts_v2 + ledger_reindex_volumes_v1.yaml: "input:\n http_server:\n path: /\n\npipeline:\n processors:\n - bloblang: |\n meta ledger = this.ledger\n meta batchSize = 100\n - postgres_query:\n service: ledger\n query: 'select count(*) as volumes_count from \"${! meta(\"ledger\") }\".volumes'\n - unarchive:\n format: json_array\n - bloblang: |\n meta loopCount = (this.volumes_count.number() / meta(\"batchSize\").number()).ceil()\n meta loopIndex = 0\n - bloblang: |\n root = if meta(\"loopCount\") == \"0\" {\n deleted() \n }\n - while:\n check: 'meta(\"loopIndex\") < meta(\"loopCount\")'\n processors:\n - postgres_query:\n service: ledger\n query: |\n select account, asset, input, output\n from \"${! meta(\"ledger\") }\".volumes\n offset ${! meta(\"loopIndex\").number() * meta(\"batchSize\").number() }\n limit ${! meta(\"batchSize\") }\n - bloblang:\n meta loopIndex = meta(\"loopIndex\").number() + 1\n - unarchive:\n format: json_array\n - bloblang: |\n root = {\n \"id\": \"ASSET-%s-%s-%s\".format(meta(\"ledger\"), this.account, this.asset),\n \"action\": \"upsert\",\n \"document\": {\n \"data\": {\n \"name\": this.asset,\n \"input\": this.input,\n \"output\": this.output,\n \"account\": this.account,\n \"ledger\": meta(\"ledger\")\n },\n \"indexed\": {\n \"account\": this.account,\n \"name\": this.asset,\n \"ledger\": meta(\"ledger\")\n },\n \"kind\": \"ASSET\",\n \"ledger\": meta(\"ledger\"),\n \"when\": this.date\n }\n }\n\noutput:\n resource: elasticsearch\n" + payments_deletion.yaml: "input:\n event_bus:\n topic: payments\n consumer_group: search-payments-resets\n\npipeline:\n processors:\n - switch_event_type:\n events:\n - label: CONNECTOR_RESET\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"bool\": {\n \"should\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_POOL\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_ACCOUNT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_BALANCE\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_BANK_ACCOUNT\"\n }\n },\n {\n \"match\": {\n \"kind\": \"PAYMENT_TRANSFER_INITIATION\"\n }\n }\n ]\n }\n },\n {\n \"match\": {\n \"indexed.connectorId\": this.payload.connectorId\n }\n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\n - label: DELETED_POOL\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT_POOL\"\n }\n },\n {\n \"match\": {\n \"indexed.id\": this.payload.id\n } \n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\n - label: DELETED_TRANSFER_INITIATION\n version: v1\n processors:\n - bloblang: |\n root = {\n \"query\": {\n \"bool\": {\n \"must\": [\n {\n \"match\": {\n \"kind\": \"PAYMENT_TRANSFER_INITIATION\"\n }\n },\n {\n \"should\": [\n {\n \"match\": {\n \"indexed.id\": this.payload.id\n }\n },\n {\n \"match\": {\n \"indexed.provider\": this.payload.provider\n }\n }\n ]\n },\n {\n \"match\": {\n \"stack\": env(\"STACK\")\n }\n }\n ]\n }\n }\n }\n\noutput:\n http_client:\n url: ${OPENSEARCH_URL}/${OPENSEARCH_INDEX}/_delete_by_query\n verb: POST\n headers:\n Content-Type: application/json\n basic_auth:\n enabled: ${BASIC_AUTH_ENABLED}\n username: ${BASIC_AUTH_USERNAME}\n password: ${BASIC_AUTH_PASSWORD}\n" + payments_ingestion.yaml: | + input: + event_bus: + topic: payments + consumer_group: search + + pipeline: + processors: + - switch_event_type: + events: + - label: SAVED_PAYMENT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload.without("rawData"), + "indexed": { + "id": this.payload.id, + "reference": this.payload.reference, + "provider": this.payload.provider, + "createdAt": this.payload.createdAt, + "connectorId": this.payload.connectorId, + "type": this.payload.type, + "status": this.payload.status, + "scheme": this.payload.scheme, + "asset": this.payload.asset, + "initialAmount": this.payload.initialAmount, + "amount": this.payload.amount + }, + "kind": "PAYMENT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-%s".format(this.payload.id) + } + - label: SAVED_ACCOUNT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "provider": this.payload.provider, + "createdAt": this.payload.createdAt, + "reference": this.payload.reference, + "connectorId": this.payload.connectorId, + "defaultAsset": this.payload.defaultAsset, + "accountName": this.payload.accountName, + "type": this.payload.type + }, + "kind": "PAYMENT_ACCOUNT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-ACCOUNT-%s".format(this.payload.id) + } + - label: SAVED_BALANCE + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "accountId": this.payload.accountID, + "provider": this.payload.provider, + "connectorId": this.payload.connectorId, + "createdAt": this.payload.createdAt, + "asset": this.payload.asset, + "balance": this.payload.balance + }, + "kind": "PAYMENT_BALANCE", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-BALANCE-%s-%s".format(this.payload.accountID, this.payload.asset) + } + - label: SAVED_BANK_ACCOUNT + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "connectorId": this.payload.connectorId, + "provider": this.payload.provider, + "name": this.payload.name, + "accountNumber": this.payload.accountNumber, + "iban": this.payload.iban, + "swiftBicCode": this.payload.swiftBicCode, + "country": this.payload.country, + "provider": this.payload.provider, + "accountId": this.payload.accountID + }, + "kind": "PAYMENT_BANK_ACCOUNT", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-BANK-ACCOUNT-%s".format(this.payload.id) + } + - label: SAVED_POOL + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "name": this.payload.name, + "accountIDs": this.payload.accountIDs, + }, + "kind": "PAYMENT_POOL", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-POOL-%s".format(this.payload.id) + } + - label: SAVED_TRANSFER_INITIATION + version: v1 + processors: + - bloblang: | + root = { + "document": { + "data": this.payload, + "indexed": { + "id": this.payload.id, + "createdAt": this.payload.createdAt, + "scheduledAt": this.payload.scheduledAt, + "updatedAt": this.payload.updatedAt, + "connectorId": this.payload.connectorId, + "description": this.payload.description, + "type": this.payload.type, + "provider": this.payload.provider, + "sourceAccountId": this.payload.sourceAccountID, + "destinationAccountId": this.payload.destinationAccountID, + "amount": this.payload.amount, + "asset": this.payload.asset, + "attempts": this.payload.attempts, + "status": this.payload.status, + "error": this.payload.error, + "relatedPayment": this.payload.relatedPayment + }, + "kind": "PAYMENT_TRANSFER_INITIATION", + "when": this.date + }, + "action": "index", + "id": "PAYMENT-TRANSFER-INITIATION-%s".format(this.payload.id) + } + + output: + resource: elasticsearch +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-streams + namespace: multipod-without-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml new file mode 100644 index 0000000000..4bb1ea2bf5 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/configmaps--v1/search-benthos-templates.yaml @@ -0,0 +1,90 @@ +apiVersion: v1 +data: + event_bus.yaml: | + name: event_bus + type: input + + fields: + - name: topic + type: string + - name: consumer_group + type: string + + mapping: | + root = if env("BROKER") == "kafka" {{ + "kafka": { + "addresses": [ env("KAFKA_ADDRESS") ], + "topics": [ env("TOPIC_PREFIX") + this.topic ], + "target_version": env("KAFKA_VERSION"), + "consumer_group": this.consumer_group, + "checkpoint_limit": 1024, + "sasl": { + "mechanism": env("KAFKA_SASL_MECHANISM"), + "password": env("KAFKA_SASL_PASSWORD"), + "user": env("KAFKA_SASL_USERNAME") + }, + "tls": { + "enabled": env("KAFKA_TLS_ENABLED") == "true" + }, + "extract_tracing_map": "root = meta()" + } + }} else {{ + "nats_jetstream": { + "urls": [env("NATS_URL")], + "queue": this.consumer_group, + "subject": env("TOPIC_PREFIX") + this.topic, + "durable": this.consumer_group + } + }} + postgres_query.yaml: | + name: postgres_query + type: processor + + fields: + - name: query + type: string + - name: service + type: string + + mapping: | + root = { + "sql_raw": { + "dsn": env("%s_POSTGRES_URI".format(this.service.uppercase())), + "driver": "postgres", + "query": this.query, + "unsafe_dynamic_query": true + } + } + switch_event_type.yaml: | + name: switch_event_type + type: processor + + fields: + - kind: list + type: unknown + name: events + + mapping: | + root = { + "switch": this.events.map_each(eventDefinition -> { + "check": "this.type == \"%s\" && this.version == \"%s\"".format(eventDefinition.label, eventDefinition.version), + "processors": eventDefinition.processors + }).append({ + "processors": [ + { + "log": { + "message": "unable to handle message ${! content() }" + } + }, + { + "bloblang": "root = deleted()" + } + ] + }) + } +kind: ConfigMap +metadata: + labels: + stack: "true" + name: search-benthos-templates + namespace: multipod-without-new-versions-per-module-gateway diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml new file mode 100644 index 0000000000..bc9f6121b4 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/cronjobs-batch-v1/reindex-ledger.yaml @@ -0,0 +1,39 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + generation: 1 + labels: + stack: "true" + name: reindex-ledger + namespace: multipod-without-new-versions-per-module-gateway +spec: + concurrencyPolicy: Allow + failedJobsHistoryLimit: 1 + jobTemplate: + metadata: + creationTimestamp: null + spec: + template: + metadata: + creationTimestamp: null + spec: + containers: + - command: + - sh + - -c + - "/bin/sh <<'EOF'\n\n\t\t\n\t\t\t\t\tcurl http://search-benthos.multipod-without-new-versions-per-module-gateway.svc.cluster.local:4195/ledger_reindex_all -X POST -H 'Content-Type: application/json' -d '{}'\n \t\t\t\t\t\t \nEOF" + image: curlimages/curl:8.2.1 + imagePullPolicy: IfNotPresent + name: reindex-ledger + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Never + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + schedule: '* * * * *' + successfulJobsHistoryLimit: 3 + suspend: true +status: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml new file mode 100644 index 0000000000..368b67a8b1 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/auth.yaml @@ -0,0 +1,115 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: auth + formance.com/monopod: "false" + stack: "true" + name: auth + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: auth + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: oQpoLrzV7V5HyafDUh_DPOoleiB93uWbpo-iGuO9NSw= + creationTimestamp: null + labels: + app.kubernetes.io/name: auth + spec: + containers: + - args: + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-auth + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: auth + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: CONFIG + value: /config/config/config.yaml + - name: DELEGATED_CLIENT_SECRET + - name: DELEGATED_CLIENT_ID + - name: DELEGATED_ISSUER + - name: BASE_URL + value: http://example.net/api/auth + - name: SIGNING_KEY + valueFrom: + secretKeyRef: + key: signingKey + name: auth-secret + image: ghcr.io/formancehq/auth:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: auth + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/config + name: config + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: auth-config + name: config +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml new file mode 100644 index 0000000000..c07e05c5f3 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/control.yaml @@ -0,0 +1,80 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: control + formance.com/monopod: "false" + stack: "true" + name: control + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: control + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: control + spec: + containers: + - env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: control + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: API_URL + value: http://example.net + - name: ENCRYPTION_KEY + value: 9h44y2ZqrDuUy5R9NGLA9hca7uRUr932 + - name: ENCRYPTION_IV + value: b6747T6eP9DnMvEw + - name: CLIENT_ID + value: control + - name: CLIENT_SECRET + value: mocked-secret + - name: REDIRECT_URI + value: http://example.net + - name: UNSECURE_COOKIES + value: "false" + image: ghcr.io/formancehq/control:latest + imagePullPolicy: Always + name: control + ports: + - containerPort: 3000 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 512Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml new file mode 100644 index 0000000000..1de7ab797d --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/gateway.yaml @@ -0,0 +1,89 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: gateway + formance.com/monopod: "false" + stack: "true" + name: gateway + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: gateway + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: vNn-AtBRv6W7kkL2YhIOCaglgZmzEX47juhrXy12OC4= + creationTimestamp: null + labels: + app.kubernetes.io/name: gateway + spec: + containers: + - args: + - run + - --config + - /config/config/Caddyfile + - --adapter + - caddyfile + command: + - /usr/bin/caddy + env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: gateway + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + image: ghcr.io/formancehq/gateway:v0.1.7 + imagePullPolicy: IfNotPresent + name: gateway + ports: + - containerPort: 8000 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/config + name: config + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: gateway-config + name: config +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml new file mode 100644 index 0000000000..c2b188b9ca --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/ledger.yaml @@ -0,0 +1,104 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: ledger + formance.com/monopod: "false" + stack: "true" + name: ledger + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: ledger + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: ledger + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: ledger + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: STORAGE_DRIVER + value: postgres + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-without-new-versions-per-module-gateway-ledger' + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/ledger:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: ledger + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml new file mode 100644 index 0000000000..69989654c3 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration-worker.yaml @@ -0,0 +1,98 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: orchestration + formance.com/monopod: "false" + stack: "true" + name: orchestration-worker + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: orchestration-worker + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: orchestration-worker + spec: + containers: + - args: + - worker + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: orchestration-worker + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: POSTGRES_DSN + value: $(POSTGRES_URI) + - name: TEMPORAL_TASK_QUEUE + value: multipod-without-new-versions-per-module-gateway + - name: TEMPORAL_ADDRESS + - name: TEMPORAL_NAMESPACE + - name: STACK_CLIENT_ID + value: orchestration + - name: STACK_CLIENT_SECRET + value: mocked-secret + - name: TEMPORAL_SSL_CLIENT_KEY + - name: TEMPORAL_SSL_CLIENT_CERT + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: TOPICS + value: multipod-without-new-versions-per-module-gateway-ledger multipod-without-new-versions-per-module-gateway-payments + image: ghcr.io/formancehq/orchestration:latest + imagePullPolicy: Always + name: orchestration-worker + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml new file mode 100644 index 0000000000..ad9358d2b6 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/orchestration.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: orchestration + formance.com/monopod: "false" + stack: "true" + name: orchestration + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: orchestration + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: orchestration + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: orchestration + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: POSTGRES_DSN + value: $(POSTGRES_URI) + - name: TEMPORAL_TASK_QUEUE + value: multipod-without-new-versions-per-module-gateway + - name: TEMPORAL_ADDRESS + - name: TEMPORAL_NAMESPACE + - name: STACK_CLIENT_ID + value: orchestration + - name: STACK_CLIENT_SECRET + value: mocked-secret + - name: TEMPORAL_SSL_CLIENT_KEY + - name: TEMPORAL_SSL_CLIENT_CERT + image: ghcr.io/formancehq/orchestration:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: orchestration + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml new file mode 100644 index 0000000000..329b9cad71 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-api.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: payments + formance.com/monopod: "false" + stack: "true" + name: payments-api + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: payments-api + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: payments-api + spec: + containers: + - args: + - api + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: payments-api + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: POSTGRES_DATABASE_NAME + value: $(POSTGRES_DATABASE) + - name: CONFIG_ENCRYPTION_KEY + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-without-new-versions-per-module-gateway-payments' + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_health + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: payments-api + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml new file mode 100644 index 0000000000..fd2bb3674a --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/payments-connectors.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: payments + formance.com/monopod: "false" + stack: "true" + name: payments-connectors + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: payments-connectors + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: payments-connectors + spec: + containers: + - args: + - connectors + - serve + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: payments-connectors + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: POSTGRES_DATABASE_NAME + value: $(POSTGRES_DATABASE) + - name: CONFIG_ENCRYPTION_KEY + - name: PUBLISHER_TOPIC_MAPPING + value: '*:multipod-without-new-versions-per-module-gateway-payments' + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_health + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: payments-connectors + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml new file mode 100644 index 0000000000..18227f2696 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search-benthos.yaml @@ -0,0 +1,129 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: search + formance.com/monopod: "false" + stack: "true" + name: search-benthos + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: search-benthos + strategy: + type: Recreate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: iXL4EcTjD7D2Zkq9Qb1D6Bctp8pGhkzkiwtjjBeKSnU= + creationTimestamp: null + labels: + app.kubernetes.io/name: search-benthos + spec: + containers: + - command: + - /benthos + - -r + - /config/resources/*.yaml + - -t + - /config/templates/*.yaml + - --log.level + - trace + - streams + - /config/streams/*.yaml + env: + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: search-benthos + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: OPENSEARCH_URL + value: http://elasticsearch:9200 + - name: OPENSEARCH_BATCHING_COUNT + value: "0" + - name: OPENSEARCH_BATCHING_PERIOD + - name: TOPIC_PREFIX + value: multipod-without-new-versions-per-module-gateway- + - name: OPENSEARCH_INDEX + value: stacks + - name: KAFKA_ADDRESS + value: kafka:1234 + - name: BASIC_AUTH_ENABLED + value: "false" + - name: BASIC_AUTH_USERNAME + value: username + - name: BASIC_AUTH_PASSWORD + value: password + - name: LEDGER_POSTGRES_HOST + value: localhost + - name: LEDGER_POSTGRES_PORT + value: "5432" + - name: LEDGER_POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-ledger + - name: LEDGER_POSTGRES_USERNAME + value: root + - name: LEDGER_POSTGRES_PASSWORD + value: root + - name: LEDGER_POSTGRES_NO_DATABASE_URI + value: postgresql://$(LEDGER_POSTGRES_USERNAME):$(LEDGER_POSTGRES_PASSWORD)@$(LEDGER_POSTGRES_HOST):$(LEDGER_POSTGRES_PORT) + - name: LEDGER_POSTGRES_URI + value: $(LEDGER_POSTGRES_NO_DATABASE_URI)/$(LEDGER_POSTGRES_DATABASE)?sslmode=disable + - name: BROKER + value: kafka + image: public.ecr.aws/formance-internal/jeffail/benthos:v4.23.0-es + imagePullPolicy: IfNotPresent + name: search-benthos + ports: + - containerPort: 4195 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + volumeMounts: + - mountPath: /config/resources + name: resources + readOnly: true + - mountPath: /config/streams + name: streams + readOnly: true + - mountPath: /config/templates + name: templates + readOnly: true + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 + volumes: + - configMap: + defaultMode: 420 + name: search-benthos-resources + name: resources + - configMap: + defaultMode: 420 + name: search-benthos-streams + name: streams + - configMap: + defaultMode: 420 + name: search-benthos-templates + name: templates +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml new file mode 100644 index 0000000000..a298a70e65 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/search.yaml @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: search + formance.com/monopod: "false" + stack: "true" + name: search + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: search + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: search + spec: + containers: + - env: + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: search + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: OPENSEARCH_URL + value: http://elasticsearch:9200 + - name: OPENSEARCH_BATCHING_COUNT + value: "0" + - name: OPENSEARCH_BATCHING_PERIOD + - name: TOPIC_PREFIX + value: multipod-without-new-versions-per-module-gateway- + - name: OPENSEARCH_INDEX + value: stacks + - name: KAFKA_ADDRESS + value: kafka:1234 + - name: BASIC_AUTH_ENABLED + value: "false" + - name: BASIC_AUTH_USERNAME + value: username + - name: BASIC_AUTH_PASSWORD + value: password + - name: OPEN_SEARCH_SERVICE + value: elasticsearch:9200 + - name: OPEN_SEARCH_SCHEME + value: http + - name: MAPPING_INIT_DISABLED + value: "true" + - name: ES_INDICES + value: stacks + image: ghcr.io/formancehq/search:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: search + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml new file mode 100644 index 0000000000..97a0fe9cb2 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/stargate.yaml @@ -0,0 +1,88 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: stargate + formance.com/monopod: "false" + stack: "true" + name: stargate + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: stargate + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: stargate + spec: + containers: + - env: + - name: BIND + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: stargate + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: ORGANIZATION_ID + value: multipod + - name: STACK_ID + value: without + - name: STARGATE_SERVER_URL + - name: GATEWAY_URL + value: http://gateway:8000 + - name: STARGATE_AUTH_CLIENT_ID + - name: STARGATE_AUTH_CLIENT_SECRET + - name: STARGATE_AUTH_ISSUER_URL + image: ghcr.io/formancehq/stargate:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: stargate + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml new file mode 100644 index 0000000000..1bed7f993f --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/wallets.yaml @@ -0,0 +1,84 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: wallets + formance.com/monopod: "false" + stack: "true" + name: wallets + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: wallets + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: wallets + spec: + containers: + - env: + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: wallets + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + - name: STACK_CLIENT_ID + value: wallets + - name: STACK_CLIENT_SECRET + value: mocked-secret + image: ghcr.io/formancehq/wallets:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: wallets + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml new file mode 100644 index 0000000000..e66392c94c --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks-worker.yaml @@ -0,0 +1,90 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: webhooks + formance.com/monopod: "false" + stack: "true" + name: webhooks-worker + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: webhooks-worker + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: webhooks-worker + spec: + containers: + - args: + - worker + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :0 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: webhooks-worker + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + - name: KAFKA_TOPICS + value: multipod-without-new-versions-per-module-gateway-ledger multipod-without-new-versions-per-module-gateway-payments + image: ghcr.io/formancehq/webhooks:latest + imagePullPolicy: Always + name: webhooks-worker + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml new file mode 100644 index 0000000000..4590f16816 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/deployments-apps-v1/webhooks.yaml @@ -0,0 +1,100 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + generation: 1 + labels: + app.kubernetes.io/name: webhooks + formance.com/monopod: "false" + stack: "true" + name: webhooks + namespace: multipod-without-new-versions-per-module-gateway +spec: + progressDeadlineSeconds: 600 + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: webhooks + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + annotations: + stack.formance.cloud/volumes-hash: 47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU= + creationTimestamp: null + labels: + app.kubernetes.io/name: webhooks + spec: + containers: + - env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: LISTEN + value: :8080 + - name: DEBUG + value: "false" + - name: DEV + value: "false" + - name: STACK_URL + value: http://example.net + - name: OTEL_SERVICE_NAME + value: webhooks + - name: STACK + value: multipod-without-new-versions-per-module-gateway + - name: BROKER + value: kafka + - name: PUBLISHER_KAFKA_ENABLED + value: "true" + - name: PUBLISHER_KAFKA_BROKER + value: kafka:1234 + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/webhooks:latest + imagePullPolicy: Always + livenessProbe: + failureThreshold: 20 + httpGet: + path: /_healthcheck + port: 8080 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 2 + successThreshold: 1 + timeoutSeconds: 30 + name: webhooks + ports: + - containerPort: 8080 + name: http + protocol: TCP + resources: + requests: + cpu: 100m + memory: 50Mi + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + availableReplicas: 1 + observedGeneration: 1 + readyReplicas: 1 + replicas: 1 + updatedReplicas: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml new file mode 100644 index 0000000000..d626d8c24e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/ingresses-networking.k8s.io-v1/gateway.yaml @@ -0,0 +1,22 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + generation: 1 + labels: + stack: "true" + name: gateway + namespace: multipod-without-new-versions-per-module-gateway +spec: + rules: + - host: example.net + http: + paths: + - backend: + service: + name: gateway + port: + name: http + path: / + pathType: Prefix +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml new file mode 100644 index 0000000000..691b2abdab --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/auth-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: auth-create-database + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: auth-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-auth + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml new file mode 100644 index 0000000000..fa6834e533 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: ledger-create-database + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: ledger-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml new file mode 100644 index 0000000000..526544e459 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/ledger-latest-db-migration.yaml @@ -0,0 +1,56 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: ledger-latest-db-migration + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: ledger-latest-db-migration + spec: + containers: + - args: + - buckets + - upgrade-all + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-ledger + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: STORAGE_POSTGRES_CONN_STRING + value: $(POSTGRES_URI) + image: ghcr.io/formancehq/ledger:latest + imagePullPolicy: Always + name: migrate + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml new file mode 100644 index 0000000000..28db675dde --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/orchestration-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: orchestration-create-database + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: orchestration-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-orchestration + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml new file mode 100644 index 0000000000..bde4ae891e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: payments-create-database + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: payments-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml new file mode 100644 index 0000000000..946df56049 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/payments-latest-db-migration.yaml @@ -0,0 +1,54 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: payments-latest-db-migration + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: payments-latest-db-migration + spec: + containers: + - args: + - migrate + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-payments + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: CONFIG_ENCRYPTION_KEY + image: ghcr.io/formancehq/payments:latest + imagePullPolicy: Always + name: migrate + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml new file mode 100644 index 0000000000..109ec6429a --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/jobs-batch-v1/webhooks-create-database.yaml @@ -0,0 +1,57 @@ +apiVersion: batch/v1 +kind: Job +metadata: + generation: 1 + labels: + stack: "true" + name: webhooks-create-database + namespace: multipod-without-new-versions-per-module-gateway +spec: + backoffLimit: 6 + completionMode: NonIndexed + completions: 1 + parallelism: 1 + selector: + matchLabels: {} + suspend: false + template: + metadata: + creationTimestamp: null + labels: + job-name: webhooks-create-database + spec: + containers: + - args: + - sh + - -c + - echo SELECT \'CREATE DATABASE \"${POSTGRES_DATABASE}\"\' WHERE NOT EXISTS \(SELECT FROM pg_database WHERE datname = \'${POSTGRES_DATABASE}\'\)\\gexec | psql -h ${POSTGRES_HOST} -p ${POSTGRES_PORT} -U ${POSTGRES_USERNAME} "sslmode=disable" + env: + - name: POSTGRES_HOST + value: localhost + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_DATABASE + value: multipod-without-new-versions-per-module-gateway-webhooks + - name: POSTGRES_USERNAME + value: root + - name: POSTGRES_PASSWORD + value: root + - name: POSTGRES_NO_DATABASE_URI + value: postgresql://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT) + - name: POSTGRES_URI + value: $(POSTGRES_NO_DATABASE_URI)/$(POSTGRES_DATABASE)?sslmode=disable + - name: PGPASSWORD + value: $(POSTGRES_PASSWORD) + image: postgres:15-alpine + imagePullPolicy: IfNotPresent + name: create-database + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + dnsPolicy: ClusterFirst + restartPolicy: OnFailure + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 +status: + succeeded: 1 diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml new file mode 100644 index 0000000000..bfce72a61f --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.6.5-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.6.5-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.6.5 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml new file mode 100644 index 0000000000..2913374581 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.7.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.7.0-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.7.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml new file mode 100644 index 0000000000..dff41398b4 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.8.0-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.8.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml new file mode 100644 index 0000000000..06e650504f --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v0.8.1-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v0.8.1-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: true + targetedVersion: v0.8.1 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml new file mode 100644 index 0000000000..1c7fc738eb --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/payments-v1.0.0-beta.3-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: payments-v1.0.0-beta.3-pre-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: latest + module: payments + postUpgrade: false + targetedVersion: v1.0.0-beta.3 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml new file mode 100644 index 0000000000..6b4ca7252e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.0.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.0.0-pre-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.0.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml new file mode 100644 index 0000000000..6139476018 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.10.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.10.0-pre-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.10.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml new file mode 100644 index 0000000000..92d9c71170 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.7.0-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: true + targetedVersion: v0.7.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml new file mode 100644 index 0000000000..4a65c20e9e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/search-v0.7.0-pre-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: search-v0.7.0-pre-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: search + postUpgrade: false + targetedVersion: v0.7.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml new file mode 100644 index 0000000000..577a742de9 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.3-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.4.3-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.4.3 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml new file mode 100644 index 0000000000..410f573d11 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.4.4-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.4.4-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.4.4 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml new file mode 100644 index 0000000000..83008a98da --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/migrations-stack.formance.com-v1beta3/wallets-v0.5.0-post-upgrade.yaml @@ -0,0 +1,17 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Migration +metadata: + generation: 1 + labels: + stack: "true" + name: wallets-v0.5.0-post-upgrade + namespace: multipod-without-new-versions-per-module-gateway +spec: + configuration: multipod-without-new-versions-per-module-gateway + currentVersion: "" + module: wallets + postUpgrade: true + targetedVersion: v0.5.0 + version: multipod-without-new-versions-per-module-gateway +status: + terminated: true diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml new file mode 100644 index 0000000000..cce6c3efd2 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/secrets--v1/auth-secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +data: + signingKey: ZmFrZS1yc2Eta2V5 +kind: Secret +metadata: + labels: + stack: "true" + name: auth-secret + namespace: multipod-without-new-versions-per-module-gateway +type: Opaque diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/auth.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/auth.yaml new file mode 100644 index 0000000000..5243550f8e --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/auth.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: auth + name: auth + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: auth + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/control.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/control.yaml new file mode 100644 index 0000000000..8cd8454193 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/control.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: control + name: control + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 3000 + protocol: TCP + targetPort: 3000 + selector: + app.kubernetes.io/name: control + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/gateway.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/gateway.yaml new file mode 100644 index 0000000000..8c6559da60 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/gateway.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: web + labels: + app.kubernetes.io/service-name: gateway + name: gateway + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8000 + protocol: TCP + targetPort: 8000 + selector: + app.kubernetes.io/name: gateway + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/ledger.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/ledger.yaml new file mode 100644 index 0000000000..1968774d32 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/ledger.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: ledger + name: ledger + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: ledger + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/orchestration.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/orchestration.yaml new file mode 100644 index 0000000000..7c3ca4a4de --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/orchestration.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: orchestration + name: orchestration + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: orchestration + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-api.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-api.yaml new file mode 100644 index 0000000000..20a8027a46 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-api.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: payments-api + name: payments-api + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: payments-api + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml new file mode 100644 index 0000000000..4280e08a20 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/payments-connectors.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: payments-connectors + name: payments-connectors + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: payments-connectors + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml new file mode 100644 index 0000000000..16dff4cfa8 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search-benthos.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: search-benthos + name: search-benthos + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 4195 + protocol: TCP + targetPort: 4195 + selector: + app.kubernetes.io/name: search-benthos + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search.yaml new file mode 100644 index 0000000000..e0bbcc0714 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/search.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: search + name: search + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: search + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/wallets.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/wallets.yaml new file mode 100644 index 0000000000..773055e28f --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/wallets.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: wallets + name: wallets + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: wallets + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/webhooks.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/webhooks.yaml new file mode 100644 index 0000000000..d9427b9535 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/results/services--v1/webhooks.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/service-name: webhooks + name: webhooks + namespace: multipod-without-new-versions-per-module-gateway +spec: + internalTrafficPolicy: Cluster + ipFamilies: + - IPv4 + ipFamilyPolicy: SingleStack + ports: + - appProtocol: http + name: http + port: 8080 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: webhooks + sessionAffinity: None + type: ClusterIP +status: + loadBalancer: {} diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/stack.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/stack.yaml new file mode 100644 index 0000000000..cc9a37df15 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/stack.yaml @@ -0,0 +1,11 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Stack +metadata: + name: stack1 +spec: + debug: false + dev: false + scheme: http + host: example.net + seed: stacks + versions: default diff --git a/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/versions.yaml b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/versions.yaml new file mode 100644 index 0000000000..e501966fd3 --- /dev/null +++ b/components/operator/internal/controllers/stack/testdata/multipod-without-new-versions-per-module-gateway/versions.yaml @@ -0,0 +1,8 @@ +apiVersion: stack.formance.com/v1beta3 +kind: Versions +metadata: + name: default +spec: + gateway: v0.1.7 + ledger: latest + payments: latest \ No newline at end of file diff --git a/components/operator/internal/modules/gateway/handler.go b/components/operator/internal/modules/gateway/handler.go index b0128a3588..c5c263f006 100644 --- a/components/operator/internal/modules/gateway/handler.go +++ b/components/operator/internal/modules/gateway/handler.go @@ -98,14 +98,32 @@ var Module = &module{} var _ modules.Module = Module var _ modules.DependsOnAwareModule = Module -var caddyfileTemplate = template.Must(template.New("caddyfile").Funcs(map[string]any{ - "join": strings.Join, -}).Parse(caddyfile)) - func init() { modules.Register(Module) } +func caddyFileTemplate(context modules.ServiceInstallConfiguration) *template.Template { + gatewayVersion := context.Versions.Spec.Gateway + if !semver.IsValid(gatewayVersion) { + return template.Must(template.New("caddyfile").Funcs(map[string]any{ + "join": strings.Join, + }).Parse(caddyfile)) + } + + switch semver.Compare("v0.1.8", gatewayVersion) { + case -1, 0: + // gatewayVersion >= v0.1.8 + return template.Must(template.New("caddyfile").Funcs(map[string]any{ + "join": strings.Join, + }).Parse(caddyfile)) + default: + // gatewayVersion < v0.1.8 + return template.Must(template.New("caddyfile").Funcs(map[string]any{ + "join": strings.Join, + }).Parse(deprecatedCaddyfile)) + } +} + // When enabled, the audit plugin will be enabled for the gateway. // The audit plugin is available since gateway v0.2.0. // If the gateway version is not available, the audit plugin will be disabled. @@ -125,6 +143,7 @@ func EnableAuditPlugin(ctx modules.ReconciliationConfig) bool { } func createCaddyfile(context modules.ServiceInstallConfiguration) string { + fmt.Println("TOTOTOTOTO", context.Versions.Spec.Gateway) buf := bytes.NewBufferString("") type service struct { @@ -138,6 +157,16 @@ func createCaddyfile(context modules.ServiceInstallConfiguration) string { Module string } + type versionEndpoint struct { + VersionEndpoint string + HealthEndpoint string + } + + type versions struct { + ModuleName string + Endpoints []versionEndpoint + } + servicesMap := make(map[string]service, 0) keys := make([]string, 0) for _, registeredModule := range context.RegisteredModules { @@ -205,7 +234,36 @@ func createCaddyfile(context modules.ServiceInstallConfiguration) string { enableScopes = *context.ReconciliationConfig.Configuration.Spec.Services.Gateway.EnableScopes } - if err := caddyfileTemplate.Execute(buf, map[string]any{ + versionsMap := make(map[string]*versions, 0) + for _, service := range services { + if !service.HasVersionEndpoint { + continue + } + + _, ok := versionsMap[service.Module] + if !ok { + versionsMap[service.Module] = &versions{ + ModuleName: service.Module, + Endpoints: make([]versionEndpoint, 0), + } + } + + versionsMap[service.Module].Endpoints = append(versionsMap[service.Module].Endpoints, versionEndpoint{ + VersionEndpoint: fmt.Sprintf("http://%s:%d/_info", service.Hostname, service.Port), + HealthEndpoint: fmt.Sprintf("http://%s:%d/%s", service.Hostname, service.Port, service.HealthPath), + }) + } + + vs := make([]*versions, 0) + for _, v := range versionsMap { + vs = append(vs, v) + } + + sort.Slice(vs, func(i, j int) bool { + return vs[i].ModuleName < vs[j].ModuleName + }) + + if err := caddyFileTemplate(context).Execute(buf, map[string]any{ "Region": context.Platform.Region, "Env": context.Platform.Environment, "Issuer": fmt.Sprintf("%s/api/auth", context.Stack.URL()), @@ -225,6 +283,7 @@ func createCaddyfile(context modules.ServiceInstallConfiguration) string { "Redirect": redirect, "EnableAudit": EnableAuditPlugin(context.ReconciliationConfig), "EnableScopes": enableScopes, + "Versions": vs, }); err != nil { panic(err) } @@ -291,6 +350,152 @@ const caddyfile = `(cors) { {{- end }} } +:{{ .Port }} { + tracing { + span gateway + } + log { + output stdout + {{- if .Debug }} + level DEBUG + {{- end }} + } + + {{- if .EnableAudit }} + import audit + {{- end }} + + {{- range $i, $service := .Services }} + {{- if not (eq $service.Name "control") }} + {{- range $i, $path := $service.Paths }} + @{{ $path.Name }}matcher { + path /api/{{ $service.RoutingPath }}{{ $path.Path }}* + {{- if gt ($path.Methods | len) 0 }} + method {{ join $path.Methods " " }} + {{- end }} + } + handle @{{ $path.Name }}matcher { + uri strip_prefix /api/{{ $service.RoutingPath }} + reverse_proxy {{ $service.Hostname }}:{{ $service.Port }} + import cors + {{- if and (not $service.Secured) (not $path.Secured) }} + import auth {{ $service.Module }} + {{- end }} + } + {{- end }} + + @{{ $service.Name }}matcher { + path /api/{{ $service.RoutingPath }}* + {{- if gt ($service.Methods | len) 0 }} + method {{ join $service.Methods " " }} + {{- end }} + } + handle @{{ $service.Name }}matcher { + uri strip_prefix /api/{{ $service.RoutingPath }} + reverse_proxy {{ $service.Hostname }}:{{ $service.Port }} + + import cors + {{- if not $service.Secured }} + import auth {{ $service.Module }} + {{- end }} + } + {{- end }} + {{- end }} + + handle /versions { + versions { + region "{{ .Region }}" + env "{{ .Env }}" + endpoints { + {{- range $i, $version := .Versions }} + {{ $version.ModuleName }} { + {{- range $i, $endpoint := $version.Endpoints }} + {{ $endpoint.VersionEndpoint }} {{ $endpoint.HealthEndpoint }} + {{- end }} + } + {{- end }} + } + } + } + + # Respond 502 if service does not exists + handle /api/* { + respond "Bad Gateway" 502 + } + + # handle all other requests + {{- if not (eq .Fallback "") }} + handle { + {{- if .Redirect }} + redir {{ .Fallback }} + {{- else }} + reverse_proxy {{ .Fallback }} + {{- end }} + import cors + } + {{ end }} +}` + +const deprecatedCaddyfile = `(cors) { + header { + Access-Control-Allow-Methods "GET,OPTIONS,PUT,POST,DELETE,HEAD,PATCH" + Access-Control-Allow-Headers content-type + Access-Control-Max-Age 100 + Access-Control-Allow-Origin * + } +} + +(auth) { + auth { + issuer {{ .Issuer }} + + read_key_set_max_retries 10 + + {{- if .EnableScopes }} + check_scopes yes + service {args[0]} + {{- end }} + } +} +{{- if .EnableAudit }} +(audit) { + audit { + # Kafka publisher + {{- if (eq .Broker "kafka") }} + publisher_kafka_broker {$PUBLISHER_KAFKA_BROKER:redpanda:29092} + publisher_kafka_enabled {$PUBLISHER_KAFKA_ENABLED:false} + publisher_kafka_tls_enabled {$PUBLISHER_KAFKA_TLS_ENABLED:false} + publisher_kafka_sasl_enabled {$PUBLISHER_KAFKA_SASL_ENABLED:false} + publisher_kafka_sasl_username {$PUBLISHER_KAFKA_SASL_USERNAME} + publisher_kafka_sasl_password {$PUBLISHER_KAFKA_SASL_PASSWORD} + publisher_kafka_sasl_mechanism {$PUBLISHER_KAFKA_SASL_MECHANISM} + publisher_kafka_sasl_scram_sha_size {$PUBLISHER_KAFKA_SASL_SCRAM_SHA_SIZE} + {{- end }} + {{- if (eq .Broker "nats") }} + # Nats publisher + publisher_nats_enabled {$PUBLISHER_NATS_ENABLED:true} + publisher_nats_url {$PUBLISHER_NATS_URL:nats://nats:4222} + publisher_nats_client_id {$PUBLISHER_NATS_CLIENT_ID:gateway} + publisher_nats_max_reconnects {$PUBLISHER_NATS_MAX_RECONNECTS:30} + publisher_nats_max_reconnects_wait {$PUBLISHER_NATS_MAX_RECONNECT_WAIT:2s} + {{- end }} + } +} +{{- end }} + +{ + {{ if .Debug }}debug{{ end }} + # Many directives manipulate the HTTP handler chain and the order in which + # those directives are evaluated matters. So the jwtauth directive must be + # ordered. + # c.f. https://caddyserver.com/docs/caddyfile/directives#directive-order + order auth before basicauth + order versions after metrics + {{- if .EnableAudit }} + order audit after encode + {{- end }} +} + :{{ .Port }} { tracing { span gateway diff --git a/ee/gateway/pkg/plugins/versions.go b/ee/gateway/pkg/plugins/versions.go index ce486b3617..d4067c62eb 100644 --- a/ee/gateway/pkg/plugins/versions.go +++ b/ee/gateway/pkg/plugins/versions.go @@ -22,12 +22,16 @@ func init() { httpcaddyfile.RegisterHandlerDirective("versions", parseCaddyfile) } -type Endpoint struct { - Name string `json:"name,omitempty"` +type Service struct { VersionEndpoint string `json:"endpoint,omitempty"` HealthEndpoint string `json:"health,omitempty"` } +type Endpoint struct { + Name string `json:"name,omitempty"` + Services []Service `json:"services,omitempty"` +} + // Versions is a module that serves a /versions endpoint. This endpoint will // gather all sub-services versions and return them in a JSON response. // This module is configurable by end-users via caddy configuration. @@ -85,16 +89,22 @@ func (m *Versions) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { for d.Next() { for d.NextBlock(0) { name := d.Val() - var versionEndpoint string - var healthEndpoint string - fmt.Println("remaining args for endpoints", d.CountRemainingArgs()) - if !d.AllArgs(&versionEndpoint, &healthEndpoint) { - return d.Errf("invalid number of endpoints' arguments: want ") + services := make([]Service, 0) + for d.NextBlock(1) { + versionEndpoint := d.Val() + if !d.NextArg() { + return d.Errf("invalid number of endpoints' arguments: want ") + } + healthEndpoint := d.Val() + services = append(services, Service{ + VersionEndpoint: versionEndpoint, + HealthEndpoint: healthEndpoint, + }) } + m.Endpoints = append(m.Endpoints, Endpoint{ - Name: name, - VersionEndpoint: versionEndpoint, - HealthEndpoint: healthEndpoint, + Name: name, + Services: services, }) } } @@ -119,12 +129,14 @@ func (m *Versions) UnmarshalCaddyfile(d *caddyfile.Dispenser) error { // the module is provisioned. func (v *Versions) Validate() error { for _, endpoint := range v.Endpoints { - if _, err := url.ParseRequestURI(endpoint.VersionEndpoint); err != nil { - return fmt.Errorf("invalid version endpoint %s: %w", endpoint.Name, err) - } + for _, service := range endpoint.Services { + if _, err := url.ParseRequestURI(service.VersionEndpoint); err != nil { + return fmt.Errorf("invalid version endpoint %s: %w", endpoint.Name, err) + } - if _, err := url.ParseRequestURI(endpoint.HealthEndpoint); err != nil { - return fmt.Errorf("invalid health endpoint %s: %w", endpoint.Name, err) + if _, err := url.ParseRequestURI(service.HealthEndpoint); err != nil { + return fmt.Errorf("invalid health endpoint %s: %w", endpoint.Name, err) + } } } @@ -206,24 +218,32 @@ func (v *versionsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { Name: edpt.Name, } - version, err := serviceVersion(ctxGroup, v.httpClient, edpt.VersionEndpoint) - if err != nil { - // Log and Discard the error if there is any, and provide an - // "unknown" version. - v.logger.Error("failed to query version", zap.Error(err)) - res.Version = "unknown" - } else { - res.Version = version - } + for _, service := range edpt.Services { + if res.Version == "" { + version, err := serviceVersion(ctxGroup, v.httpClient, service.VersionEndpoint) + if err != nil { + // Log and Discard the error if there is any, and provide an + // "unknown" version. + v.logger.Error("failed to query version", zap.Error(err)) + res.Version = "unknown" + } else { + res.Version = version + } + } - health, err := serviceHealth(ctxGroup, v.httpClient, edpt.HealthEndpoint) - if err != nil { - // Log and Discard the error if there is any, and provide a - // "false" health. - v.logger.Error("failed to query health", zap.Error(err)) - res.Health = false - } else { - res.Health = health + health, err := serviceHealth(ctxGroup, v.httpClient, service.HealthEndpoint) + if err != nil { + // Log and Discard the error if there is any, and provide a + // "false" health. + v.logger.Error("failed to query health", zap.Error(err)) + res.Health = false + break + } else { + res.Health = health + if !health { + break + } + } } versions <- res