From 2845cd9035ad02e16adf9e13373b903d85041f66 Mon Sep 17 00:00:00 2001 From: Simon Emms Date: Thu, 19 Jan 2023 16:25:10 +0000 Subject: [PATCH] [installer]: refactor message bus config to an external secret Previously, this was defined as a Helm secret inline. Now, this uses the way that the Installer supports by default. --- .../testdata/render/agent-smith/output.golden | 43 ++-- .../testdata/render/aws-setup/output.golden | 43 ++-- .../testdata/render/azure-setup/output.golden | 43 ++-- .../custom-pull-repository/output.golden | 43 ++-- .../render/customization/output.golden | 51 +++-- .../render/external-registry/output.golden | 43 ++-- .../testdata/render/gcp-setup/output.golden | 43 ++-- .../testdata/render/http-proxy/output.golden | 43 ++-- .../testdata/render/kind-meta/output.golden | 43 ++-- .../testdata/render/kind-webapp/output.golden | 43 ++-- .../render/message-bus-password/output.golden | 43 ++-- .../cmd/testdata/render/minimal/output.golden | 43 ++-- .../render/overrides-inline/output.golden | 43 ++-- .../testdata/render/pod-config/output.golden | 43 ++-- .../testdata/render/shortname/output.golden | 43 ++-- .../statefulset-customization/output.golden | 43 ++-- .../testdata/render/telemetry/output.golden | 43 ++-- .../use-pod-security-policies/output.golden | 43 ++-- .../render/vsxproxy-pvc/output.golden | 43 ++-- .../workspace-requests-limits/output.golden | 43 ++-- install/installer/example-config.yaml | 51 +---- .../pkg/components/rabbitmq/configuration.go | 189 ++++++++++++++++++ .../pkg/components/rabbitmq/constants.go | 9 +- .../installer/pkg/components/rabbitmq/helm.go | 163 +-------------- .../pkg/components/rabbitmq/objects.go | 1 + 25 files changed, 656 insertions(+), 625 deletions(-) create mode 100644 install/installer/pkg/components/rabbitmq/configuration.go diff --git a/install/installer/cmd/testdata/render/agent-smith/output.golden b/install/installer/cmd/testdata/render/agent-smith/output.golden index 795367866e6739..a7553c55bea596 100644 --- a/install/installer/cmd/testdata/render/agent-smith/output.golden +++ b/install/installer/cmd/testdata/render/agent-smith/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2801,6 +2801,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3852,18 +3865,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8760,7 +8761,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/aws-setup/output.golden b/install/installer/cmd/testdata/render/aws-setup/output.golden index b9de3a529adc91..a1bdf4e5534de3 100644 --- a/install/installer/cmd/testdata/render/aws-setup/output.golden +++ b/install/installer/cmd/testdata/render/aws-setup/output.golden @@ -1071,18 +1071,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2418,6 +2418,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3297,18 +3310,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -7938,7 +7939,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/azure-setup/output.golden b/install/installer/cmd/testdata/render/azure-setup/output.golden index 281c279c8e996c..55c6700d4f6790 100644 --- a/install/installer/cmd/testdata/render/azure-setup/output.golden +++ b/install/installer/cmd/testdata/render/azure-setup/output.golden @@ -1087,18 +1087,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2436,6 +2436,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3363,18 +3376,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8017,7 +8018,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/custom-pull-repository/output.golden b/install/installer/cmd/testdata/render/custom-pull-repository/output.golden index fc95946a33704d..ea956a9e159033 100644 --- a/install/installer/cmd/testdata/render/custom-pull-repository/output.golden +++ b/install/installer/cmd/testdata/render/custom-pull-repository/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2619,6 +2619,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3670,18 +3683,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8578,7 +8579,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/customization/output.golden b/install/installer/cmd/testdata/render/customization/output.golden index 720d835045cd3f..fcce8d3d2caa27 100644 --- a/install/installer/cmd/testdata/render/customization/output.golden +++ b/install/installer/cmd/testdata/render/customization/output.golden @@ -1274,18 +1274,22 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + gitpod.io: hello + hello: world + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + gitpod.io: hello + hello: world + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2986,6 +2990,23 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + gitpod.io: hello + hello: world + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + gitpod.io: hello + hello: world + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -4213,18 +4234,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -9320,7 +9329,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/external-registry/output.golden b/install/installer/cmd/testdata/render/external-registry/output.golden index e33f6479098b13..f1ff3e079b226d 100644 --- a/install/installer/cmd/testdata/render/external-registry/output.golden +++ b/install/installer/cmd/testdata/render/external-registry/output.golden @@ -1101,18 +1101,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2513,6 +2513,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3504,18 +3517,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8298,7 +8299,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/gcp-setup/output.golden b/install/installer/cmd/testdata/render/gcp-setup/output.golden index 348908160c8c08..d95594d050ad7e 100644 --- a/install/installer/cmd/testdata/render/gcp-setup/output.golden +++ b/install/installer/cmd/testdata/render/gcp-setup/output.golden @@ -1083,18 +1083,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2455,6 +2455,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3334,18 +3347,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -7997,7 +7998,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/http-proxy/output.golden b/install/installer/cmd/testdata/render/http-proxy/output.golden index 01b5252467a716..0b7a9c6835027e 100644 --- a/install/installer/cmd/testdata/render/http-proxy/output.golden +++ b/install/installer/cmd/testdata/render/http-proxy/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2622,6 +2622,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3673,18 +3686,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8942,7 +8943,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/kind-meta/output.golden b/install/installer/cmd/testdata/render/kind-meta/output.golden index 62ffc0b520eca5..8ff486d7c3c3f1 100644 --- a/install/installer/cmd/testdata/render/kind-meta/output.golden +++ b/install/installer/cmd/testdata/render/kind-meta/output.golden @@ -727,18 +727,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2166,6 +2166,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -2641,18 +2654,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -5914,7 +5915,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/kind-webapp/output.golden b/install/installer/cmd/testdata/render/kind-webapp/output.golden index 8cb3db3ad7e313..90a76861ee1e47 100644 --- a/install/installer/cmd/testdata/render/kind-webapp/output.golden +++ b/install/installer/cmd/testdata/render/kind-webapp/output.golden @@ -560,18 +560,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -1541,6 +1541,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -2016,18 +2029,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -3460,7 +3461,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/message-bus-password/output.golden b/install/installer/cmd/testdata/render/message-bus-password/output.golden index e1fb59f4730387..1c11ab5c3c7b35 100644 --- a/install/installer/cmd/testdata/render/message-bus-password/output.golden +++ b/install/installer/cmd/testdata/render/message-bus-password/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"pa55w0rd","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2619,6 +2619,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3670,18 +3683,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8578,7 +8579,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 13acae0a79ce44940618fa2f76973e83105ca20eb6b1d3897d41bfc5626db0ad + checksum/secret: dd098623098ad6639ae4183b8ecc18b229d97d0f9738070a30685434fd54a16d prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/minimal/output.golden b/install/installer/cmd/testdata/render/minimal/output.golden index ef5d72466ab17f..888138689a6233 100644 --- a/install/installer/cmd/testdata/render/minimal/output.golden +++ b/install/installer/cmd/testdata/render/minimal/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2619,6 +2619,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3670,18 +3683,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8578,7 +8579,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/overrides-inline/output.golden b/install/installer/cmd/testdata/render/overrides-inline/output.golden index e19482cc103039..c6710ec1813c83 100644 --- a/install/installer/cmd/testdata/render/overrides-inline/output.golden +++ b/install/installer/cmd/testdata/render/overrides-inline/output.golden @@ -1152,18 +1152,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2617,6 +2617,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3668,18 +3681,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8588,7 +8589,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/pod-config/output.golden b/install/installer/cmd/testdata/render/pod-config/output.golden index d248a625c373a3..5ddc1649a4de48 100644 --- a/install/installer/cmd/testdata/render/pod-config/output.golden +++ b/install/installer/cmd/testdata/render/pod-config/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2625,6 +2625,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3676,18 +3689,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8584,7 +8585,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/shortname/output.golden b/install/installer/cmd/testdata/render/shortname/output.golden index 63ddd7bb145f84..af5c7da59106af 100644 --- a/install/installer/cmd/testdata/render/shortname/output.golden +++ b/install/installer/cmd/testdata/render/shortname/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2619,6 +2619,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3670,18 +3683,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8578,7 +8579,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/statefulset-customization/output.golden b/install/installer/cmd/testdata/render/statefulset-customization/output.golden index 2fa2bee09a8393..ab31f6d52c8f11 100644 --- a/install/installer/cmd/testdata/render/statefulset-customization/output.golden +++ b/install/installer/cmd/testdata/render/statefulset-customization/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2631,6 +2631,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3682,18 +3695,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8590,7 +8591,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/telemetry/output.golden b/install/installer/cmd/testdata/render/telemetry/output.golden index ae28f682774990..0dc3edfd2e3649 100644 --- a/install/installer/cmd/testdata/render/telemetry/output.golden +++ b/install/installer/cmd/testdata/render/telemetry/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2622,6 +2622,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3673,18 +3686,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8581,7 +8582,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden b/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden index 379c5f9702108c..14146eee73b337 100644 --- a/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden +++ b/install/installer/cmd/testdata/render/use-pod-security-policies/output.golden @@ -1376,18 +1376,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2907,6 +2907,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -4003,18 +4016,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -9022,7 +9023,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden b/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden index a72e41727ab766..82e41d1996a62e 100644 --- a/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden +++ b/install/installer/cmd/testdata/render/vsxproxy-pvc/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2621,6 +2621,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3672,18 +3685,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8580,7 +8581,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden b/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden index 347e0b141e7a2e..f85660aaa5454b 100644 --- a/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden +++ b/install/installer/cmd/testdata/render/workspace-requests-limits/output.golden @@ -1154,18 +1154,18 @@ metadata: namespace: default --- # v1/Secret load-definition -# Source: rabbitmq/charts/rabbitmq/templates/secrets.yaml apiVersion: v1 kind: Secret metadata: - name: load-definition - namespace: "default" + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null labels: - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm -type: Opaque + app: gitpod + component: rabbitmq + name: load-definition + namespace: default stringData: load_definition.json: '{"users":[{"name":"gitpod","password":"uq4KxOLtrA-QsDTfuwQ-","tags":"administrator"}],"vhosts":[{"name":"/"}],"parameters":[],"permissions":[{"user":"gitpod","vhost":"/","configure":".*","write":".*","read":".*"}],"exchanges":[{"name":"gitpod.ws.local","vhost":"/","type":"topic","durable":true,"auto_delete":false},{"name":"consensus-leader","vhost":"/","type":"fanout","durable":false,"auto_delete":false}],"bindings":[],"queues":[{"name":"consensus-peers","vhost":"/","durable":false,"auto_delete":false,"arguments":{}},{"name":"pwsupdatable","vhost":"/","durable":true,"auto_delete":false,"arguments":{}}],"policies":[{"name":"ha-all","vhost":"/","pattern":".*","definition":{"ha-mode":"all","ha-sync-mode":"automatic","ha-sync-batch-size":5}}]}' --- @@ -2622,6 +2622,19 @@ data: name: proxy namespace: default --- + apiVersion: v1 + kind: Secret + metadata: + annotations: + app: gitpod + component: rabbitmq + creationTimestamp: null + labels: + app: gitpod + component: rabbitmq + name: load-definition + namespace: default + --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -3673,18 +3686,6 @@ data: --- apiVersion: v1 kind: Secret - metadata: - creationTimestamp: null - labels: - app.kubernetes.io/instance: rabbitmq - app.kubernetes.io/managed-by: Helm - app.kubernetes.io/name: rabbitmq - helm.sh/chart: rabbitmq-11.3.0 - name: load-definition - namespace: default - --- - apiVersion: v1 - kind: Secret metadata: creationTimestamp: null labels: @@ -8581,7 +8582,7 @@ spec: app.kubernetes.io/managed-by: Helm annotations: checksum/config: d5780a0c58210a2062d54feb61cfb1d5a9c076f95569c4a77076d22c9bad4190 - checksum/secret: 64c39dd3a8570ed4b0cc71bc0402bc814d016e16f68732938722b12a57c8e82c + checksum/secret: 0c5ed3a73e2728985045cd533abdf26650f646db342fda457a4a1e60e899f2b9 prometheus.io/port: '9419' prometheus.io/scrape: "true" spec: diff --git a/install/installer/example-config.yaml b/install/installer/example-config.yaml index 54d1534fd28594..e2e769523f2675 100644 --- a/install/installer/example-config.yaml +++ b/install/installer/example-config.yaml @@ -1,47 +1,14 @@ apiVersion: v1 -authProviders: [] -blockNewUsers: - enabled: false - passlist: [] -certificate: - kind: secret - name: https-certificates -containerRegistry: - inCluster: true - privateBaseImageAllowList: [] -database: - inCluster: true -disableDefinitelyGp: true -domain: "" kind: Full -metadata: - region: local - shortname: default -objectStorage: - inCluster: true - resources: - requests: - memory: 2Gi -observability: - logLevel: info -openVSX: - url: https://open-vsx.org -repository: eu.gcr.io/gitpod-core-dev/build +domain: k3s.gitpod.simonemms.com +authProviders: + - kind: secret + name: public-github workspace: - maxLifetime: 36h0m0s - prebuildPVC: - size: 30Gi - snapshotClass: "" - storageClass: "" - pvc: - size: 30Gi - snapshotClass: "" - storageClass: "" - resources: - requests: - cpu: "1" - memory: 2Gi runtime: - containerdRuntimeDir: /var/lib/containerd/io.containerd.runtime.v2.task/k8s.io - containerdSocket: /run/containerd/containerd.sock + containerdRuntimeDir: /run/k3s/containerd/io.containerd.runtime.v2.task/k8s.io + containerdSocket: /run/k3s/containerd/containerd.sock fsShiftMethod: fuse +# experimental: +# common: +# staticMessagebusPassword: q1w2e3r4 diff --git a/install/installer/pkg/components/rabbitmq/configuration.go b/install/installer/pkg/components/rabbitmq/configuration.go new file mode 100644 index 00000000000000..fe55954541c524 --- /dev/null +++ b/install/installer/pkg/components/rabbitmq/configuration.go @@ -0,0 +1,189 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +package rabbitmq + +import ( + "encoding/json" + "fmt" + + "github.com/gitpod-io/gitpod/installer/pkg/common" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) + +type parameterValues struct { + AckMode string `json:"ack-mode"` + SrcDeleteAfter string `json:"src-delete-after"` + SrcExchange string `json:"src-exchange"` + SrcExchangeKey string `json:"src-exchange-key"` + SrcProtocol string `json:"src-protocol"` + SrcUri string `json:"src-uri"` + DestAddForwardHeaders string `json:"dest-add-forward-headers"` + DestExchange string `json:"dest-exchange"` + DestProtocol string `json:"dest-protocol"` + DestUri string `json:"dest-uri"` + ReconnectDelay int `json:"reconnect-delay"` +} + +type parameter struct { + Name string `json:"name"` + Vhost string `json:"vhost"` + Component string `json:"component"` + Values parameterValues `json:"value"` +} + +type exchange struct { + Name string `json:"name"` + Vhost string `json:"vhost"` + Type string `json:"type"` + Durable bool `json:"durable"` + AutoDelete bool `json:"auto_delete"` +} + +type permission struct { + User string `json:"user"` + Vhost string `json:"vhost"` + Configure string `json:"configure"` + Write string `json:"write"` + Read string `json:"read"` +} + +type user struct { + Name string `json:"name"` + Password string `json:"password"` + Tags string `json:"tags"` +} + +type vhost struct { + Name string `json:"name"` +} + +type arguments struct{} + +type binding struct { + Source string `json:"source"` + Vhost string `json:"vhost"` + Destination string `json:"destination"` + DestinationType string `json:"destination_type"` + RoutingKey string `json:"routing_key"` + Arguments arguments `json:"arguments"` +} + +type queue struct { + Name string `json:"name"` + Vhost string `json:"vhost"` + Durable bool `json:"durable"` + AutoDelete bool `json:"auto_delete"` + Arguments arguments `json:"arguments"` +} + +type policyDefinition struct { + HAMode string `json:"ha-mode"` + HASyncMode string `json:"ha-sync-mode"` + HASyncBatchSize int `json:"ha-sync-batch-size"` +} + +type policy struct { + Name string `json:"name"` + Vhost string `json:"vhost"` + Pattern string `json:"pattern"` + Definition policyDefinition `json:"definition"` +} + +type config struct { + Users []user `json:"users"` + Vhosts []vhost `json:"vhosts"` + Parameters []parameter `json:"parameters"` + Permissions []permission `json:"permissions"` + Exchanges []exchange `json:"exchanges"` + Bindings []binding `json:"bindings"` + Queues []queue `json:"queues"` + Policies []policy `json:"policies"` +} + +func configuration(ctx *common.RenderContext) ([]runtime.Object, error) { + password := ctx.Values.MessageBusPassword + + scfg := config{ + Users: []user{{ + Name: rabbitMQUsername, + Password: password, + Tags: "administrator", + }}, + Vhosts: []vhost{{Name: "/"}}, + Parameters: []parameter{}, + Permissions: []permission{{ + User: rabbitMQUsername, + Vhost: "/", + Configure: ".*", + Write: ".*", + Read: ".*", + }}, + Exchanges: []exchange{{ + Name: "gitpod.ws.local", + Vhost: "/", + Type: "topic", + Durable: true, + AutoDelete: false, + }, { + Name: "consensus-leader", + Vhost: "/", + Type: "fanout", + Durable: false, + AutoDelete: false, + }}, + Bindings: []binding{}, + Queues: []queue{{ + Name: "consensus-peers", + Vhost: "/", + Durable: false, + AutoDelete: false, + Arguments: arguments{}, + }, { + Name: "pwsupdatable", + Vhost: "/", + Durable: true, + AutoDelete: false, + Arguments: arguments{}, + }}, + Policies: []policy{{ + Name: "ha-all", + Vhost: "/", + Pattern: ".*", + Definition: policyDefinition{ + HAMode: "all", + HASyncMode: "automatic", + HASyncBatchSize: 5, + }, + }}, + } + + fc, err := json.Marshal(scfg) + if err != nil { + return nil, fmt.Errorf("failed to marshal messagebus config: %w", err) + } + + secretName := "load-definition" + + return []runtime.Object{ + &corev1.Secret{ + TypeMeta: common.TypeMetaSecret, + ObjectMeta: metav1.ObjectMeta{ + Name: secretName, + Namespace: ctx.Namespace, + Labels: common.CustomizeLabel(ctx, secretName, common.TypeMetaSecret, func() map[string]string { + return common.DefaultLabels(Component) + }), + Annotations: common.CustomizeAnnotation(ctx, secretName, common.TypeMetaSecret, func() map[string]string { + return common.DefaultLabels(Component) + }), + }, + StringData: map[string]string{ + "load_definition.json": string(fc), + }, + }, + }, nil +} diff --git a/install/installer/pkg/components/rabbitmq/constants.go b/install/installer/pkg/components/rabbitmq/constants.go index 966cc4d1a724e2..292915be06870d 100644 --- a/install/installer/pkg/components/rabbitmq/constants.go +++ b/install/installer/pkg/components/rabbitmq/constants.go @@ -9,8 +9,9 @@ import ( ) const ( - Component = "rabbitmq" - CookieSecret = "messagebus-erlang-cookie" - InClusterDbSecret = common.InClusterMessageQueueName - TLSSecret = common.InClusterMessageQueueTLS + Component = "rabbitmq" + CookieSecret = "messagebus-erlang-cookie" + InClusterMsgBusSecret = common.InClusterMessageQueueName + TLSSecret = common.InClusterMessageQueueTLS + rabbitMQUsername = "gitpod" ) diff --git a/install/installer/pkg/components/rabbitmq/helm.go b/install/installer/pkg/components/rabbitmq/helm.go index d173aff7bfaaf4..cfe7d6d5b145f2 100644 --- a/install/installer/pkg/components/rabbitmq/helm.go +++ b/install/installer/pkg/components/rabbitmq/helm.go @@ -5,7 +5,6 @@ package rabbitmq import ( - "encoding/json" "fmt" "helm.sh/helm/v3/pkg/cli/values" @@ -16,164 +15,10 @@ import ( "github.com/gitpod-io/gitpod/installer/third_party/charts" ) -type parameterValues struct { - AckMode string `json:"ack-mode"` - SrcDeleteAfter string `json:"src-delete-after"` - SrcExchange string `json:"src-exchange"` - SrcExchangeKey string `json:"src-exchange-key"` - SrcProtocol string `json:"src-protocol"` - SrcUri string `json:"src-uri"` - DestAddForwardHeaders string `json:"dest-add-forward-headers"` - DestExchange string `json:"dest-exchange"` - DestProtocol string `json:"dest-protocol"` - DestUri string `json:"dest-uri"` - ReconnectDelay int `json:"reconnect-delay"` -} - -type parameter struct { - Name string `json:"name"` - Vhost string `json:"vhost"` - Component string `json:"component"` - Values parameterValues `json:"value"` -} - -type exchange struct { - Name string `json:"name"` - Vhost string `json:"vhost"` - Type string `json:"type"` - Durable bool `json:"durable"` - AutoDelete bool `json:"auto_delete"` -} - -type permission struct { - User string `json:"user"` - Vhost string `json:"vhost"` - Configure string `json:"configure"` - Write string `json:"write"` - Read string `json:"read"` -} - -type user struct { - Name string `json:"name"` - Password string `json:"password"` - Tags string `json:"tags"` -} - -type vhost struct { - Name string `json:"name"` -} - -type arguments struct{} - -type binding struct { - Source string `json:"source"` - Vhost string `json:"vhost"` - Destination string `json:"destination"` - DestinationType string `json:"destination_type"` - RoutingKey string `json:"routing_key"` - Arguments arguments `json:"arguments"` -} - -type queue struct { - Name string `json:"name"` - Vhost string `json:"vhost"` - Durable bool `json:"durable"` - AutoDelete bool `json:"auto_delete"` - Arguments arguments `json:"arguments"` -} - -type policyDefinition struct { - HAMode string `json:"ha-mode"` - HASyncMode string `json:"ha-sync-mode"` - HASyncBatchSize int `json:"ha-sync-batch-size"` -} - -type policy struct { - Name string `json:"name"` - Vhost string `json:"vhost"` - Pattern string `json:"pattern"` - Definition policyDefinition `json:"definition"` -} - -type config struct { - Users []user `json:"users"` - Vhosts []vhost `json:"vhosts"` - Parameters []parameter `json:"parameters"` - Permissions []permission `json:"permissions"` - Exchanges []exchange `json:"exchanges"` - Bindings []binding `json:"bindings"` - Queues []queue `json:"queues"` - Policies []policy `json:"policies"` -} - var Helm = common.CompositeHelmFunc( helm.ImportTemplate(charts.RabbitMQ(), helm.TemplateConfig{}, func(cfg *common.RenderContext) (*common.HelmConfig, error) { - username := "gitpod" - password := cfg.Values.MessageBusPassword - loadDefinition, err := json.Marshal(config{ - Users: []user{{ - Name: username, - Password: password, - Tags: "administrator", - }}, - Vhosts: []vhost{{Name: "/"}}, - Parameters: []parameter{}, - Permissions: []permission{{ - User: username, - Vhost: "/", - Configure: ".*", - Write: ".*", - Read: ".*", - }}, - Exchanges: []exchange{{ - Name: "gitpod.ws.local", - Vhost: "/", - Type: "topic", - Durable: true, - AutoDelete: false, - }, { - Name: "consensus-leader", - Vhost: "/", - Type: "fanout", - Durable: false, - AutoDelete: false, - }}, - Bindings: []binding{}, - Queues: []queue{{ - Name: "consensus-peers", - Vhost: "/", - Durable: false, - AutoDelete: false, - Arguments: arguments{}, - }, { - Name: "pwsupdatable", - Vhost: "/", - Durable: true, - AutoDelete: false, - Arguments: arguments{}, - }}, - Policies: []policy{{ - Name: "ha-all", - Vhost: "/", - Pattern: ".*", - Definition: policyDefinition{ - HAMode: "all", - HASyncMode: "automatic", - HASyncBatchSize: 5, - }, - }}, - }) - if err != nil { - return nil, err - } - - loadDefinitionFilename, err := helm.KeyFileValue("rabbitmq.extraSecrets.load-definition.load_definition\\.json", loadDefinition) - if err != nil { - return nil, err - } - affinity, err := helm.AffinityYaml(cluster.AffinityLabelMeta) if err != nil { return nil, err @@ -190,13 +35,13 @@ var Helm = common.CompositeHelmFunc( Enabled: true, Values: &values.Options{ Values: []string{ - helm.KeyValue("rabbitmq.auth.username", username), + helm.KeyValue("rabbitmq.auth.username", rabbitMQUsername), helm.KeyValue("rabbitmq.auth.password", password), helm.KeyValue("rabbitmq.auth.existingErlangSecret", CookieSecret), helm.KeyValue("rabbitmq.auth.tls.existingSecret", TLSSecret), helm.KeyValue("rabbitmq.serviceAccount.name", Component), - helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.username", InClusterDbSecret), username), - helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.password", InClusterDbSecret), password), + helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.username", InClusterMsgBusSecret), rabbitMQUsername), + helm.KeyValue(fmt.Sprintf("rabbitmq.extraSecrets.%s.password", InClusterMsgBusSecret), password), helm.ImagePullSecrets("rabbitmq.image.pullSecrets", cfg), helm.KeyValue("rabbitmq.image.registry", imageRegistry), helm.ImagePullSecrets("volumePermissions.image.pullSecrets", cfg), @@ -207,7 +52,7 @@ var Helm = common.CompositeHelmFunc( // This is too complex to be sent as a string FileValues: []string{ affinityTemplate, - loadDefinitionFilename, + // loadDefinitionFilename, }, }, }, nil diff --git a/install/installer/pkg/components/rabbitmq/objects.go b/install/installer/pkg/components/rabbitmq/objects.go index 3be8b780d4e8aa..0b4832b8439b4c 100644 --- a/install/installer/pkg/components/rabbitmq/objects.go +++ b/install/installer/pkg/components/rabbitmq/objects.go @@ -7,6 +7,7 @@ package rabbitmq import "github.com/gitpod-io/gitpod/installer/pkg/common" var Objects = common.CompositeRenderFunc( + configuration, rolebinding, secrets, )