diff --git a/apis/installer/v1alpha1/zz_generated.deepcopy.go b/apis/installer/v1alpha1/zz_generated.deepcopy.go index a05fa494f..0dc674374 100644 --- a/apis/installer/v1alpha1/zz_generated.deepcopy.go +++ b/apis/installer/v1alpha1/zz_generated.deepcopy.go @@ -2323,6 +2323,8 @@ func (in *PSP) DeepCopyInto(out *PSP) { out.Proxysql = in.Proxysql out.Redis = in.Redis out.Kafka = in.Kafka + out.KafkaConnector = in.KafkaConnector + out.Rabbitmq = in.Rabbitmq return } @@ -2480,6 +2482,22 @@ func (in *PSPProxysql) DeepCopy() *PSPProxysql { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *PSPRabbitmq) DeepCopyInto(out *PSPRabbitmq) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PSPRabbitmq. +func (in *PSPRabbitmq) DeepCopy() *PSPRabbitmq { + if in == nil { + return nil + } + out := new(PSPRabbitmq) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *PSPRedis) DeepCopyInto(out *PSPRedis) { *out = *in diff --git a/catalog/kubedb/active_versions.json b/catalog/kubedb/active_versions.json index 25f43bd5e..d42f21af6 100644 --- a/catalog/kubedb/active_versions.json +++ b/catalog/kubedb/active_versions.json @@ -107,6 +107,9 @@ "2.3.2-debian", "2.3.2-centos" ], + "Rabbitmq": [ + "3.12" + ], "Redis": [ "7.2.3", "7.0.14", diff --git a/catalog/kubedb/raw/rabbitmq/rabbitmq-3.12.yaml b/catalog/kubedb/raw/rabbitmq/rabbitmq-3.12.yaml new file mode 100644 index 000000000..89a61fbd7 --- /dev/null +++ b/catalog/kubedb/raw/rabbitmq/rabbitmq-3.12.yaml @@ -0,0 +1,14 @@ +apiVersion: catalog.kubedb.com/v1alpha1 +kind: RabbitmqVersion +metadata: + name: "3.12" +spec: + db: + image: rabbitmq:3.12-management + initContainer: + image: raihankhanraka/rabbitmq-init:3.12 + podSecurityPolicies: + databasePolicyName: rabbitmq-db + securityContext: + runAsUser: 1001 + version: "3.12" diff --git a/catalog/kubedb/raw/rabbitmq/rabbitmq-psp.yaml b/catalog/kubedb/raw/rabbitmq/rabbitmq-psp.yaml new file mode 100644 index 000000000..d3fa29f7f --- /dev/null +++ b/catalog/kubedb/raw/rabbitmq/rabbitmq-psp.yaml @@ -0,0 +1,20 @@ +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: rabbitmq-db +spec: + allowPrivilegeEscalation: false + fsGroup: + rule: RunAsAny + hostIPC: false + hostNetwork: false + hostPID: false + privileged: false + runAsUser: + rule: RunAsAny + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + volumes: + - '*' diff --git a/catalog/kubestash/fmt/main.go b/catalog/kubestash/fmt/main.go index 09ff22698..03c61f86e 100644 --- a/catalog/kubestash/fmt/main.go +++ b/catalog/kubestash/fmt/main.go @@ -275,6 +275,10 @@ func main() { if strings.HasPrefix(args[i], "--redis-args=") { args[i] = fmt.Sprintf(`--redis-args=${args:={{ .Values.%s.args }}}`, app) } + case "rabbitmq": + if strings.HasPrefix(args[i], "--rabbitmq-args=") { + args[i] = fmt.Sprintf(`--rabbitmq-args=${args:={{ .Values.%s.args }}}`, app) + } } } diff --git a/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-3.12.yaml b/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-3.12.yaml new file mode 100644 index 000000000..3d41b0f96 --- /dev/null +++ b/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-3.12.yaml @@ -0,0 +1,24 @@ +{{ $featureGates := .Values.featureGates }} +{{- if .Values.global }} + {{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }} +{{- end }} + +{{ if $featureGates.Rabbitmq }} + +apiVersion: catalog.kubedb.com/v1alpha1 +kind: RabbitmqVersion +metadata: + name: '3.12' + labels: + {{- include "kubedb-catalog.labels" . | nindent 4 }} +spec: + db: + image: '{{ include "image.dockerLibrary" (merge (dict "_repo" "rabbitmq") $) }}:3.12-management' + initContainer: + image: '{{ include "image.dockerHub" (merge (dict "_repo" "raihankhanraka/rabbitmq-init") $) }}:3.12' + podSecurityPolicies: + databasePolicyName: rabbitmq-db + securityContext: + runAsUser: 1001 + version: "3.12" +{{ end }} diff --git a/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-psp.yaml b/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-psp.yaml new file mode 100644 index 000000000..519c28811 --- /dev/null +++ b/charts/kubedb-catalog/templates/rabbitmq/rabbitmq-psp.yaml @@ -0,0 +1,29 @@ +{{ $featureGates := .Values.featureGates }} +{{- if .Values.global }} + {{ $featureGates = mergeOverwrite dict .Values.featureGates .Values.global.featureGates }} +{{- end }} + +{{ if and .Values.psp.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") $featureGates.Rabbitmq }} +apiVersion: policy/v1beta1 +kind: PodSecurityPolicy +metadata: + name: 'rabbitmq-db' + labels: + {{- include "kubedb-catalog.labels" . | nindent 4 }} +spec: + allowPrivilegeEscalation: {{ .Values.psp.rabbitmq.allowPrivilegeEscalation }} + privileged: {{ .Values.psp.rabbitmq.privileged }} + fsGroup: + rule: RunAsAny + hostIPC: false + hostNetwork: false + hostPID: false + runAsUser: + rule: RunAsAny + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + volumes: + - '*' +{{ end }} diff --git a/charts/kubedb-catalog/values.openapiv3_schema.yaml b/charts/kubedb-catalog/values.openapiv3_schema.yaml index 86bbead08..8a02a95e0 100644 --- a/charts/kubedb-catalog/values.openapiv3_schema.yaml +++ b/charts/kubedb-catalog/values.openapiv3_schema.yaml @@ -119,6 +119,16 @@ properties: - allowPrivilegeEscalation - privileged type: object + rabbitmq: + properties: + allowPrivilegeEscalation: + type: boolean + privileged: + type: boolean + required: + - allowPrivilegeEscalation + - privileged + type: object redis: properties: allowPrivilegeEscalation: diff --git a/charts/kubedb-catalog/values.yaml b/charts/kubedb-catalog/values.yaml index d75c73fef..d72c72a16 100644 --- a/charts/kubedb-catalog/values.yaml +++ b/charts/kubedb-catalog/values.yaml @@ -40,7 +40,7 @@ featureGates: PgPool: false Postgres: true ProxySQL: true - RabbitMQ: false + Rabbitmq: true Redis: true SingleStore: false Solr: false @@ -78,6 +78,9 @@ psp: kafka: allowPrivilegeEscalation: false privileged: false + rabbitmq: + allowPrivilegeEscalation: false + privileged: false # Set true to avoid deploying deprecated versions skipDeprecated: true diff --git a/charts/kubedb-webhook-server/README.md b/charts/kubedb-webhook-server/README.md index e17c370da..572553ca3 100644 --- a/charts/kubedb-webhook-server/README.md +++ b/charts/kubedb-webhook-server/README.md @@ -75,9 +75,9 @@ The following table lists the configurable parameters of the `kubedb-webhook-ser | featureGates.PgPool | | false | | featureGates.Postgres | | true | | featureGates.ProxySQL | | true | -| featureGates.RabbitMQ | | false | +| featureGates.RabbitMQ | | true | | featureGates.Redis | | true | -| featureGates.SingleStore | | false | +| featureGates.Singlestore | | false | | featureGates.Solr | | false | | featureGates.ZooKeeper | | true | | imagePullSecrets | Specify an array of imagePullSecrets. Secrets must be manually created in the namespace.
Example:
`helm template charts/kubedb-webhook-server \`
`--set imagePullSecrets[0].name=sec0 \`
`--set imagePullSecrets[1].name=sec1` | [] | diff --git a/charts/kubedb-webhook-server/values.yaml b/charts/kubedb-webhook-server/values.yaml index a5f9877b5..b50a7dbb0 100644 --- a/charts/kubedb-webhook-server/values.yaml +++ b/charts/kubedb-webhook-server/values.yaml @@ -65,9 +65,9 @@ featureGates: PgPool: false Postgres: true ProxySQL: true - RabbitMQ: false + RabbitMQ: true Redis: true - SingleStore: false + Singlestore: false Solr: false ZooKeeper: true diff --git a/charts/kubedb/values.openapiv3_schema.yaml b/charts/kubedb/values.openapiv3_schema.yaml index 02ffb5063..2659ded89 100644 --- a/charts/kubedb/values.openapiv3_schema.yaml +++ b/charts/kubedb/values.openapiv3_schema.yaml @@ -1648,6 +1648,16 @@ properties: - allowPrivilegeEscalation - privileged type: object + rabbitmq: + properties: + allowPrivilegeEscalation: + type: boolean + privileged: + type: boolean + required: + - allowPrivilegeEscalation + - privileged + type: object redis: properties: allowPrivilegeEscalation: diff --git a/hack/scripts/import-crds.sh b/hack/scripts/import-crds.sh index 1f2bb4304..fa914dc01 100755 --- a/hack/scripts/import-crds.sh +++ b/hack/scripts/import-crds.sh @@ -20,7 +20,7 @@ crd_dir=${1:-}/apimachinery/crds update_kubedb_crds=true api_repo_url=https://github.com/kubedb/apimachinery.git -api_repo_tag=${KUBEDB_APIMACHINERY_TAG:-master} +api_repo_tag=${KUBEDB_APIMACHINERY_TAG:-rabbitmq} if [ "$#" -ne 1 ]; then if [ "${api_repo_tag}" == "master" ]; then