diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2d393f19b..eaaabe1cd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,8 +20,6 @@ jobs: run: make unit-tests - name: Integration tests run: make integration-tests - - name: Helm chart tests - run: make chart-tests test-all-examples: name: test-all-examples diff --git a/Makefile b/Makefile index 05682670f..021105a1c 100644 --- a/Makefile +++ b/Makefile @@ -163,15 +163,11 @@ kind-unprepare: ## Remove KIND support for LoadBalancer services system-tests: install-tools ## Run end-to-end tests against Kubernetes cluster defined in ~/.kube/config NAMESPACE="rabbitmq-system" ginkgo -nodes=3 -randomizeAllSpecs -r system_tests/ -chart-tests: ## Run Helm chart tests - echo "running charts tests" - cd charts/rabbitmq && ./test.sh - kubectl-plugin-tests: ## Run kubectl-rabbitmq tests echo "running kubectl plugin tests" ./bin/kubectl-rabbitmq.bats -tests: unit-tests integration-tests system-tests chart-tests kubectl-plugin-tests +tests: unit-tests integration-tests system-tests kubectl-plugin-tests docker-registry-secret: check-env-docker-credentials operator-namespace echo "creating registry secret and patching default service account" diff --git a/charts/README.md b/charts/README.md deleted file mode 100644 index 021c1a336..000000000 --- a/charts/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# RabbitMQ Cluster Helm chart - -This folder contains the `rabbitmq` Helm chart to deploy a `RabbitmqCluster` resource. diff --git a/charts/rabbitmq/.gitignore b/charts/rabbitmq/.gitignore deleted file mode 100644 index 15681324c..000000000 --- a/charts/rabbitmq/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -rabbitmq-*.tgz -template-output diff --git a/charts/rabbitmq/Chart.yaml b/charts/rabbitmq/Chart.yaml deleted file mode 100644 index f1af71b4a..000000000 --- a/charts/rabbitmq/Chart.yaml +++ /dev/null @@ -1,21 +0,0 @@ -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -# - -name: rabbitmq -description: RabbitMQ Cluster -apiVersion: v2 -version: 0.9.0 -appVersion: 3.8.19 -keywords: - - rabbitmq - - message queue - - AMQP -home: https://www.rabbitmq.com -icon: https://www.rabbitmq.com/img/rabbitmq_logo_strap.png -engine: gotpl diff --git a/charts/rabbitmq/example-configurations.yaml b/charts/rabbitmq/example-configurations.yaml deleted file mode 100644 index 642ab155a..000000000 --- a/charts/rabbitmq/example-configurations.yaml +++ /dev/null @@ -1,94 +0,0 @@ -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -# - -labels: - label1: foo - label2: bar - -annotations: - annotation1: foo - annotation2: bar - -replicas: 3 - -image: "rabbitmq:3.8.19-management" - -imagePullSecrets: - - name: foo - -service: - type: LoadBalancer - annotations: - cloud.google.com/load-balancer-type: "Internal" - -persistence: - storageClassName: foo - storage: "30Gi" - -resources: - requests: - cpu: 777m - memory: 1Gi - limits: - cpu: 888m - memory: 1Gi - -tolerations: - - key: "dedicated" - operator: "Equal" - value: "rabbitmq" - effect: "NoSchedule" - -rabbitmq: - additionalPlugins: - - rabbitmq_shovel - - rabbitmq_shovel_management - additionalConfig: | - cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s - envConfig: | - PLUGINS_DIR=/opt/rabbitmq/plugins:/opt/rabbitmq/community-plugins - advancedConfig: | - advancedConfig: | - [ - {ra, [ - {wal_data_dir, '/var/lib/rabbitmq/quorum-wal'} - ]} - ]. - -affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/e2e-az-name - operator: In - values: - - e2e-az1 - - e2e-az2 - -tls: - secretName: tls-secret - caSecretName: tls-ca-secret - disableNonTLSListeners: true - -terminationGracePeriodSeconds: 42 - -skipPostDeploySteps: true - -override: - statefulSet: - spec: - template: - spec: - containers: - - name: rabbitmq - ports: - - containerPort: 12345 # opens an additional port on the rabbitmq server container - name: additional-port - protocol: TCP diff --git a/charts/rabbitmq/expected-template-output b/charts/rabbitmq/expected-template-output deleted file mode 100644 index c22faee6a..000000000 --- a/charts/rabbitmq/expected-template-output +++ /dev/null @@ -1,90 +0,0 @@ ---- -# Source: rabbitmq/templates/rabbitmq.yaml -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. - -apiVersion: rabbitmq.com/v1beta1 -kind: RabbitmqCluster -metadata: - name: rabbitmq - labels: - label1: foo - label2: bar - annotations: - annotation1: foo - annotation2: bar - -spec: - image: rabbitmq:3.8.19-management - imagePullSecrets: - - name: foo - replicas: 3 - service: - type: LoadBalancer - annotations: - cloud.google.com/load-balancer-type: Internal - persistence: - storageClassName: foo - storage: 30Gi - tolerations: - - effect: NoSchedule - key: dedicated - operator: Equal - value: rabbitmq - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/e2e-az-name - operator: In - values: - - e2e-az1 - - e2e-az2 - resources: - limits: - cpu: 888m - memory: 1Gi - requests: - cpu: 777m - memory: 1Gi - rabbitmq: - additionalPlugins: - - rabbitmq_shovel - - rabbitmq_shovel_management - additionalConfig: - | - cluster_formation.peer_discovery_backend = rabbit_peer_discovery_k8s - envConfig: - | - PLUGINS_DIR=/opt/rabbitmq/plugins:/opt/rabbitmq/community-plugins - advancedConfig: - | - advancedConfig: | - [ - {ra, [ - {wal_data_dir, '/var/lib/rabbitmq/quorum-wal'} - ]} - ]. - tls: - secretName: tls-secret - caSecretName: tls-ca-secret - disableNonTLSListeners: true - override: - statefulSet: - spec: - template: - spec: - containers: - - name: rabbitmq - ports: - - containerPort: 12345 - name: additional-port - protocol: TCP - skipPostDeploySteps: true - terminationGracePeriodSeconds: 42 diff --git a/charts/rabbitmq/templates/rabbitmq.yaml b/charts/rabbitmq/templates/rabbitmq.yaml deleted file mode 100644 index c918c771f..000000000 --- a/charts/rabbitmq/templates/rabbitmq.yaml +++ /dev/null @@ -1,121 +0,0 @@ -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. - -apiVersion: rabbitmq.com/v1beta1 -kind: RabbitmqCluster -metadata: - name: rabbitmq - {{- if .Values.labels }} - labels: -{{ toYaml .Values.labels | indent 4 }} - {{- end }} - - {{- if .Values.annotations }} - annotations: -{{ toYaml .Values.annotations | indent 4 }} - {{- end }} - -spec: - - {{- if .Values.image }} - image: {{ .Values.image }} - {{- end }} - - {{- if .Values.imagePullSecrets }} - imagePullSecrets: -{{ toYaml .Values.imagePullSecrets | indent 2 }} - {{- end }} - - {{- if .Values.replicas }} - replicas: {{ .Values.replicas }} - {{- end }} - - {{- if .Values.service }} - service: - type: {{ .Values.service.type }} - {{- if .Values.service.annotations }} - annotations: -{{ toYaml .Values.service.annotations | indent 6 }} - {{- end }} - {{- end }} - - {{- if .Values.persistence }} - persistence: - {{- if .Values.persistence.storageClassName }} - storageClassName: {{ .Values.persistence.storageClassName }} - {{- end }} - {{- if .Values.persistence.storage }} - storage: {{ .Values.persistence.storage }} - {{- end }} - {{- end }} - - {{- if .Values.tolerations }} - tolerations: -{{ toYaml .Values.tolerations | indent 2 }} - {{- end }} - - {{- if .Values.affinity }} - affinity: -{{ toYaml .Values.affinity | indent 4 }} - {{- end }} - - {{- if .Values.resources }} - resources: -{{ toYaml .Values.resources | indent 4 }} - {{- end }} - - {{- if .Values.rabbitmq }} - rabbitmq: - - {{- if .Values.rabbitmq.additionalPlugins }} - additionalPlugins: -{{ toYaml .Values.rabbitmq.additionalPlugins | indent 4 }} - {{- end }} - - {{- if .Values.rabbitmq.additionalConfig }} - additionalConfig: -{{ toYaml .Values.rabbitmq.additionalConfig | indent 4 }} - {{- end }} - - {{- if .Values.rabbitmq.envConfig }} - envConfig: -{{ toYaml .Values.rabbitmq.envConfig | indent 4 }} - {{- end }} - - {{- if .Values.rabbitmq.advancedConfig }} - advancedConfig: -{{ toYaml .Values.rabbitmq.advancedConfig | indent 4 }} - {{- end }} - - {{- end }} - - {{- if .Values.tls }} - tls: - {{- if .Values.tls.secretName }} - secretName: {{ .Values.tls.secretName }} - {{- end }} - {{- if .Values.tls.caSecretName }} - caSecretName: {{ .Values.tls.caSecretName }} - {{- end }} - {{- if .Values.tls.disableNonTLSListeners }} - disableNonTLSListeners: {{ .Values.tls.disableNonTLSListeners }} - {{- end }} - {{- end }} - - {{- if .Values.override }} - override: -{{ toYaml .Values.override | indent 4 }} - {{- end }} - - {{- if .Values.skipPostDeploySteps }} - skipPostDeploySteps: {{ toYaml .Values.skipPostDeploySteps }} - {{- end }} - - {{- if .Values.terminationGracePeriodSeconds }} - terminationGracePeriodSeconds: {{ toYaml .Values.terminationGracePeriodSeconds }} - {{- end }} diff --git a/charts/rabbitmq/test.sh b/charts/rabbitmq/test.sh deleted file mode 100755 index 971e606ab..000000000 --- a/charts/rabbitmq/test.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. - -set -e -set -o pipefail - -chart=$(helm package . | awk '{print $NF}') - -helm template $chart -f example-configurations.yaml > template-output - -# it should be updated if we add any new configurations -diff -u template-output expected-template-output && echo "Successfully rendered the template" - - -if [[ "$1" == "properties" ]]; then - if ! yq --version | grep -q 'yq version 3'; then - echo "Please install https://github.com/mikefarah/yq v3" - exit 1 - fi - - for p in $(kubectl eg rabbitmqclusters.rabbitmq.com | yq d - spec.resources | yq d - spec.tolerations | yq d - spec.override | yq d - spec.affinity | yq r - spec | grep -v ' - ' | awk -F: '{ print $1 }'); do - grep -q "$p " templates/rabbitmq.yaml - if [[ $? != 0 ]]; then - echo "FAIL: Property $p not exposed in the helm chart" - exit 1 - fi - done - echo "Seems like all CRD properties are exposed in the helm chart" -fi diff --git a/charts/rabbitmq/values-production.yaml b/charts/rabbitmq/values-production.yaml deleted file mode 100644 index 7d490949b..000000000 --- a/charts/rabbitmq/values-production.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -# - -replicas: 3 diff --git a/charts/rabbitmq/values.yaml b/charts/rabbitmq/values.yaml deleted file mode 100644 index d8533687c..000000000 --- a/charts/rabbitmq/values.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# RabbitMQ Cluster Operator -# -# Copyright 2020 VMware, Inc. All Rights Reserved. -# -# This product is licensed to you under the Mozilla Public license, Version 2.0 (the "License"). You may not use this product except in compliance with the Mozilla Public License. -# -# This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. -# - -replicas: 1 \ No newline at end of file