diff --git a/argocd/uex/dev/ra/fap-results-letters-exchange-secret/app.yaml b/argocd/uex/dev/ra/fap-results-letters-exchange-secret/app.yaml new file mode 100644 index 00000000..91f10bc2 --- /dev/null +++ b/argocd/uex/dev/ra/fap-results-letters-exchange-secret/app.yaml @@ -0,0 +1,35 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: frl-exchange-secret + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - list: + elements: + # Names of clusters to deploy the app to + - name: dev-v3 + # Uncomment if you want to deploy to dev-microk8s-alternative + #- name: dev-microk8s-alternative + template: + metadata: + name: '{{.name}}-frl-exchange-secret' + annotations: + argocd.argoproj.io/sync-wave: "0" + spec: + project: r-a-project + source: + path: components/ra/fap-results-letters-exchange-secret + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: main + helm: + valueFiles: + - values-dev.yaml + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true \ No newline at end of file diff --git a/argocd/uex/dev/ra/fap-results-letters-exchange-topology/app.yaml b/argocd/uex/dev/ra/fap-results-letters-exchange-topology/app.yaml new file mode 100644 index 00000000..596b76c4 --- /dev/null +++ b/argocd/uex/dev/ra/fap-results-letters-exchange-topology/app.yaml @@ -0,0 +1,38 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: frl-exchange-topology + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - list: + elements: + # Names of clusters to deploy the app to + - name: dev-v3 + # Uncomment if you want to deploy to dev-microk8s-alternative + #- name: dev-microk8s-alternative + template: + metadata: + name: '{{.name}}-frl-exchange-topology' + annotations: + argocd.argoproj.io/sync-wave: "0" + spec: + project: r-a-project + source: + path: components/ra/fap-results-letters-exchange-topology + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: add-uop-specific-rabbitmq-definitions + helm: + valueFiles: + - ../../shared/message-broker/rmq-message-broker-chart/values.yaml + - ../../shared/message-broker-admin/message-broker-admin-chart/values-dev.yaml + - values-dev.yaml + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true + enabled: true \ No newline at end of file diff --git a/argocd/uex/dev/shared/message-broker/app.yaml b/argocd/uex/dev/shared/message-broker/app.yaml index bef35583..7ef16aae 100644 --- a/argocd/uex/dev/shared/message-broker/app.yaml +++ b/argocd/uex/dev/shared/message-broker/app.yaml @@ -27,6 +27,7 @@ spec: helm: valueFiles: - values.yaml + - values-httpRoute.yaml destination: namespace: apps name: '{{.name}}' diff --git a/argocd/uex/dev/submissions/uop-exchange-secret/app.yaml b/argocd/uex/dev/submissions/uop-exchange-secret/app.yaml new file mode 100644 index 00000000..a4adc252 --- /dev/null +++ b/argocd/uex/dev/submissions/uop-exchange-secret/app.yaml @@ -0,0 +1,35 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: uop-exchange-secret + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - list: + elements: + # Names of clusters to deploy the app to + - name: dev-v3 + # Uncomment if you want to deploy to dev-microk8s-alternative + #- name: dev-microk8s-alternative + template: + metadata: + name: '{{.name}}-uop-exchange-secret' + annotations: + argocd.argoproj.io/sync-wave: "0" + spec: + project: submissions-project + source: + path: components/submissions/uop-exchange-secret + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: main + helm: + valueFiles: + - values-dev.yaml + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true \ No newline at end of file diff --git a/argocd/uex/dev/submissions/uop-exchange-topology/app.yaml b/argocd/uex/dev/submissions/uop-exchange-topology/app.yaml new file mode 100644 index 00000000..37f88d48 --- /dev/null +++ b/argocd/uex/dev/submissions/uop-exchange-topology/app.yaml @@ -0,0 +1,38 @@ +apiVersion: argoproj.io/v1alpha1 +kind: ApplicationSet +metadata: + name: uop-exchange-topology + namespace: argocd +spec: + goTemplate: true + goTemplateOptions: ["missingkey=error"] + generators: + - list: + elements: + # Names of clusters to deploy the app to + - name: dev-v3 + # Uncomment if you want to deploy to dev-microk8s-alternative + #- name: dev-microk8s-alternative + template: + metadata: + name: '{{.name}}-uop-exchange-topology' + annotations: + argocd.argoproj.io/sync-wave: "0" + spec: + project: submissions-project + source: + path: components/submissions/uop-exchange-topology + repoURL: 'https://github.com/isisbusapps/gitops' + targetRevision: main + helm: + valueFiles: + - ../../shared/message-broker/rmq-message-broker-chart/values.yaml + - ../../shared/message-broker-admin/message-broker-admin-chart/values-dev.yaml + - values-dev.yaml + destination: + namespace: apps + name: '{{.name}}' + syncPolicy: + automated: + selfHeal: true + enabled: true \ No newline at end of file diff --git a/argocd/uex/prod/shared/message-broker/app.yaml b/argocd/uex/prod/shared/message-broker/app.yaml index b387a192..611ce5e1 100644 --- a/argocd/uex/prod/shared/message-broker/app.yaml +++ b/argocd/uex/prod/shared/message-broker/app.yaml @@ -27,6 +27,7 @@ spec: helm: valueFiles: - values.yaml + - values-httpRoute.yaml destination: namespace: apps name: '{{.name}}' diff --git a/components/ra/fap-results-letters-exchange-secret/.helmignore b/components/ra/fap-results-letters-exchange-secret/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-secret/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/components/ra/fap-results-letters-exchange-secret/Chart.yaml b/components/ra/fap-results-letters-exchange-secret/Chart.yaml new file mode 100644 index 00000000..1f069ef2 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-secret/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: frl-exchange-secret-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.2.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.2.0" diff --git a/components/ra/fap-results-letters-exchange-secret/templates/frl-exchange-static-secret.yaml b/components/ra/fap-results-letters-exchange-secret/templates/frl-exchange-static-secret.yaml new file mode 100644 index 00000000..cb303c80 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-secret/templates/frl-exchange-static-secret.yaml @@ -0,0 +1,22 @@ +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: frl-exchange-secret + namespace: apps +spec: + type: kv-v2 + refreshAfter: 30s + vaultAuthRef: static-auth + mount: reviews_and_allocations + path: {{ $.Values.env }}/rabbitmq/ + destination: + name: frl-exchange-secret + overwrite: true + create: true + transformation: + templates: + username: + text: "{{`{{ get .Secrets \"username\" }}`}}" + password: + text: "{{`{{ get .Secrets \"password\" }}`}}" + diff --git a/components/ra/fap-results-letters-exchange-secret/values-dev.yaml b/components/ra/fap-results-letters-exchange-secret/values-dev.yaml new file mode 100644 index 00000000..4a067a0b --- /dev/null +++ b/components/ra/fap-results-letters-exchange-secret/values-dev.yaml @@ -0,0 +1 @@ +env: dev \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-secret/values-prod.yaml b/components/ra/fap-results-letters-exchange-secret/values-prod.yaml new file mode 100644 index 00000000..46b998ba --- /dev/null +++ b/components/ra/fap-results-letters-exchange-secret/values-prod.yaml @@ -0,0 +1 @@ +env: prod \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/.helmignore b/components/ra/fap-results-letters-exchange-topology/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/components/ra/fap-results-letters-exchange-topology/Chart.yaml b/components/ra/fap-results-letters-exchange-topology/Chart.yaml new file mode 100644 index 00000000..5b20bd44 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: frl-exchange-topology-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-bindings.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-bindings.yaml new file mode 100644 index 00000000..fdba1f52 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-bindings.yaml @@ -0,0 +1,16 @@ +{{- range .Values.binding }} +apiVersion: rabbitmq.com/v1beta1 +kind: Binding +metadata: + name: {{ .name | lower | replace "_" "-" }}-binding + namespace: {{ $.Values.namespace }} +spec: + vhost: {{ $.Values.frl_exchange_vhost}} + routingKey: {{ index . "routing_key" }} + source: {{ .source }} + destination: {{ .destination }} + destinationType: {{ index . "destination_type" | default "queue"}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{ end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-exchanges.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-exchanges.yaml new file mode 100644 index 00000000..6a2be14e --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-exchanges.yaml @@ -0,0 +1,17 @@ +{{- range .Values.exchange}} +apiVersion: rabbitmq.com/v1beta1 +kind: Exchange +metadata: + name: {{ .name | lower | replace "_" "-"}}-exchange + namespace: {{ $.Values.namespace }} +spec: + name: {{ .name }} + autoDelete: {{ index . "auto-delete" | default "false" }} + durable: {{ .durable | default "true" }} + type: {{ .type | default "direct"}} + vhost: {{ $.Values.frl_exchange_vhost}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain +--- +{{ end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-queues.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-queues.yaml new file mode 100644 index 00000000..2d1a0d08 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-queues.yaml @@ -0,0 +1,17 @@ +{{- range .Values.queue}} +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: {{ .name }} + namespace: {{ $.Values.namespace }} +spec: + name: {{ .name }} + autoDelete: {{ index . "auto-delete" | default "false" }} + durable: {{ .durable | default "true" }} + type: quorum + vhost: {{ $.Values.frl_exchange_vhost}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain +--- +{{ end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-permissions.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-permissions.yaml new file mode 100644 index 00000000..5b47f0f4 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-permissions.yaml @@ -0,0 +1,17 @@ +{{- range $user, $config := .Values.users }} +apiVersion: rabbitmq.com/v1beta1 +kind: Permission +metadata: + name: {{ $user }}-permission + namespace: {{ $.Values.namespace | default "apps" }} +spec: + vhost: {{ $.Values.frl_exchange_vhost }} + user: {{ $user }} + permissions: + configure: {{ $config.permissions.configure | default "(?!)" }} + write: {{ $config.permissions.write | default "(?!)" }} + read: {{ $config.permissions.read | default "(?!)" }} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{- end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-topic-permissions.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-topic-permissions.yaml new file mode 100644 index 00000000..abc99ecd --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user-topic-permissions.yaml @@ -0,0 +1,17 @@ +{{- range $user, $config := .Values.users }} +apiVersion: rabbitmq.com/v1beta1 +kind: TopicPermission +metadata: + name: {{ $user }}-topic-permission + namespace: {{ $.Values.namespace | default "apps" }} +spec: + vhost: {{ $.Values.frl_exchange_vhost }} + user: {{ $user }} + permissions: + exchange: {{ $config.topicPermissions.exchange | quote }} + write: {{ $config.topicPermissions.write | default "(?!)" }} + read: {{ $config.topicPermissions.read | default "(?!)" }} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{- end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user.yaml new file mode 100644 index 00000000..145f5240 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-user.yaml @@ -0,0 +1,19 @@ +{{- range $user, $config := .Values.users }} +apiVersion: rabbitmq.com/v1beta1 +kind: User +metadata: + name: {{ $user }} + namespace: {{ $.Values.namespace }} +spec: + {{- if $config.tags }} + tags: + {{- range $config.tags }} + - {{ . }} + {{- end }} + {{- end }} + importCredentialsSecret: + name: frl-exchange-secret + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{- end }} \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-vhost.yaml b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-vhost.yaml new file mode 100644 index 00000000..9b884fc0 --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/templates/fap-results-letters-vhost.yaml @@ -0,0 +1,14 @@ +apiVersion: rabbitmq.com/v1beta1 +kind: Vhost +metadata: + name: {{ $.Values.frl_exchange_vhost }} + namespace: {{ $.Values.namespace }} + annotations: + argocd.argoproj.io/sync-wave: "-2" +spec: + name: {{ $.Values.frl_exchange_vhost }} + defaultQueueType: quorum # quorum | classic | stream + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain + \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/values-dev.yaml b/components/ra/fap-results-letters-exchange-topology/values-dev.yaml new file mode 100644 index 00000000..665cdaaa --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/values-dev.yaml @@ -0,0 +1,28 @@ + +frl_exchange_vhost: fap-results-letters + +users: + fap-results-letters-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + topicPermissions: + exchange: + write: .* + read: .* + +exchange: + - name: fap-results-letters.fanout + type: fanout + +queue: + - name: fap-results-letters + +binding: +- name: fap-results-letters + source: fap-results-letters.fanout + destination: fap-results-letters + destination_type: queue \ No newline at end of file diff --git a/components/ra/fap-results-letters-exchange-topology/values-prod.yaml b/components/ra/fap-results-letters-exchange-topology/values-prod.yaml new file mode 100644 index 00000000..665cdaaa --- /dev/null +++ b/components/ra/fap-results-letters-exchange-topology/values-prod.yaml @@ -0,0 +1,28 @@ + +frl_exchange_vhost: fap-results-letters + +users: + fap-results-letters-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + topicPermissions: + exchange: + write: .* + read: .* + +exchange: + - name: fap-results-letters.fanout + type: fanout + +queue: + - name: fap-results-letters + +binding: +- name: fap-results-letters + source: fap-results-letters.fanout + destination: fap-results-letters + destination_type: queue \ No newline at end of file diff --git a/components/shared/message-broker/rmq-message-broker-chart/templates/httpRoute.yaml b/components/shared/message-broker/rmq-message-broker-chart/templates/httpRoute.yaml new file mode 100644 index 00000000..1ba6a1bc --- /dev/null +++ b/components/shared/message-broker/rmq-message-broker-chart/templates/httpRoute.yaml @@ -0,0 +1,25 @@ +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ $.Values.rmq_cluster_name }} + namespace: {{ $.Values.namespace }} +spec: + parentRefs: + - name: {{ $.Values.httpRoute.parentRef.name }} + namespace: {{ $.Values.httpRoute.parentRef.namespace }} + hostnames: + - {{ $.Values.httpRoute.hostnames | quote }} + rules: + - matches: + - path: + type: {{ $.Values.httpRoute.path.type }} + value: {{ $.Values.httpRoute.path.value }} + filters: + - type: URLRewrite + urlRewrite: + path: + type: {{ $.Values.httpRoute.rewrite.path.type }} + replacePrefixMatch: {{ $.Values.httpRoute.rewrite.path.replacePrefixMatch }} + backendRefs: + - name: {{ $.Values.rmq_cluster_name }} + port: {{ $.Values.httpRoute.backendRef.port }} diff --git a/components/shared/message-broker/rmq-message-broker-chart/values-httpRoute.yaml b/components/shared/message-broker/rmq-message-broker-chart/values-httpRoute.yaml new file mode 100644 index 00000000..e52f7762 --- /dev/null +++ b/components/shared/message-broker/rmq-message-broker-chart/values-httpRoute.yaml @@ -0,0 +1,14 @@ +httpRoute: + parentRef: + name: envoy-gateway + namespace: envoy-gateway-system + hostnames: "*.developers.facilities.rl.ac.uk" + path: + type: PathPrefix + value: /rmq + rewrite: + path: + type: ReplacePrefixMatch + replacePrefixMatch: "" + backendRef: + port: 15672 \ No newline at end of file diff --git a/components/submissions/uop-exchange-secret/.helmignore b/components/submissions/uop-exchange-secret/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/components/submissions/uop-exchange-secret/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/components/submissions/uop-exchange-secret/Chart.yaml b/components/submissions/uop-exchange-secret/Chart.yaml new file mode 100644 index 00000000..442aeafa --- /dev/null +++ b/components/submissions/uop-exchange-secret/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: uop-exchange-secret-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.2.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.2.0" diff --git a/components/submissions/uop-exchange-secret/templates/uop-exchange-static-secret.yaml b/components/submissions/uop-exchange-secret/templates/uop-exchange-static-secret.yaml new file mode 100644 index 00000000..c3ab6f63 --- /dev/null +++ b/components/submissions/uop-exchange-secret/templates/uop-exchange-static-secret.yaml @@ -0,0 +1,22 @@ +apiVersion: secrets.hashicorp.com/v1beta1 +kind: VaultStaticSecret +metadata: + name: uop-exchange-secret + namespace: apps +spec: + type: kv-v2 + refreshAfter: 30s + vaultAuthRef: static-auth + mount: uop + path: {{ $.Values.env }}/rabbitmq/ + destination: + name: uop-exchange-secret + overwrite: true + create: true + transformation: + templates: + username: + text: "{{`{{ get .Secrets \"username\" }}`}}" + password: + text: "{{`{{ get .Secrets \"password\" }}`}}" + diff --git a/components/submissions/uop-exchange-secret/values-dev.yaml b/components/submissions/uop-exchange-secret/values-dev.yaml new file mode 100644 index 00000000..4a067a0b --- /dev/null +++ b/components/submissions/uop-exchange-secret/values-dev.yaml @@ -0,0 +1 @@ +env: dev \ No newline at end of file diff --git a/components/submissions/uop-exchange-secret/values-prod.yaml b/components/submissions/uop-exchange-secret/values-prod.yaml new file mode 100644 index 00000000..46b998ba --- /dev/null +++ b/components/submissions/uop-exchange-secret/values-prod.yaml @@ -0,0 +1 @@ +env: prod \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/.helmignore b/components/submissions/uop-exchange-topology/.helmignore new file mode 100644 index 00000000..0e8a0eb3 --- /dev/null +++ b/components/submissions/uop-exchange-topology/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/components/submissions/uop-exchange-topology/Chart.yaml b/components/submissions/uop-exchange-topology/Chart.yaml new file mode 100644 index 00000000..fbe287d2 --- /dev/null +++ b/components/submissions/uop-exchange-topology/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: uop-exchange-topology-chart +description: A Helm chart for Kubernetes + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +# It is recommended to use it with quotes. +appVersion: "0.1.0" diff --git a/components/submissions/uop-exchange-topology/templates/proposals-bindings.yaml b/components/submissions/uop-exchange-topology/templates/proposals-bindings.yaml new file mode 100644 index 00000000..f4c4a824 --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-bindings.yaml @@ -0,0 +1,16 @@ +{{- range .Values.binding }} +apiVersion: rabbitmq.com/v1beta1 +kind: Binding +metadata: + name: {{ .name | lower | replace "_" "-" }}-binding + namespace: {{ $.Values.namespace }} +spec: + vhost: {{ $.Values.uop_exchange_vhost}} + routingKey: {{ index . "routing_key" }} + source: {{ .source }} + destination: {{ .destination }} + destinationType: {{ index . "destination_type" | default "queue"}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{ end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-exchanges.yaml b/components/submissions/uop-exchange-topology/templates/proposals-exchanges.yaml new file mode 100644 index 00000000..376afd73 --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-exchanges.yaml @@ -0,0 +1,17 @@ +{{- range .Values.exchange}} +apiVersion: rabbitmq.com/v1beta1 +kind: Exchange +metadata: + name: {{ .name | lower | replace "_" "-"}}-exchange + namespace: {{ $.Values.namespace }} +spec: + name: {{ .name }} + autoDelete: {{ index . "auto-delete" | default "false" }} + durable: {{ .durable | default "true" }} + type: {{ .type | default "direct"}} + vhost: {{ $.Values.uop_exchange_vhost}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain +--- +{{ end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-policies.yaml b/components/submissions/uop-exchange-topology/templates/proposals-policies.yaml new file mode 100644 index 00000000..c723744b --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-policies.yaml @@ -0,0 +1,22 @@ +{{- range .Values.policy }} +apiVersion: rabbitmq.com/v1beta1 +kind: Policy +metadata: + name: {{ .name | lower | replace "_" "-" }}-policy + namespace: {{ $.Values.namespace }} +spec: + name: {{ .name }} + pattern: {{ .pattern }} + applyTo: {{ index . "apply-to" | default "queues"}} + definition: + {{- if index .definition "dead-letter-exchange" }} + dead-letter-exchange: {{ index .definition "dead-letter-exchange" }} + {{- end }} + {{- if index .definition "dead-letter-routing-key" }} + dead-letter-routing-key: {{ index .definition "dead-letter-routing-key" }} + {{- end }} + vhost: {{ $.Values.uop_exchange_vhost}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- + {{ end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-queues.yaml b/components/submissions/uop-exchange-topology/templates/proposals-queues.yaml new file mode 100644 index 00000000..bc24a573 --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-queues.yaml @@ -0,0 +1,17 @@ +{{- range .Values.queue}} +apiVersion: rabbitmq.com/v1beta1 +kind: Queue +metadata: + name: {{ .name | lower | replace "_" "-"}}-queue + namespace: {{ $.Values.namespace }} +spec: + name: {{ .name }} + autoDelete: {{ index . "auto-delete" | default "false" }} + durable: {{ .durable | default "true" }} + type: quorum + vhost: {{ $.Values.uop_exchange_vhost}} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain +--- +{{ end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-user-permissions.yaml b/components/submissions/uop-exchange-topology/templates/proposals-user-permissions.yaml new file mode 100644 index 00000000..814c78a9 --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-user-permissions.yaml @@ -0,0 +1,17 @@ +{{- range $user, $config := .Values.users }} +apiVersion: rabbitmq.com/v1beta1 +kind: Permission +metadata: + name: {{ $user }}-permission + namespace: {{ $.Values.namespace | default "apps" }} +spec: + vhost: {{ $.Values.uop_exchange_vhost }} + user: {{ $user }} + permissions: + configure: {{ $config.permissions.configure | default "(?!)" }} + write: {{ $config.permissions.write | default "(?!)" }} + read: {{ $config.permissions.read | default "(?!)" }} + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{- end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-user.yaml b/components/submissions/uop-exchange-topology/templates/proposals-user.yaml new file mode 100644 index 00000000..0bc4ccbe --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-user.yaml @@ -0,0 +1,19 @@ +{{- range $user, $config := .Values.users }} +apiVersion: rabbitmq.com/v1beta1 +kind: User +metadata: + name: {{ $user }} + namespace: {{ $.Values.namespace }} +spec: + {{- if $config.tags }} + tags: + {{- range $config.tags }} + - {{ . }} + {{- end }} + {{- end }} + importCredentialsSecret: + name: uop-exchange-secret + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} +--- +{{- end }} \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/templates/proposals-vhost.yaml b/components/submissions/uop-exchange-topology/templates/proposals-vhost.yaml new file mode 100644 index 00000000..adff2433 --- /dev/null +++ b/components/submissions/uop-exchange-topology/templates/proposals-vhost.yaml @@ -0,0 +1,14 @@ +apiVersion: rabbitmq.com/v1beta1 +kind: Vhost +metadata: + name: {{ $.Values.uop_exchange_vhost }} + namespace: {{ $.Values.namespace }} + annotations: + argocd.argoproj.io/sync-wave: "-2" +spec: + name: {{ $.Values.uop_exchange_vhost }} + defaultQueueType: quorum # quorum | classic | stream + rabbitmqClusterReference: + name: {{ $.Values.rmq_cluster_name }} + deletionPolicy: retain + \ No newline at end of file diff --git a/components/submissions/uop-exchange-topology/values-dev.yaml b/components/submissions/uop-exchange-topology/values-dev.yaml new file mode 100644 index 00000000..d27920f5 --- /dev/null +++ b/components/submissions/uop-exchange-topology/values-dev.yaml @@ -0,0 +1,47 @@ + +uop_exchange_vhost: proposals + +users: + proposal-submission-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + proposal-allocations-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + + +exchange: + - name: user_office_backend.fanout + type: fanout + - name: allocations-dead-letter-exchange + type: direct + +queue: + - name: proposal-allocations + - name: allocations-dead-letter-queue + +binding: +- name: proposal-allocations + source: user_office_backend.fanout + destination: proposal-allocations + destination_type: queue +- name: allocations-dead-letter-queue + source: allocations-dead-letter-exchange + destination: allocations-dead-letter-queue + destination_type: queue + routing_key: dead + +policy: + - name: proposal-allocations + pattern: ^proposal-allocations$ + definition: + dead-letter-exchange: allocations-dead-letter-exchange + dead-letter-routing-key: dead diff --git a/components/submissions/uop-exchange-topology/values-prod.yaml b/components/submissions/uop-exchange-topology/values-prod.yaml new file mode 100644 index 00000000..d27920f5 --- /dev/null +++ b/components/submissions/uop-exchange-topology/values-prod.yaml @@ -0,0 +1,47 @@ + +uop_exchange_vhost: proposals + +users: + proposal-submission-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + proposal-allocations-user: + tags: + - management + permissions: + configure: .* + write: .* + read: .* + + +exchange: + - name: user_office_backend.fanout + type: fanout + - name: allocations-dead-letter-exchange + type: direct + +queue: + - name: proposal-allocations + - name: allocations-dead-letter-queue + +binding: +- name: proposal-allocations + source: user_office_backend.fanout + destination: proposal-allocations + destination_type: queue +- name: allocations-dead-letter-queue + source: allocations-dead-letter-exchange + destination: allocations-dead-letter-queue + destination_type: queue + routing_key: dead + +policy: + - name: proposal-allocations + pattern: ^proposal-allocations$ + definition: + dead-letter-exchange: allocations-dead-letter-exchange + dead-letter-routing-key: dead